public function upMigration()
 {
     echo PHP_EOL;
     Command::run(array('migrate:install'));
     echo PHP_EOL;
     Command::run(array('migrate'));
 }
示例#2
0
文件: Shell.php 项目: nejtr0n/expect
 public function exec(Command $cmd)
 {
     $match = NULL;
     // Get clear shell for work
     while (true) {
         switch (expect_expectl($this->__stream, array(array("(.*)[\$|#][ ]\$", SHELL, EXP_REGEXP)), $match)) {
             case SHELL:
                 $cmd->run($this);
                 return $this;
                 // Chain of commands
                 break 2;
             case EXP_EOF:
             case EXP_FULLBUFFER:
                 break 2;
             case EXP_TIMEOUT:
                 throw new \Exception("Connection time out");
                 break 2;
             default:
                 throw new \Exception("Error has occurred!");
                 break 2;
         }
     }
     return false;
 }
示例#3
0
 public static function createAdmin($username, $password)
 {
     echo "Publishing Bundle..." . PHP_EOL;
     Command::run(array('bundle:publish'));
     echo "Registering administrator..." . PHP_EOL;
     Command::run(array('admin::setup', $username, $password));
 }
示例#4
0
文件: app.php 项目: retailcrm/legacy
<?php

if (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get')) {
    date_default_timezone_set(@date_default_timezone_get());
}
require_once 'bootstrap.php';
$shortopts = 'dluce:m:p:r:h:';
$options = getopt($shortopts);
if (isset($options['e'])) {
    $command = new Command($options);
    $command->run();
} else {
    CommandHelper::runHelp();
}
示例#5
0
    {
        $this->startTime();
        for ($x = 0; $x < 100000; $x++) {
            new \Congow\Orient\Query\Command\Credential\Grant('OMN');
        }
        
        $this->stop();
        $this->output();
    }
    
    protected function startTime()
    {
        $this->time = microtime(true);
    }
    
    protected function stop()
    {
        $this->elapsed = microtime(true) - $this->time;
    }
    
    protected function output()
    {
        echo "Elapsed: \n{$this->elapsed}\n";
    }
}

$benchmark = new Command();

$benchmark->run();

示例#6
0
<?php

/*
 * Knee framework
 * Назначение: Работа с командной строкой
 */
namespace Knee\CLI;

try {
    Command::run($_SERVER['argv']);
} catch (\Exception $e) {
    echo $e->getMessage();
}
echo PHP_EOL;
示例#7
0
 /**
  * Main entry
  */
 public static function main()
 {
     $oCommand = new Command();
     return $oCommand->run($_SERVER['argv']);
 }