Author: Christophe Coevoet (stof@notk.org)
Author: Javier Eguiluz (javier.eguiluz@gmail.com)
Inheritance: extends Symfony\Component\Console\Command\Command
 protected function initialize(InputInterface $input, OutputInterface $output)
 {
     parent::initialize($input, $output);
     $directory = rtrim(trim($input->getArgument('directory')), DIRECTORY_SEPARATOR);
     $this->version = trim($input->getArgument('version'));
     $this->projectDir = $this->fs->isAbsolutePath($directory) ? $directory : getcwd() . DIRECTORY_SEPARATOR . $directory;
     $this->projectName = basename($directory);
 }
 /**
  * {@inheritdoc}
  */
 protected function initialize(InputInterface $input, OutputInterface $output)
 {
     parent::initialize($input, $output);
     $this->remoteInstallerFile = 'http://symfony.com/installer';
     $this->currentInstallerFile = realpath($_SERVER['argv'][0]) ?: $_SERVER['argv'][0];
     $this->tempDir = sys_get_temp_dir();
     $this->currentInstallerBackupFile = basename($this->currentInstallerFile, '.phar') . '-backup.phar';
     $this->newInstallerFile = $this->tempDir . '/' . basename($this->currentInstallerFile, '.phar') . '-temp.phar';
     $this->restorePreviousInstaller = false;
 }
Example #3
0
 protected function initialize(InputInterface $input, OutputInterface $output)
 {
     parent::initialize($input, $output);
     if (!$input->getArgument('directory')) {
         $this->projectDir = getcwd();
         $i = 1;
         $projectName = 'symfony_demo';
         while (file_exists($this->projectDir . DIRECTORY_SEPARATOR . $projectName)) {
             $projectName = 'symfony_demo_' . ++$i;
         }
         $this->projectName = $projectName;
         $this->projectDir = $this->projectDir . DIRECTORY_SEPARATOR . $projectName;
     } else {
         $directory = rtrim(trim($input->getArgument('directory')), DIRECTORY_SEPARATOR);
         $this->projectDir = $this->fs->isAbsolutePath($directory) ? $directory : getcwd() . DIRECTORY_SEPARATOR . $directory;
         $this->projectName = basename($directory);
     }
 }
Example #4
0
 /**
  * Updates the composer.json file to provide better values for some of the
  * default configuration values.
  *
  * @return $this
  */
 protected function updateComposerConfig()
 {
     parent::updateComposerConfig();
     $this->composerManager->updateProjectConfig(['name' => $this->composerManager->createPackageName($this->projectName), 'license' => 'proprietary', 'description' => null, 'extra' => ['branch-alias' => null]]);
     return $this;
 }
Example #5
0
 /**
  * Updates the composer.json file to provide better values for some of the
  * default configuration values.
  *
  * @return $this
  */
 protected function updateComposerJson()
 {
     parent::updateComposerJson();
     $composerConfig = $this->getProjectComposerConfig();
     $composerConfig['name'] = $this->generateComposerProjectName();
     $composerConfig['license'] = 'proprietary';
     if (isset($composerConfig['description'])) {
         unset($composerConfig['description']);
     }
     if (isset($composerConfig['extra']['branch-alias'])) {
         unset($composerConfig['extra']['branch-alias']);
     }
     $this->saveProjectComposerConfig($composerConfig);
     return $this;
 }