packageStatesConfiguration. */ protected function loadPackageStates() { try { parent::loadPackageStates(); } catch (PackageStatesUnavailableException $exception) { $this->inFailsafeMode = true; $this->scanAvailablePackages(); } } /** * Never try to access the cache in failsafe mode */ protected function saveToPackageCache(): void { // Do not save cache if in rescue mode if (!$this->inFailsafeMode) { parent::saveToPackageCache(); } } /** * Save states */ protected function savePackageStates() { // Do not save if in rescue mode if (!$this->inFailsafeMode) { parent::savePackageStates(); } } /** * To enable writing of the package states file the package states * migration needs to override eventual failsafe blocks. */ public function forceSortAndSavePackageStates() { $this->sortActivePackagesByDependencies(); parent::savePackageStates(); } /** * This method is a workaround for SetupService to make sure that this PackageManager * can be used to mutate PackageStates to apply changes for distribution package * activation. * * @todo Consider creating a non-failsafe PackageManager in BootService, to avoid * the need to disable failsafe mode, where it should not be enabled * @internal */ public function disableFailsafeMode(): void { $this->inFailsafeMode = false; } }