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


PHP Error::info方法代码示例

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


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

示例1: smarty_block_app

function smarty_block_app($params, $body, &$smarty)
{
    if (empty($body)) {
        return;
    }
    if (!array_key_exists('name', $params)) {
        Error::info('Tag param error:', 'app标签必须有参数name!');
        return;
    }
    if (array_key_exists('func', $params)) {
        $func = $params['func'];
        unset($params['func']);
    } else {
        $func = 'getList';
    }
    $fields = implode(',', SwooleTemplate::get_fields($body));
    global $php;
    $php->createModel($model);
    if (array_key_exists('titlelen', $params)) {
        $titlelen = $params['titlelen'];
        unset($params['titlelen']);
        $php->model->{$model}->select = str_replace('title', "substring( title, 1, {$titlelen} ) AS title", $fields);
    } else {
        $php->model->{$model}->select = $fields;
    }
    $data = call_user_func(array($php->model->{$model}, $func), $params);
    return SwooleTemplate::parse_loop($data, $body, $fields);
}
开发者ID:superwmh,项目名称:swoole,代码行数:28,代码来源:block.content.php

示例2: __construct

 /**
  * 错误对象
  * @param $error 如果为INT,则读取错误信息字典,否则设置错误字符串
  * @param $stop 是否终止程序运行(exit)
  * @return unknown_type
  */
 function __construct($error)
 {
     if (is_numeric($error)) {
         if (empty($this->error_id)) {
             include LIBPATH . '/data/text/error_code.php';
             //错误ID
             $this->error_id = (int) $error;
             //错误信息
             if (!isset(self::$error_code[$this->error_id])) {
                 $this->error_msg = self::$error_code[$this->error_id];
                 parent::__construct($this->error_msg, $error);
             }
         }
     } else {
         $this->error_id = 0;
         $this->error_msg = $error;
         parent::__construct($error);
     }
     global $php;
     //如果定义了错误监听程序
     if (isset($php->error_call[$this->error_id])) {
         call_user_func($php->error_call[$this->error_id], $error);
     }
     if (self::$stop) {
         exit(Error::info('Swoole Error', $this->error_msg));
     }
 }
开发者ID:zzzzzmh,项目名称:KeywordFilteringService,代码行数:33,代码来源:Error.php

示例3: create

 /**
  * 获取缓存对象
  * @param $scheme
  * @return cache object
  */
 static function create($config)
 {
     if (empty(self::$backends[$config['type']])) {
         return Error::info('Cache Error', "cache backend: {$config['type']} no support");
     }
     $backend = "\\Swoole\\Cache\\" . self::$backends[$config['type']];
     return new $backend($config);
 }
开发者ID:wangxujun163163,项目名称:framework,代码行数:13,代码来源:Cache.php

示例4: __construct

 function __construct($params, $backend = 'FileLog')
 {
     if (!in_array($backend, $this->backends)) {
         Error::info('Log backend Error', "Log backend <b>{$backend}</b> not no support!");
     }
     import('#log.' . $backend);
     $this->backend = new $backend($params);
 }
开发者ID:superwmh,项目名称:swoole,代码行数:8,代码来源:Log.php

示例5: query

 /**
  * 执行一个SQL语句
  * @param $sql 执行的SQL语句
  */
 function query($sql)
 {
     parent::real_escape_string($sql);
     $res = parent::query($sql);
     if (!$res) {
         echo Error::info("SQL Error", $this->error . "<hr />{$sql}");
     }
     return new MySQLiRecord($res);
 }
开发者ID:superwmh,项目名称:swoole,代码行数:13,代码来源:MySQL2.class.php

示例6: get_cache

 /**
  * 获取缓存对象
  * @param $scheme
  * @return cache object
  */
 static function get_cache($config)
 {
     if (empty(self::$backends[$config['protocol']])) {
         return Error::info('Cache Error', "cache backend:{$config['protocol']} no support");
     }
     $backend = self::$backends[$config['protocol']];
     import('#cache.' . $backend);
     return new $backend($config);
 }
开发者ID:superwmh,项目名称:swoole,代码行数:14,代码来源:Cache.php

示例7: query

 /**
  * 执行一个SQL语句
  * @param $sql 执行的SQL语句
  */
 function query($sql)
 {
     mysql_real_escape_string($sql, $this->conn);
     $res = mysql_query($sql, $this->conn);
     if (!$res) {
         echo Error::info("SQL Error", mysql_error($this->conn) . "<hr />{$sql}");
     }
     return new MySQLRecord($res);
 }
开发者ID:superwmh,项目名称:swoole,代码行数:13,代码来源:MySQL.class.php

示例8: query

 /**
  * 执行一个SQL语句
  * @param $sql 执行的SQL语句
  */
 public final function query($sql)
 {
     if ($this->debug) {
         echo "{$sql}<br />\n<hr />";
     }
     parent::quote($sql);
     $res = parent::query($sql) or Error::info("SQL Error", implode(", ", $this->errorInfo()) . "<hr />{$sql}");
     return $res;
 }
开发者ID:superwmh,项目名称:swoole,代码行数:13,代码来源:PdoDB.class.php

示例9: set

 /**
  * 写入字典内容
  * @param $dictname
  */
 static function set($dictname, $dict)
 {
     if (!self::$swoole->cache) {
         Error::info('SiteDict Cache Error', 'Please load Cache!');
     }
     $filename = self::$data_dir . '/' . $dictname . '.php';
     self::write($dictname, $dict, $filename);
     self::delete($dictname);
 }
开发者ID:superwmh,项目名称:swoole,代码行数:13,代码来源:SiteDict.php

