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


PHP isAke函数代码示例

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


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

示例1: get

 public static function get($class, $key = null)
 {
     $key = is_null($key) ? sha1($class) : $key;
     $classInstances = isAke(static::$instances, $class);
     $keyInstance = isAke($classInstances, $key, null);
     return $keyInstance;
 }
开发者ID:noikiy,项目名称:inovi,代码行数:7,代码来源:Instance.php

示例2: __call

 public function __call($method, $args)
 {
     if (true === $this->__has($method)) {
         return $this->__fire($method, $args);
     }
     $reverse = strrev($method);
     $last = $reverse[0];
     if ('s' == $last) {
         if (!count($args)) {
             return isAke($this->values, $method);
         } else {
             $this->values[$method] = !Arrays::is($this->values[$method]) ? array() : $this->values[$method];
             foreach ($args as $arg) {
                 array_push($this->values[$method], $arg);
             }
         }
         return $this;
     } else {
         $method .= 's';
         if (!count($args)) {
             $val = isAke($this->values, $method);
             return count($val) ? Arrays::first($val) : null;
         } else {
             $this->values[$method] = !Arrays::is($this->values[$method]) ? array() : $this->values[$method];
             foreach ($args as $arg) {
                 array_push($this->values[$method], $arg);
             }
         }
         return $this;
     }
 }
开发者ID:schpill,项目名称:thin,代码行数:31,代码来源:Conf.php

示例3: displayCodeLines

function displayCodeLines()
{
    $back = '';
    // $traces = Thin\Input::globals('dbg_stack', []);
    $traces = debug_backtrace();
    array_pop($traces);
    if (!empty($traces)) {
        foreach ($traces as $trace) {
            $file = isAke($trace, 'file', false);
            $line = isAke($trace, 'line', false);
            if (false !== $file && false !== $line && $file != __FILE__) {
                $start = $line > 5 ? $line - 5 : $line;
                $code = Thin\File::readLines($file, $start, $line + 5);
                $lines = explode("\n", $code);
                $codeLines = [];
                $i = $start;
                foreach ($lines as $codeLine) {
                    if ($i == $line) {
                        array_push($codeLines, $i . '. <span style="background-color: gold; color: black;">' . $codeLine . '</span>');
                    } else {
                        array_push($codeLines, $i . '. ' . $codeLine);
                    }
                    $i++;
                }
                if (strlen($back)) {
                    $back .= "\n";
                }
                $back .= "File: {$file} [<em>line: <u>{$line}</u></em>]\n\nCode\n*******************************\n<div style=\"font-weight: normal; font-family: Consolas;\">" . implode("\n", $codeLines) . "</div>\n*******************************\n";
            }
        }
    }
    return $back;
}
开发者ID:noikiy,项目名称:thin,代码行数:33,代码来源:Loader.php

示例4: run

 public function run()
 {
     foreach ($this->logics as $k) {
         $step = isAke($this->steps, $k, null);
         if ($step) {
             $action = isAke($step, 'action', null);
             if ($action) {
                 $a = array_merge(isAke($step, 'action', []), [$this->instance]);
                 $check = call_user_func_array($action, $a);
                 if ($check) {
                     $this->successes[] = $k;
                     $success = isAke($step, 'success', null);
                     if ($success) {
                         call_user_func_array($success, [$this->instance]);
                     }
                 } else {
                     $this->errors[] = $k;
                     $error = isAke($step, 'error', null);
                     if ($error) {
                         call_user_func_array($error, [$this->instance]);
                     }
                 }
             } else {
                 $this->errors[] = $k;
                 $error = isAke($step, 'error', null);
                 if ($error) {
                     call_user_func_array($error, [$this->instance]);
                 }
             }
         }
     }
     return ['successes' => $this->successes, 'errors' => $this->errors];
 }
开发者ID:schpill,项目名称:standalone,代码行数:33,代码来源:logic.php

示例5: connect

 /**
  * Connect to MongoDB, select database
  *
  * @return bool
  */
 public function connect()
 {
     if ($this->_connection) {
         return;
     }
     /**
      * Add required variables
      * Clear the connection parameters for security
      */
     $options = $this->_config->assoc();
     unset($this->_config);
     $hostname = isAke($options, 'hostname', 'localhost');
     $port = isAke($options, 'port', '27017');
     $conn = 'mongodb://' . $hostname . ':' . $port;
     unset($options['hostname']);
     unset($options['port']);
     $this->_connection = new \Mongo($conn, $options);
     /* Try connect */
     try {
         $this->_connection->connect();
     } catch (\MongoConnectionException $e) {
         throw new \Exception('Unable to connect to MongoDB server at ' . $hostname);
     }
     $this->_db = new \MongoDB($this->_connection, $options['db']);
     return $this->_connected = TRUE;
 }
开发者ID:noikiy,项目名称:inovi,代码行数:31,代码来源:Mongo.php

