当前位置: 首页>>代码示例>>PHP>>正文


PHP Executor类代码示例

本文整理汇总了PHP中Executor的典型用法代码示例。如果您正苦于以下问题:PHP Executor类的具体用法?PHP Executor怎么用?PHP Executor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Executor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testFlush

 public function testFlush()
 {
     $streams = $this->provideStreams();
     $executor = new Executor();
     $this->assertSame(0, $executor->flush('echo foo', $streams));
     rewind($streams[0]);
     $this->assertSame('', fread($streams[0], 1024));
     rewind($streams[1]);
     $this->assertSame("foo\r\n", fread($streams[1], 1024));
     rewind($streams[2]);
     $this->assertSame('', fread($streams[2], 1024));
 }
开发者ID:raphhh,项目名称:trex-cli,代码行数:12,代码来源:ExecutorTest.php

示例2: run

 /**
  * Call this function to execute jobs which are due to occur now.
  */
 public function run()
 {
     $jobs = $this->jobFinder->find();
     if (is_null($jobs)) {
         return;
     }
     foreach ($jobs as $job) {
         // TODO Should jobs be locked prior to running them?
         $start = date('Y-m-d H:i:s', time());
         $executor = new Executor($job);
         $response = $executor->run();
         $finish = date('Y-m-d H:i:s', time());
         $this->addJobToHistory($job, $response, $start, $finish);
         $this->sendNotifications($job, $response, $start, $finish);
     }
 }
开发者ID:ryanhend,项目名称:Internal,代码行数:19,代码来源:ExecutionManager.php

示例3: getAllByPopular

 public static function getAllByPopular()
 {
     //		$sql = "select * from ".self::$tablename;
     $sql = "select *,count(*) as total from " . self::$tablename . " group by channel_id limit 10";
     $query = Executor::doit($sql);
     return Model::many($query[0], new FollowerData());
 }
开发者ID:evilnapsis,项目名称:imayik,代码行数:7,代码来源:FollowerData.php

示例4: __construct

 public function __construct()
 {
     $arr = Executor::execute("df -PB 1");
     foreach ($arr as $line) {
         $columns = preg_split("/ /", $line, -1, PREG_SPLIT_NO_EMPTY);
         $this->df[$columns[0]] = array("capacity" => $columns[1], "used" => $columns[2], "available" => $columns[3], "percent" => $columns[4], "path" => $columns[5]);
     }
 }
开发者ID:serverfarmer,项目名称:sf-farm-inspector,代码行数:8,代码来源:space.php

示例5: one_object

 public static function one_object($sql)
 {
     $query = Executor::doit($sql);
     $cnt = 0;
     $found = null;
     $data = null;
     while ($r = $query[0]->fetch_object()) {
         $data = $r;
         $found = $data;
         break;
     }
     return $found;
 }
开发者ID:CloudGt,项目名称:suggbox-php,代码行数:13,代码来源:Model.php

示例6: getByName

 public static function getByName($name)
 {
     $sql = "select * from " . self::$tablename . " where name=\"{$name}\"";
     $query = Executor::doit($sql);
     $found = null;
     $data = new StatusData();
     while ($r = $query->fetch_array()) {
         $data->id = $r['id'];
         $data->name = $r['name'];
         $found = $data;
         break;
     }
     return $found;
 }
开发者ID:evilnapsis,项目名称:imayik,代码行数:14,代码来源:StatusData.php

示例7: PHP_debug_backtrace

function PHP_debug_backtrace(Executor $executor, array $args, Zval $return)
{
    $array = array();
    $current = $executor->getCurrent();
    while ($current->parent) {
        $parent = $current->parent;
        $ret = array('line' => $parent->opLine->attributes['startLine'], 'file' => $parent->opArray->getFileName());
        if ($current->function) {
            if ($current->ci) {
                $ret['class'] = $current->ci->getClassEntry()->getName();
                $ret['object'] = $current->ci;
                $ret['type'] = '->';
                $ret['function'] = $current->ci->getClassEntry()->getMethodStore()->getName($current->function);
            } else {
                $ret['function'] = $current->executor->getFunctionStore()->getName($current->function);
            }
            $ret['args'] = $current->arguments;
        }
        $array[] = $ret;
        $current = $parent;
    }
    $return->setValue($array);
}
开发者ID:asgrim,项目名称:PHPPHP,代码行数:23,代码来源:Functions.php

