isWindows() 공개 정적인 메소드

Check if the host OS is windows
public static isWindows ( ) : boolean
리턴 boolean
예제 #1
0
 /**
  * Compiles and installs the extension
  *
  * @param CommandInterface $command
  * @param boolean $development
  *
  * @throws Exception
  */
 public function install(CommandInterface $command, $development = false)
 {
     /**
      * Get global namespace
      */
     $namespace = str_replace('\\', '_', $this->checkDirectory());
     @unlink("compile.log");
     @unlink("compile-errors.log");
     @unlink("ext/modules/" . $namespace . ".so");
     $this->compile($command, $development);
     if (Utils::isWindows()) {
         $this->logger->output("Installation is not implemented for windows yet! Aborting!");
         exit;
     }
     $this->logger->output('Installing...');
     $gccFlags = $this->getGccFlags($development);
     $currentDir = getcwd();
     exec('(cd ext && export CC="gcc" && export CFLAGS="' . $gccFlags . '" && sudo make install 2>>' . $currentDir . '/compile-errors.log 1>>' . $currentDir . '/compile.log)', $output, $exit);
     if (!file_exists("ext/modules/" . $namespace . ".so")) {
         throw new CompilerException("Internal extension compilation failed. Check compile-errors.log for more information");
     }
     $this->logger->output('Extension installed!');
     if (!extension_loaded($namespace)) {
         $this->logger->output('Add extension=' . $namespace . '.so to your php.ini');
     }
     $this->logger->output('Don\'t forget to restart your web server');
 }
예제 #2
0
파일: Compiler.php 프로젝트: hylent/zephir
 /**
  * Run tests
  *
  * @param CommandInterface $command
  */
 public function test(CommandInterface $command)
 {
     /**
      * Get global namespace
      */
     $namespace = $this->checkDirectory();
     $this->logger->output('Running tests...');
     if (!Utils::isWindows()) {
         system('export CC="gcc" && export CFLAGS="-O0 -g" && export NO_INTERACTION=1 && cd ext && make test', $exit);
     }
 }