PhpBrew\Command\ExtensionCommand\BaseCommand::prepare PHP Метод

prepare() публичный Метод

public prepare ( )
    public function prepare()
    {
        parent::prepare();
        if (!getenv('PHPBREW_PHP')) {
            $this->logger->error('Error: PHPBREW_PHP environment variable is not defined.');
            $this->logger->error('  This extension command requires you specify a PHP version from your build list.');
            $this->logger->error("  And it looks like you haven't switched to a version from the builds that were built with PHPBrew.");
            $this->logger->error('Suggestion: Please install at least one PHP with your prefered version and switch to it.');
            return false;
        }
        return true;
    }

Usage Example

Пример #1
0
 public function prepare()
 {
     parent::prepare();
     $buildDir = Config::getCurrentBuildDir();
     $extDir = $buildDir . DIRECTORY_SEPARATOR . 'ext';
     if (!is_dir($extDir)) {
         $this->logger->error("Error: The ext directory '{$extDir}' does not exist.");
         $this->logger->error("It looks like you don't have the PHP source in {$buildDir} or you didn't extract the tarball.");
         $this->logger->error("Suggestion: Please install at least one PHP with your prefered version and switch to it.");
         return false;
     }
     return true;
 }
BaseCommand