Esempio n. 1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $this->dbname = $input->getOption('dbname');
     $this->dbprefix = $input->getOption('dbprefix');
     $this->nousers = $input->getOption('nousers');
     $this->versions = new Versions();
     if ($input->getOption('clear-cache')) {
         $this->versions->refresh();
     }
     $this->setVersion($input->getOption('joomla'));
     $this->symlink = $input->getOption('symlink');
     if (is_string($this->symlink)) {
         $this->symlink = explode(',', $this->symlink);
     }
     $this->sample_data = $input->getOption('sample-data');
     $this->source_db = $this->target_dir . '/installation/sql/mysql/joomla.sql';
     $this->check($input, $output);
     $this->createFolder($input, $output);
     $this->createDatabase($input, $output);
     $this->modifyConfiguration($input, $output);
     $this->addVirtualHost($input, $output);
     $this->symlinkProjects($input, $output);
     $this->installExtensions($input, $output);
     $this->enableWebInstaller($input, $output);
     // $this->createUser($input, $output);
     if ($this->version) {
         $output->writeln("Your new Joomla site has been created.");
         if (!$this->nousers) {
             $output->writeln("You can login using the following username and password combination: <info></info>/<info>admin</info>.");
         }
     }
 }
Esempio n. 2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $this->check($input, $output);
     $this->versions = new Versions();
     if ($input->getOption('repo')) {
         $this->versions->setRepository($input->getOption('repo'));
     }
     if ($input->getOption('refresh')) {
         $this->versions->refresh();
     }
     if ($input->getOption('clear-cache')) {
         $this->versions->clearcache($output);
     }
     $this->setVersion($input->getOption('release'));
     if ($this->version != 'none') {
         $tarball = $this->_getTarball($output);
         if (!$this->_isValidTarball($tarball)) {
             if (file_exists($tarball)) {
                 unlink($tarball);
             }
             throw new \RuntimeException(sprintf('Downloaded tarball "%s" could not be verified. A common cause is an interrupted download: check your internet connection and try again.', basename($tarball)));
         }
         if (!file_exists($this->target_dir)) {
             `mkdir -p {$this->target_dir}`;
         }
         `cd {$this->target_dir}; tar xzf {$tarball} --strip 1`;
         if ($this->versions->isBranch($this->version)) {
             unlink($tarball);
         }
         $isPlatform = Util::isPlatform($this->target_dir);
         $directory = $this->target_dir . ($isPlatform ? '/web' : '');
         if (file_exists($directory . '/htaccess.txt')) {
             `cp {$directory}/htaccess.txt {$directory}/.htaccess`;
         }
         if ($isPlatform) {
             `cd {$this->target_dir}; composer install -q`;
         }
     }
 }
Esempio n. 3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $this->check($input, $output);
     $this->versions = new Versions();
     if ($input->getOption('repo')) {
         $this->versions->setRepository($input->getOption('repo'));
     }
     if ($input->getOption('refresh')) {
         $this->versions->refresh();
     }
     if ($input->getOption('clear-cache')) {
         $this->versions->clearcache($output);
     }
     $this->setVersion($input->getOption('release'));
     if ($this->version != 'none') {
         $tarball = $this->_getTarball($output);
         if (!file_exists($tarball)) {
             throw new \RuntimeException(sprintf('File %s does not exist', $tarball));
         }
         if (!file_exists($this->target_dir)) {
             `mkdir -p {$this->target_dir}`;
         }
         `cd {$this->target_dir}; tar xzf {$tarball} --strip 1`;
         if ($this->versions->isBranch($this->version)) {
             unlink($tarball);
         }
         $isPlatform = Util::isPlatform($this->target_dir);
         $directory = $this->target_dir . ($isPlatform ? '/web' : '');
         if (file_exists($directory . '/htaccess.txt')) {
             `cp {$directory}/htaccess.txt {$directory}/.htaccess`;
         }
         if ($isPlatform) {
             `cd {$this->target_dir}; composer install -q`;
         }
     }
 }