Example #1
0
 /**
  * Return task collection for this task.
  *
  * @return \Robo\Collection\Collection
  *   The task collection.
  */
 public function collection()
 {
     $collection = new Collection();
     // Set up filesystem.
     $collection->add((new SetupFileSystem($this->environment))->collection());
     $collection->add(['Update.cacheRebuild' => new CacheRebuild(), 'Update.drushConfigImport' => new ConfigImport(), 'Update.applyDatabaseUpdates' => new ApplyDatabaseUpdates(), 'Update.drushConfigImportAgain' => new ConfigImport(), 'Update.applyEntitySchemaUpdates' => new ApplyEntitySchemaUpdates(), 'Update.cacheRebuildAgain' => new CacheRebuild(), 'Install.localeUpdate' => new LocaleUpdate()]);
     return $collection;
 }
Example #2
0
 /**
  * Return task collection for this task.
  *
  * @return \Robo\Collection\Collection
  *   The task collection.
  */
 public function collection()
 {
     $collection = new Collection();
     // Build has to be performed?
     if (Environment::needsBuild($this->environment)) {
         $collection->add(['Initialize.composerInstall' => (new ComposerInstall())->dir(PathResolver::root())->option('optimize-autoloader')]);
     }
     $collection->add(['Initialize.initializeEnvironment' => new \Thunder\Robo\Task\Environment\Initialize($this->environment), 'Initialize.ensureSettingsFile' => new EnsureSettingsFile($this->environment)]);
     return $collection;
 }
Example #3
0
 /**
  * Return task collection for this task.
  *
  * @return \Robo\Collection\Collection
  *   The task collection.
  */
 public function collection()
 {
     $collection = new Collection();
     $dump = PathResolver::databaseDump();
     // No database dump file present -> perform initial installation, export
     // configuration and create database dump file.
     if (!file_exists($dump)) {
         $collection->add(['Install.siteInstall' => new SiteInstall()]);
         // Set up file system.
         $collection->add((new SetupFileSystem($this->environment))->collection());
         $collection->add(['Install.enableExtensions' => new EnableExtension(['config', 'locale']), 'Install.localeUpdate' => new LocaleUpdate(), 'Install.cacheRebuild' => new CacheRebuild(), 'Install.configExport' => new ConfigExport(), 'Install.databaseDumpExport' => new Export($dump)]);
     } else {
         $collection->add(['Install.sqlDrop' => new SqlDrop(), 'Install.databaseDumpImport' => new Import($dump)]);
         // Perform site update tasks
         $collection->add((new Update($this->environment))->collection());
     }
     return $collection;
 }
Example #4
0
 public function testBeforeFilters()
 {
     $collection = new Collection();
     $taskA = new CollectionTestTask('a', 'value-a');
     $taskB = new CollectionTestTask('b', 'value-b');
     $collection->add($taskA, 'a-name')->add($taskB, 'b-name');
     // We add methods of our task instances as before and
     // after tasks. These methods have access to the task
     // class' fields, and may modify them as needed.
     $collection->before('b-name', [$taskA, 'parenthesizer'])->before('b-name', [$taskA, 'emphasizer'], 'special-before-name');
     $result = $collection->run();
     // Ensure that the results have the correct key values
     verify(implode(',', array_keys($result->getData())))->equals('a-name,b-name,special-before-name,time');
     // The result from the 'before' task is attached
     // to 'b-name', since it was called as before('b-name', ...)
     verify($result['b-name']['a'])->equals('(value-a)');
     // When a 'before' task is given its own name, then
     // its results are attached under that name.
     verify($result['special-before-name']['a'])->equals('*(value-a)*');
 }
Example #5
0
 public function testBeforeAndAfterFilters()
 {
     $collection = new Collection();
     $taskA = new CollectionTestTask('a', 'value-a');
     $taskB = new CollectionTestTask('b', 'value-b');
     $collection->add('a-name', $taskA)->add('b-name', $taskB);
     // We add methods of our task instances as before and
     // after tasks. These methods have access to the task
     // class' fields, and may modify them as needed.
     $collection->after('a-name', [$taskA, 'parenthesizer'])->after('a-name', [$taskA, 'emphasizer'])->after('b-name', [$taskB, 'emphasizer'])->after('b-name', [$taskB, 'parenthesizer'])->after('b-name', [$taskB, 'parenthesizer'], 'special-name');
     $result = $collection->run();
     // verify(var_export($result->getData(), true))->equals('');
     // Ensure that the results have the correct key values
     verify(implode(',', array_keys($result->getData())))->equals('a-name,b-name,special-name');
     // Verify that all of the after tasks ran in
     // the correct order.
     verify($result['a-name']['a'])->equals('*(value-a)*');
     verify($result['b-name']['b'])->equals('(*value-b*)');
     // Note that the last after task is added with a special name;
     // its results therefore show up under the name given, rather
     // than being stored under the name of the task it was added after.
     verify($result['special-name']['b'])->equals('((*value-b*))');
 }
Example #6
0
 /**
  * Return task collection for this task.
  *
  * @return \Robo\Collection\Collection
  *   The task collection.
  */
 public function collection()
 {
     $collection = new Collection();
     $collection->add(['Setup.ensurePrivateFilesDirectory' => new EnsurePrivateFilesDirectory($this->environment), 'Setup.ensurePublicFilesDirectory' => new EnsurePublicFilesDirectory($this->environment), 'Setup.ensureTemporaryFilesDirectory' => new EnsureTemporaryFilesDirectory($this->environment), 'Setup.ensureTranslationFilesDirectory' => new EnsureTranslationFilesDirectory($this->environment)]);
     return $collection;
 }