示例10: load

 /**
  * 导入插件
  * @param $plugin_name
  * @return unknown_type
  */
 function load($plugin_name, $plugin_param = null)
 {
     $path = WEBPATH . '/swoole_plugin/' . $plugin_name . '/Swoole.plugin.php';
     if (file_exists($path)) {
         require_once $path;
         $this->plugins[$plugin_name] = $swoole_plugin;
     } else {
         Error::info('Plugin not Found!', "Plugin file <b>{$path}</b> not exists!");
     }
 }
开发者ID:superwmh,项目名称:swoole,代码行数:15,代码来源:PluginLoader.php

示例11: display

 /**
  * render template file, then display it.
  * @param string $tpl_file
  */
 function display($tpl_file = '')
 {
     if (empty($tpl_file)) {
         $tpl_file = $this->swoole->env['mvc']['controller'] . '/' . $this->swoole->env['mvc']['view'] . '.php';
     }
     if (!is_file($this->template_dir . $tpl_file)) {
         Error::info('template error', "template file[" . $this->template_dir . $tpl_file . "] not found");
     }
     extract($this->tpl_var);
     include $this->template_dir . $tpl_file;
 }
开发者ID:zzzzzmh,项目名称:KeywordFilteringService,代码行数:15,代码来源:Controller.php

示例12: getContent

 function getContent(&$attrs)
 {
     $select = new SelectDB($this->db);
     $select->call_by = 'smarty';
     if (isset($attrs['typeid'])) {
         $attrs['catid'] = $attrs['typeid'];
         unset($attrs['typeid']);
         if (is_numeric($attrs['typeid'])) {
             $cate = $this->swoole->createModel('Category');
             $category = $cate->get($attrs['fid']);
             $select->from(TABLE_PREFIX . '_' . $category['modelname']);
         } elseif (isset($attrs['app'])) {
             $app = $this->swoole->createModel('App');
             $app_config = $app->getConfig($attrs['app']);
             $select->from($app_config['tablename']);
             unset($attrs['app']);
         } else {
             Error::info('Tpl Error', 'Nested structure must have `app` param!');
         }
     } elseif (isset($attrs['app'])) {
         $app = $this->swoole->createModel('App');
         $app_config = $app->getConfig($attrs['app']);
         $select->from($app_config['tablename']);
         unset($attrs['app']);
     } else {
         Error::info('Param Error', 'Get content must have param `typeid` or `app` !');
     }
     if (array_key_exists('select', $attrs)) {
         $select->select = $attrs['select'];
     }
     if (array_key_exists('titlelen', $attrs)) {
         $titlelen = $attrs['titlelen'];
         unset($attrs['titlelen']);
         $select->select = str_replace('title', "substring( title, 1, {$titlelen} ) AS title,title as title_full", $attrs['select']);
     }
     $select->limit(isset($attrs['row']) ? $attrs['row'] : 10);
     unset($attrs['row']);
     $select->order(isset($attrs['order']) ? $attrs['order'] : 'id desc');
     unset($attrs['order']);
     unset($attrs['get'], $attrs['name'], $attrs['key'], $attrs['func']);
     $select->put($attrs);
     if (array_key_exists('page', $attrs)) {
         $select->paging();
         $php->env['start'] = 10 * intval($attrs['page'] / 10);
         if ($select->pages > 10 and $attrs['page'] < $start) {
             $php->env['more'] = 1;
         }
         $php->env['end'] = $select->pages - $php->env['start'];
         $php->env['end'] = $select->pages;
         $php->env['end'] = $select->page_size;
         $php->env['end'] = $select->num;
     }
     return $select->getsql();
 }
开发者ID:superwmh,项目名称:swoole,代码行数:54,代码来源:CMS.model.php

示例13: run

 function run()
 {
     if (!empty($_GET['action'])) {
         $this->action = $_GET['action'];
     }
     $this->action = Validate::word($this->action);
     $method = self::$method_prefix . '_' . $this->action;
     if (method_exists($this, $method)) {
         call_user_func(array($this, $method));
     } else {
         Error::info('GeneralView Error!', "View <b>{$this->app_name}->{$method}</b> Not Found!");
     }
 }
开发者ID:jasonshaw,项目名称:framework-1,代码行数:13,代码来源:GeneralView.php

示例14: connect

 public static function connect()
 {
     // One connection for the app
     if (self::$cont === null) {
         try {
             self::$cont = new PDO("mysql:host=" . HOST . ";" . "dbname=" . DATABASE, USER, PASSWORD);
         } catch (PDOException $e) {
             echo "Error with PDO " . Error::info();
             echo $e->message();
             die;
         }
     }
     return self::$cont;
 }
开发者ID:DrNio13,项目名称:love-science,代码行数:14,代码来源:database_class.php

示例15: loadModel

 /**
  * 加载一个模型对象
  * @param $model_name 模型名称
  * @return $model_object 模型对象
  */
 static function loadModel($model_name)
 {
     if (isset(self::$_objects['model'][$model_name])) {
         return self::$_objects['model'][$model_name];
     } else {
         $model_file = APPSPATH . '/models/' . $model_name . '.model.php';
         if (!file_exists($model_file)) {
             Error::info('MVC错误', "不存在的模型, <b>{$model_name}</b>");
         }
         require $model_file;
         self::$_objects['model'][$model_name] = new $model_name(self::$swoole);
         return self::$_objects['model'][$model_name];
     }
 }
开发者ID:jinguanio,项目名称:swoole_websocket,代码行数:19,代码来源:Loader.php


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