Ejemplo n.º 1
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;
 }
Ejemplo n.º 2
0
 /**
  * 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;
 }
Ejemplo n.º 3
0
 /**
  * Ensures that the path to Acquia DevDesktop is set correctly
  */
 public function ensureDevdesktopPath()
 {
     $path = PathResolver::getDevdesktopPath();
     while (!file_exists($path)) {
         $path = $this->ask('Path to DevDesktop');
         if ($path == "") {
             $this->say('WARNING: Will use default binarys!');
             $path = NULL;
             break;
         }
     }
     PathResolver::setDevdesktopPath($path);
 }
Ejemplo n.º 4
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;
 }
 /**
  * {@inheritdoc}
  */
 protected function skip()
 {
     return parent::skip() || !PathResolver::translationFilesDirectory();
 }
Ejemplo n.º 6
0
 /**
  * Constructor.
  *
  * @param string $environment
  *   An environment string.
  */
 public function __construct($environment)
 {
     $this->environment = $environment;
     $this->file = PathResolver::siteDirectory() . '/settings.' . $environment . '.php';
 }
 /**
  * {@inheritdoc}
  */
 protected function getPath()
 {
     return PathResolver::publicFilesDirectory();
 }
Ejemplo n.º 8
0
 /**
  * Return Drush executable.
  *
  * @return \Robo\Task\Base\Exec
  */
 public static function exec()
 {
     $exec = (new Exec(PathResolver::drush()))->dir(PathResolver::docroot());
     return $exec;
 }
 /**
  * {@inheritdoc}
  */
 protected function getPath()
 {
     return PathResolver::temporaryFilesDirectory();
 }
 /**
  * {@inheritdoc}
  */
 protected function getPath()
 {
     return PathResolver::privateFilesDirectory();
 }