示例6: __callStatic

 public static function __callStatic($method, $args)
 {
     if (!isset(self::$resources[$method])) {
         throw new Exception("[{$name}] is not a known resource.");
     }
     return isAke(self::$resources, $method);
 }
开发者ID:schpill,项目名称:thin,代码行数:7,代码来源:Serviceprovider.php

示例7: table

 public function table($table)
 {
     $instance = isAke($this->tables, $table);
     if (null === $onstance) {
         $instance = new Store($table);
     }
 }
开发者ID:schpill,项目名称:thin,代码行数:7,代码来源:Server.php

示例8: format

 private function format($text = '', $parameters = array())
 {
     if (!Arrays::is($parameters) && 'NONE' == $parameters) {
         return $text;
     }
     if (!Arrays::is($parameters) && isset($this->styles[$parameters])) {
         $parameters = $this->styles[$parameters];
     }
     $codes = array();
     $fg = isAke($parameters, 'fg', null);
     $bg = isAke($parameters, 'bg', null);
     if (!empty($fg)) {
         $codes[] = $this->foreground[$fg];
     }
     if (!empty($bg)) {
         $codes[] = $this->background[$bg];
     }
     foreach ($this->options as $option => $value) {
         $paramOpt = isAke($parameters, $option, null);
         if (!empty($paramOpt)) {
             $codes[] = $value;
         }
     }
     return "[" . implode(';', $codes) . 'm' . $text . "[0m";
 }
开发者ID:schpill,项目名称:thin,代码行数:25,代码来源:Cli.php

示例9: listen

 public function listen()
 {
     set_time_limit(false);
     $dbTask = Model::Latertask();
     $dbInstance = Model::Laterinstance();
     $tasks = $dbTask->where(['when', '<', time()])->cursor();
     if ($tasks->count() > 0) {
         foreach ($tasks as $task) {
             $check = $dbInstance->where(['task_id', '=', (int) $task['id']])->cursor()->count();
             $callback_id = isAke($task, 'callback_id', null);
             if ($check == 0) {
                 $instance = $dbInstance->create(['task_id' => (int) $task['id'], 'start' => time()])->save();
                 $res = lib('closure')->fireStore((int) $task['closure_id'], (array) $task['args']);
                 if ($callback_id) {
                     $cb = $dbTask->find((int) $callback_id);
                     $t = $cb->toArray();
                     $args = array_merge([$res], $t['args']);
                     $res = lib('closure')->fireStore((int) $t['closure_id'], (array) $args);
                     $cb->delete();
                 }
                 $dt = $dbTask->find((int) $task['id']);
                 if ($dt) {
                     $dt->delete();
                 }
                 $instance->delete();
                 Model::Laterhistory()->create(['task' => (array) $task, 'execution_time' => time()])->save();
             }
         }
     }
     return true;
 }
开发者ID:schpill,项目名称:standalone,代码行数:31,代码来源:later.php

示例10: instance

 public static function instance($ns = 'core')
 {
     $i = isAke(self::$instances, $ns, false);
     if (!$i) {
         self::$instances[$ns] = $i = lib('now', [$ns]);
     }
     return $i;
 }
开发者ID:schpill,项目名称:standalone,代码行数:8,代码来源:nowstatic.php

示例11: create

 public function create($args)
 {
     $points = isAke($args, 'points', false);
     if (false === $points) {
         $args['points'] = 0;
     }
     return Model::Account()->create($args)->save();
 }
开发者ID:schpill,项目名称:standalone,代码行数:8,代码来源:account.php

示例12: getValue

 public function getValue($username, $field, $default = null)
 {
     $row = coll(Now::get('acl.users.' . $this->ns, []))->firstBy('username', $username);
     if ($row) {
         return isAke($row, $field, $default);
     }
     return $default;
 }
开发者ID:schpill,项目名称:standalone,代码行数:8,代码来源:aclight.php

示例13: fire

 public function fire($event, $parameters = [])
 {
     $events = Now::get('core.events', []);
     $closure = isAke($events, $event, null);
     if ($closure) {
         return call_user_func_array($closure, $parameters);
     }
     return null;
 }
开发者ID:schpill,项目名称:standalone,代码行数:9,代码来源:event.php

示例14: fire

 public function fire($hook, $parameters = [])
 {
     $hooks = Now::get('core.hooks', []);
     $closure = isAke($hooks, $hook, null);
     if ($closure) {
         return call_user_func_array($closure, $parameters);
     }
     return null;
 }
开发者ID:schpill,项目名称:standalone,代码行数:9,代码来源:hook.php

示例15: forget

 public static function forget($class, $key = null)
 {
     $key = is_null($key) ? sha1($class) : $key;
     $classInstances = isAke(static::$instances, $class);
     $keyInstance = isAke($classInstances, $key, null);
     if (!is_null($keyInstance)) {
         unset(static::$instances[$class][$key]);
     }
 }
开发者ID:schpill,项目名称:thin,代码行数:9,代码来源:Instance.php


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