本文整理汇总了PHP中Trace::add_trace方法的典型用法代码示例。如果您正苦于以下问题:PHP Trace::add_trace方法的具体用法?PHP Trace::add_trace怎么用?PHP Trace::add_trace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Trace
的用法示例。
在下文中一共展示了Trace::add_trace方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($conf)
{
Trace::add_trace('construct class', __METHOD__);
self::$conf = $conf;
self::$conn = new DB($conf);
$this->Func = new Func();
}
示例2: load
/** Load Dictionary
*
* @param Array $load - Dictionary array
*
*/
public static function load($load)
{
Trace::add_trace('construct class', __METHOD__);
self::$dic = isset($load['dic']) ? $load['dic'] : array();
self::$hooks = isset($load['js']) ? $load['js'] : array();
self::$lang = isset($load['lang']) ? $load['lang'] : array();
}
示例3: generate_login_session
/** Generate login session token
*
* @param string $pass
* @return string
*/
public function generate_login_session($pass)
{
Trace::add_trace('generate login session request', __METHOD__);
return md5($pass . date("Y-m-d H:i:s"));
}
示例4: target
/** Set page target name
*
* @return boolean
*/
public function target()
{
Trace::add_trace('get page target', __METHOD__);
$target = $this->Func->filter_var(filter_input(INPUT_GET, 'page'));
if (!is_null($target) && $target) {
$this->target = $target;
return true;
}
$this->target = false;
return false;
}
示例5: array
/************************* Page Target and token ******************************/
Trace::add_step(__FILE__, "Set Target and Page Token");
$Page->target();
if ($User->user_loged) {
$Page->token = $User->sess_save["sess"];
}
Trace::add_trace("Page parsed target", __FILE__, array("target" => $Page->target));
Trace::add_trace("Page token", __FILE__, array("token" => $Page->token));
/**************************** Secure Request *********************************/
Trace::add_step(__FILE__, "Secure Request Handler");
$request = $Page->Func->synth($_POST, array("req", "token"));
if ($User->user_loged && $request["req"] !== "" && $request["token"] === $User->sess_save["sess"]) {
Trace::add_trace("Secure request detected.", __FILE__, $request);
switch ($request["req"]) {
case "api":
Trace::add_trace("Loading Api Request", __FILE__);
$Page->secure = true;
$Page->target = "api";
break;
default:
die("E:01");
}
}
/****************************** Page Loader ***********************************/
switch ($Page->target) {
case "api":
Trace::add_step(__FILE__, "Load secure api");
if ($Page->secure) {
include_once PATH_CLASSES . "Api.class.php";
include_once PATH_PAGES . "api.php";
} else {
示例6: save_db_errors
private function save_db_errors($error, $query)
{
Trace::add_trace('Run DB save error', __METHOD__);
if (getenv("HTTP_X_FORWARDED_FOR") && getenv("HTTP_X_FORWARDED_FOR") !== "") {
$IP = getenv("HTTP_X_FORWARDED_FOR");
$proxy = getenv("REMOTE_ADDR");
$host = gethostbyaddr(getenv("HTTP_X_FORWARDED_FOR"));
} else {
$IP = getenv("REMOTE_ADDR");
$proxy = "No proxy detected";
$host = gethostbyaddr(getenv("REMOTE_ADDR"));
}
if (!$IP || $IP === '' || $IP === null) {
$IP = 'cant';
}
if (!$proxy || $proxy === '' || $proxy === null) {
$proxy = 'cant';
}
if (!$host || $host === '' || $host === null) {
$host = 'cant';
}
$this->insert_safe($this->filter(LOG_DB_TO_TABLE), array('page' => basename($_SERVER['PHP_SELF']), 'user_ip' => $IP, 'proxy' => $proxy, 'host' => $host, 'sql_message' => $error, 'query_used' => $query), false);
}
示例7: __construct
public function __construct()
{
Trace::add_trace('construct class', __METHOD__);
}
示例8: __construct
/** Constructor
*
* @param array $conf
*
*/
public function __construct($conf)
{
parent::__construct($conf);
Trace::add_trace('construct class', __METHOD__);
}
示例9: rand_string
/** Random string generator
*
* @param int $length
* @return string
*
*/
public function rand_string($length = 10)
{
Trace::add_trace('rand string', __METHOD__);
$ch = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$chLength = strlen($ch);
$rand = '';
for ($i = 0; $i < $length; $i++) {
$rand .= $ch[rand(0, $chLength - 1)];
}
return $rand;
}