Deployer\Initializer\Initializer::initialize PHP Method

initialize() public method

Initialize deployer in project
public initialize ( string $template, string $directory, string $file = 'deploy.php' ) : string
$template string
$directory string
$file string
return string The configuration file path
    public function initialize($template, $directory, $file = 'deploy.php')
    {
        if (!isset($this->templates[$template])) {
            throw TemplateNotFoundException::create($template, array_keys($this->templates));
        }
        $this->checkDirectoryBeforeInitialize($directory);
        $this->checkFileBeforeInitialize($directory, $file);
        $filePath = $directory . '/' . $file;
        $this->templates[$template]->initialize($filePath);
        return $filePath;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $template = $input->getArgument('template');
     $directory = $input->getOption('directory');
     $file = $input->getOption('filename');
     $filePath = $this->initializer->initialize($template, $directory, $file);
     $output->writeln(sprintf('<comment>Successfully create deployer configuration: <info>%s</info></comment>', $filePath));
 }
All Usage Examples Of Deployer\Initializer\Initializer::initialize