TYPO3 CMS  TYPO3_6-2
FailsafePackageManager.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Core\Package;
3 
18 
25 
30 
34  protected $inFailsafeMode = FALSE;
35 
39  public function __construct() {
40  $this->configurationManager = new \TYPO3\CMS\Core\Configuration\ConfigurationManager;
41  parent::__construct();
42  }
43 
50  protected function loadPackageStates() {
51  try {
52  parent::loadPackageStates();
53  } catch (\TYPO3\CMS\Core\Package\Exception\PackageStatesUnavailableException $exception) {
54  $this->inFailsafeMode = TRUE;
55  $this->packageStatesConfiguration = array();
56  $this->scanAvailablePackages();
57  }
58  }
59 
66  protected function registerPackagesFromConfiguration() {
67  $this->packageStatesConfiguration['packages']['install']['state'] = 'active';
68  parent::registerPackagesFromConfiguration();
69  }
70 
76  protected function sortAndSavePackageStates() {
77  // Do not save if in rescue mode
78  if (!$this->inFailsafeMode) {
79  parent::sortAndSavePackageStates();
80  }
81  }
82 
87  public function forceSortAndSavePackageStates() {
88  parent::sortAndSavePackageStates();
89  }
90 }