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


PHP Debug::add方法代码示例

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


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

示例1: in

 static function in($cat, $file, $debug = false)
 {
     // Looking for a potential error.
     Debug::clear();
     if (!$file) {
         throw new \Exception("Looking for Empty File? (category = {$cat})");
     }
     if (!isset(self::$path[$cat])) {
         throw new \Exception("Category {$cat} not found");
     }
     $path_list = self::$path[$cat];
     foreach ($path_list as $path) {
         $db = "Looking for: " . $path . $file;
         Debug::add($path . DS . $file);
         if ($debug) {
             echo "Looking for: " . $path . $file . "<br/>";
         }
         if (file_exists($path . DS . $file)) {
             if ($debug) {
                 echo "FOUND: " . $path . DS . $file . "<br/>";
             }
             return $path . DS . $file;
         }
     }
     return false;
 }
开发者ID:mickrip,项目名称:fwoot-core,代码行数:26,代码来源:Find.php

示例2: connect

 /**
  * 链接memcache,保存实例化的memcache
  */
 private function connect()
 {
     if ($this->mem) {
         return $this;
     } else {
         return $this->mem = memcache_connect($this->config['memcached_host'], $this->config['memcached_port']) or Debug::add('memcached连接失败');
     }
 }
开发者ID:pgfeng,项目名称:ssy.9icode.club,代码行数:11,代码来源:memcacheDriver.class.php

示例3: connect

 function connect()
 {
     $mysqli = mysqli_connect(Config::database('host') . ':' . Config::database('port'), Config::database('user'), Config::database('pass'), Config::database('name'));
     if ($mysqli->connect_error) {
         Debug::add('连接数据库失败:<font color=red>' . $mysqli->connect_error . '</font>');
         exit('连接数据库失败:<font color=red>' . $mysqli->connect_error . '</font>');
     } else {
         $this->mysqli = $mysqli;
         $this->exec('set names ' . Config::database('charset'));
         return true;
     }
 }
开发者ID:pgfeng,项目名称:GFPHP,代码行数:12,代码来源:MysqliDriver.class.php

示例4: flush

 public static function flush($space = false)
 {
     if ($space == false) {
         $space = self::$cache->config['default_space'];
     }
     $res = self::$cache->flush($space);
     if ($res) {
         Debug::add('缓存空间' . $space . '删除成功!', 0);
     } else {
         Debug::add('缓存空间' . $space . '删除失败!', 0);
     }
     return $res;
 }
开发者ID:pgfeng,项目名称:GFPHP,代码行数:13,代码来源:Cache.class.php

示例5: connect

 function connect()
 {
     $con = @mysql_connect(Config::database('host') . ':' . Config::database('port'), Config::database('user'), Config::database('pass'));
     if ($con) {
         $r = mysql_select_db(Config::database('name'), $con) or Debug::add('连接数据库失败:<font color=red>' . mysql_error() . '</font>');
         if ($r === true) {
             $this->con = $con;
             $this->exec('set names ' . Config::database('charset'));
             return true;
         }
     } else {
         Debug::add('连接Mysql服务器失败:,' . mysql_error());
     }
     return false;
 }
开发者ID:pgfeng,项目名称:GFPHP,代码行数:15,代码来源:mysql.class.php

示例6: connect

 public function connect()
 {
     try {
         $this->db = new pdo(config::database('DSN'), Config::database('user'), Config::database('pass'));
         $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     } catch (PDOException $e) {
         Debug::add('<font color="red">' . $e->getMessage() . '</font>');
     }
     if (!$this->db) {
         return false;
     } else {
         $this->exec('set names ' . Config::database('charset'));
         return true;
     }
 }
开发者ID:pgfeng,项目名称:GFPHP,代码行数:15,代码来源:PdoDriver.class.php

示例7: exit

<?php

if (!defined('__ROOT__')) {
    exit('Sorry,Please from entry!');
}
/**
 * init 入口引入文件
 * 项目自动初始化文件
 * 创建时间:2014-08-08 14:56 PGF
 */
Loader::core('Debug');
//加载DEBUG类
Debug::start();
//程序开始
Loader::func('Base');
//加载基础全局函数
Loader::core('Cache');
//加载缓存处理类
Cache::init();
//初始化缓存类
//向日志中添加已经加载的Loader
Debug::add(__ROOT__ . Config::config('core_dir') . '/bases/' . 'Loader.class.php', 1);
Loader::core('Router');
//加载Router
Router::run();
//Router运行
Debug::stop();
//程序结束
//====================    END Initialize.php      ========================//
开发者ID:pgfeng,项目名称:GFPHP,代码行数:29,代码来源:Initialize.php

示例8: query

 public final function query($sql = false)
 {
     if (!$sql) {
         $this->compile();
     }
     $sql = $sql ? $sql : $this->sql;
     //print_r($this);
     //echo Config::database('table_pre').Config::cache('table');
     if (Config::database('cache') && preg_match('/^SELECT/i', $sql) && (Config::database('table_pre') . Config::cache('table') != $this->table || Config::cache('driver') != 'dbCache')) {
         //echo '开启缓存';
         if (!Cache::is_cache(md5($sql), Config::database('cache_dir') . '/' . $this->section['table'])) {
             $data = $this->_query($sql);
             $cdata = '<?php exit;/*' . serialize($data) . '*/';
             Cache::set(md5($sql), $cdata, Config::database('cache_dir') . '/' . $this->section['table']);
             //Cache::$cache->writeCache($sql,$data,(Config::database('cache_dir').'/'.$this->section['table']));
             Debug::add('DB:Update Cache ' . $sql, 2);
         } else {
             //$data=Cache::$cache->readCache($sql,(Config::database('cache_dir').'/'.$this->section['table']));
             $data = unserialize(substr(Cache::get(md5($sql), Config::database('cache_dir') . '/' . $this->section['table']), 13, -2));
             //exit();
             Debug::add('DB:Read Cache' . $sql, 2);
         }
         $this->_reset();
         if ($data == null) {
             //防止直接返回Null
             $data = array();
         }
         return $data;
     } else {
         Debug::add($sql, 2);
         $this->_reset();
         $data = $this->_query($sql);
         if ($data == null) {
             //防止直接返回Null
             $data = array();
         }
         return $data;
     }
 }
