/** * Return task collection for 'dump:update' command. * * @param string $environment * An environment string. * * @return \Robo\Collection\Collection * The task collection. */ protected function dumpUpdateCollection($environment) { $dump = PathResolver::databaseDump(); $collection = $this->collection(); // Initialize site. $collection->add($this->taskSiteInitialize($environment)->collection()); $collection->add(['Base.sqlDrop' => $this->taskDrushSqlDrop(), 'Base.databaseDumpImport' => $this->taskDatabaseDumpImport($dump)]); // Perform update tasks. $collection->add($this->taskSiteUpdate($environment)->collection()); $collection->add(['Base.databaseDumpExport' => $this->taskDatabaseDumpExport($dump)]); return $collection; }
/** * 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; }