Exemplo n.º 1
0
 /**
  * Initialize the manager: read package information and register migrations.
  *
  * @return void
  */
 protected function initialize()
 {
     $this->packagesData = Tools::getPackagesData($this->packagesPath);
     $this->migrations = array();
     foreach ($this->packagesData as $packageKey => $packageData) {
         $this->registerMigrationFiles(Files::concatenatePaths(array($this->packagesPath, $packageData['category'], $packageKey)));
     }
 }
Exemplo n.º 2
0
 /**
  * Applies all registered searchAndReplace and searchAndReplaceRegex operations.
  *
  * @return void
  */
 protected function applySearchAndReplaceOperations()
 {
     $allPathsAndFilenames = \TYPO3\FLOW3\Utility\Files::readDirectoryRecursively($this->packageData['path'], NULL, TRUE);
     foreach ($this->operations['searchAndReplace'] as $operation) {
         foreach ($allPathsAndFilenames as $pathAndFilename) {
             $pathInfo = pathinfo($pathAndFilename);
             if (!isset($pathInfo['filename'])) {
                 continue;
             }
             if (strpos($pathAndFilename, 'Migrations/Code') !== FALSE) {
                 continue;
             }
             if ($operation[2] !== array()) {
                 if (!isset($pathInfo['extension']) || !in_array($pathInfo['extension'], $operation[2], TRUE)) {
                     continue;
                 }
             }
             Tools::searchAndReplace($operation[0], $operation[1], $pathAndFilename);
         }
     }
 }