开发者ID:pgfeng,项目名称:ssy.9icode.club,代码行数:39,代码来源:Db.class.php

示例9: returnData

if ($perfDataSize < 4) {
    if ($perfDataSize == 1) {
        returnData(Debug::errorMarkdownDashboard('#Influxdb Error: ' . $perfData[0] . ' Query: ' . INFLUX_QUERY), 1);
    } else {
        returnData(Debug::errorMarkdownDashboard('#Host / Service not found in Influxdb'), 1);
    }
}
// load templates
$templates = Folder::loadFolders(array(CUSTOM_TEMPLATE_FOLDER, DEFAULT_TEMPLATE_FOLDER));
Rule::setCheck($perfData['host'], $perfData['service'], $perfData['command'], array_keys($perfData['perfLabel']));
usort($templates, 'Template::compare');
$valid = $templates[0]->isValid();
foreach ($templates as $template) {
    Debug::add($template);
}
Debug::add("Is the first template valid: " . Debug::printBoolean($valid));
if ($valid) {
    $template = $templates[0];
} else {
    $template = Template::findDefaultTemplate($templates, 'default.php');
}
if (isset($template) && !empty($template)) {
    returnData($template->getTemplate($perfData), 0, 'OK');
} else {
    returnData(Debug::errorMarkdownDashboard('#No template found!'), 1);
}
/**
This function will print its input and exit with the given returncode.
@param object $data       This object will be converted to json.
@param int    $returnCode The returncode the programm will exit.
@return null.
开发者ID:simonmeggle,项目名称:histou,代码行数:31,代码来源:index.php

示例10: product_index

 public function product_index($p_product_id)
 {
     Debug::add("LimeLight->product_index()");
     if (is_array($p_product_id)) {
         $productCsv = implode(",", $p_product_id);
     } else {
         $productCsv = $p_product_id;
     }
     $qty_prods = count($p_product_id);
     Debug::add(array("product_id" => $productCsv));
     $result = $this->api('product_index', array("product_id" => $productCsv));
     if (!empty($result)) {
         foreach ($result as $field_name => $field_val) {
             $field_name = urldecode($field_name);
             $field_val = explode(',', $field_val);
             if (count($field_val) >= $qty_prods) {
                 for ($j = 0; $j < $qty_prods; $j++) {
                     if ($field_name == 'response_code') {
                         $res_arr[$p_product_id[$j]][$field_name] = urldecode($field_val[$j]);
                         $res_arr[$p_product_id[$j]]['product_id'] = $p_product_id[$j];
                     } else {
                         // The response_code is always first in the result from LimeLight so it should
                         // exist.  If they change the order of their first field then this will break!
                         if ($res_arr[$p_product_id[$j]]['response_code'] == '100') {
                             // Only record product information on valid product results.
                             $res_arr[$p_product_id[$j]][$field_name] = urldecode($field_val[$j]);
                         }
                     }
                 }
             }
         }
     }
     // temp hack
     Debug::add("Overriding product data with our product data - start");
     // we need to override/add product data from our own data to fill in missing fields such as quantity
     if (is_array($res_arr)) {
         foreach ($res_arr as $productId => $product) {
             $data = ProductLL::getProduct($productId);
             if (is_array($data)) {
                 $res_arr[$productId] += $data;
             }
         }
     }
     Debug::add("Overriding product data with our product data - end");
     Debug::add($res_arr);
     return $res_arr;
 }
开发者ID:evinw,项目名称:project_groupad_codeignitor,代码行数:47,代码来源:Limelight.php

示例11: load

 public static function load($file)
 {
     if (file_exists($file)) {
         $re = (require $file);
         Debug::add($file, '1');
         return $re;
     }
     Debug::add('Loader:' . $file . ' not found.');
     return false;
 }
开发者ID:pgfeng,项目名称:ssy.9icode.club,代码行数:10,代码来源:Loader.class.php

示例12: catchError

 public static function catchError($errno, $errstr, $errfile, $errline)
 {
     Debug::add(new ErrorException($errstr, 0, $errno, $errfile, $errline));
 }
开发者ID:jankuca,项目名称:escms,代码行数:4,代码来源:debug.layer.php

示例13: queryError

 /**
  * Handles an Query Error: A QueryExcpetion will be thrown.
  *
  * @see QueryException
  * @throws QueryException
  * @param string Last Query
  **/
 protected function queryError($query)
 {
     $e = new QueryException($this->error(), $this->errno());
     $e->setQuery($query);
     $e->setLine(__LINE__);
     $e->setFile(__FILE__);
     // Try to get better results for line and file.
     if (function_exists('debug_backtrace') == true) {
         $backtraceInfo = debug_backtrace();
         // 0 is class.mysql.php, 1 is the calling code...
         if (isset($backtraceInfo[1]) == true) {
             $e->setLine($backtraceInfo[1]['line']);
             $e->setFile($backtraceInfo[1]['file']);
         }
     }
     $this->debug->add($e);
     throw $e;
 }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:25,代码来源:class.Database.php

示例14: __call

 public function __call($a, $b)
 {
     Debug::add("方法{$a}不存在!");
 }
开发者ID:pgfeng,项目名称:GFPHP,代码行数:4,代码来源:Controller.class.php


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