示例8: getAll

 public static function getAll()
 {
     $sql = "select * from " . self::$tablename;
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query->fetch_array()) {
         $array[$cnt] = new UserTypeData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->name = $r['name'];
         $cnt++;
     }
     return $array;
 }
开发者ID:evilnapsis,项目名称:imayik,代码行数:14,代码来源:UserTypeData.php

示例9: getAll

 public static function getAll()
 {
     $sql = "select * from " . self::$tablename . " order by created_at desc";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new OperationTypeData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->name = $r['name'];
         $cnt++;
     }
     return $array;
 }
开发者ID:kpocha,项目名称:inventio-lite,代码行数:14,代码来源:OperationTypeData.php

示例10: getLike

 public static function getLike($q)
 {
     $sql = "select * from " . self::$tablename . " where name like '%{$q}%'";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new BoxData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
开发者ID:leanet,项目名称:inventio-lite,代码行数:14,代码来源:BoxData.php

示例11: Event_handler

function Event_handler($handler)
{
    if (is_object($handler)) {
        return array('type' => 'object', 'object' => $handler, 'event_handler' => true);
    } elseif (is_string($handler) && class_exists($handler)) {
        return array('type' => 'class', 'class' => $handler, 'event_handler' => true);
    } else {
        if (is_array($handler)) {
            return array('type' => 'bootable', 'boot' => \Collection::create($handler), 'event_handler' => true);
        } else {
            return array('type' => 'bootable', 'boot' => \Executor::create($handler), 'event_handler' => true);
        }
    }
}
开发者ID:silversthem,项目名称:simPHPle,代码行数:14,代码来源:controller.php

示例12: getAll

 public static function getAll()
 {
     $sql = "select * from " . self::$tablename . " order by created_at desc";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query->fetch_array()) {
         $array[$cnt] = new AlbumImageData();
         $array[$cnt]->album_id = $r['album_id'];
         $array[$cnt]->image_id = $r['image_id'];
         $array[$cnt]->created_at = $r['created_at'];
         $cnt++;
     }
     return $array;
 }
开发者ID:evilnapsis,项目名称:imayik,代码行数:15,代码来源:AlbumImageData.php

示例13: __call

 /**
  * Catch all calls, fire events and remap to real instance
  *
  * @access public
  * @param string $method
  * @param array $args
  * @return mixed
  */
 public function __call($method, array $args = array())
 {
     $event = $this->observer->createEvent()->setMethod($method)->setParams($args)->setInstance($this)->setType('before');
     $before = $this->observer->trigger()->getResult();
     if ($event->isPropagationStopped()) {
         return $before;
     }
     /** @var \Closure $closure */
     if ($closure = $this->observer->bound($method)) {
         $callback = $closure->bindTo($this, $this);
         $result = Executor::callClosure($callback, $event->getParams());
     } else {
         $result = Executor::call($this(true), $method, $event->getParams());
     }
     $event->setType('after')->setResult($result);
     return $this->observer->trigger()->getResult();
 }
开发者ID:ed-fruty,项目名称:strange-observer,代码行数:25,代码来源:Invoker.php

示例14: getAll

 public static function getAll()
 {
     $sql = "select * from " . self::$tablename . "";
     $query = Executor::doit($sql);
     $array = array();
     $cnt = 0;
     while ($r = $query[0]->fetch_array()) {
         $array[$cnt] = new ThemeData();
         $array[$cnt]->id = $r['id'];
         $array[$cnt]->name = $r['name'];
         $array[$cnt]->header_background_color = $r['header_background_color'];
         $array[$cnt]->header_text_color = $r['header_text_color'];
         $array[$cnt]->body_background_color = $r['body_background_color'];
         $array[$cnt]->body_text_color = $r['body_text_color'];
         $cnt++;
     }
     return $array;
 }
开发者ID:evilnapsis,项目名称:cazueliyas,代码行数:18,代码来源:ThemeData.php

示例15: getInputByProductIdCutIdYesF

 public static function getInputByProductIdCutIdYesF($product_id, $cut_id)
 {
     $sql = "select * from " . self::$tablename . " where product_id={$product_id} and cut_id={$cut_id} and operation_type_id=1 order by created_at desc";
     $query = Executor::doit($sql);
     return Model::many($query[0], new OperationData());
 }
开发者ID:kpocha,项目名称:inventio-lite,代码行数:6,代码来源:OperationData.php


注:本文中的Executor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。