protected initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) | ||
$input | Symfony\Component\Console\Input\InputInterface | |
$output | Symfony\Component\Console\Output\OutputInterface |
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; }
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); } }