示例#1
0
文件: cli.php 项目: visor/nano
<?php

require_once __DIR__ . '/library/Application.php';
$loader = new \Nano\Loader();
$args = $_SERVER['argv'];
array_shift($args);
$result = \Nano\Cli::main($args);
if (0 !== $result) {
    exit($result);
}
示例#2
0
 /**
  * @return \Nano\Cli\Script
  * @param $name
  */
 protected function getScript($name)
 {
     $result = $this->cli->getScript($name);
     return $result->newInstance($name, $this->cli);
 }
示例#3
0
文件: CommonTest.php 项目: visor/nano
 public function testRunWrapper()
 {
     Nano::setApplication(null);
     self::assertEquals(0, \Nano\Cli::main(array()));
 }
示例#4
0
文件: Script.php 项目: visor/nano
 /**
  * @return \ReflectionClass
  */
 protected function getReflector()
 {
     return $this->cli->getScript($this->name);
 }
示例#5
0
 /**
  * @return string
  */
 protected function getWindowsScriptSource()
 {
     return '@echo off' . PHP_EOL . \Nano\Cli::getPhpBinary() . ' ' . \Nano\Cli::getCliScriptPath() . ' %*';
 }