Zephir\Commands\CommandInterface::getParameter PHP Method

getParameter() public method

Returns parameter named parameterName if specified on the command line else null
public getParameter ( string $parameterName ) : string
$parameterName string
return string
    public function getParameter($parameterName);

Usage Example

コード例 #1
0
ファイル: Compiler.php プロジェクト: chet0xhenry/zephir
 /**
  * Initializes a Zephir extension
  *
  * @param CommandInterface $command
  *
  * @throws Exception
  */
 public function init(CommandInterface $command)
 {
     /**
      * If init namespace is specified
      */
     $namespace = $command->getParameter('namespace');
     if (!$namespace) {
         throw new Exception("Cannot obtain a valid initial namespace for the project");
     }
     /**
      * Tell the user the name could be reserved by another extension
      */
     if (extension_loaded($namespace)) {
         $this->logger->output('This extension can have conflicts with an existing loaded extension');
     }
     $this->config->set('namespace', $namespace);
     $this->config->set('name', $namespace);
     if (!is_dir($namespace)) {
         mkdir($namespace);
     }
     chdir($namespace);
     if (!is_dir($namespace)) {
         mkdir($namespace);
     }
     /**
      * Create 'kernel'
      */
     if (!is_dir('ext/kernel')) {
         mkdir('ext/kernel', 0755, true);
     }
     // Copy the latest kernel files
     $this->recursiveProcess($this->backend->getInternalKernelPath(), 'ext/kernel');
 }
All Usage Examples Of Zephir\Commands\CommandInterface::getParameter