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


PHP CSQLDataSource::trace方法代码示例

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


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

示例1: insert

 /**
  * Inserts an error log into database
  *
  * @param int    $user_id     User ID
  * @param string $server_ip   Server IP
  * @param string $datetime    Datetime
  * @param string $request_uid Request unique ID
  * @param string $error_type  Error type
  * @param string $text        Error message
  * @param string $file_name   File name
  * @param int    $line_number Line number
  * @param array  $data        Data (stacktrace, GET, POST and session)
  *
  * @return void
  *
  * @throws Exception
  */
 static function insert($user_id, $server_ip, $datetime, $request_uid, $error_type, $text, $file_name, $line_number, $data)
 {
     global $m, $action, $dosql;
     if (empty($action) && isset($dosql)) {
         $action = $dosql;
     }
     // Never trace error logging for readability
     $trace = CSQLDataSource::$trace;
     CSQLDataSource::$trace = false;
     $ds = CSQLDataSource::get("std");
     if (!$ds || !$ds->loadTable("error_log")) {
         throw new Exception("No datasource available");
     }
     foreach ($data as $_field => $_value) {
         if (empty($_value)) {
             $data[$_field] = null;
             continue;
         }
         $data[$_field] = CErrorLogData::insert(json_encode($_value));
     }
     $signature = array("text" => $text, "module" => isset($m) ? $m : null, "action" => isset($action) ? $action : null);
     $signature_hash = md5(json_encode($signature));
     $query = "INSERT INTO" . " `error_log` (\n      `user_id`, `server_ip`,\n      `datetime`, `request_uid`, `error_type`, `text`,\n      `file_name`, `line_number`,\n      `stacktrace_id`, `param_GET_id`, `param_POST_id`, `session_data_id`,\n      `signature_hash`\n    ) VALUES (%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13)";
     $query = $ds->prepare($query, $user_id, $server_ip, $datetime, $request_uid, $error_type, $text, $file_name, $line_number, $data["stacktrace"], $data["param_GET"], $data["param_POST"], $data["session_data"], $signature_hash);
     $result = @$ds->exec($query);
     CSQLDataSource::$trace = $trace;
     if (!$result) {
         throw new Exception("Exec failed");
     }
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:47,代码来源:CErrorLog.class.php

示例2: CSmartyDP

// Check whether we should trace SQL queries
if ($query_trace = CValue::get("query_trace")) {
    CSQLDataSource::$trace = true;
}
if ($query_report = CValue::get("query_report")) {
    CSQLDataSource::$report = true;
}
// tabBox et inclusion du fichier demandé
if ($tab !== null) {
    $module->showTabs();
} else {
    $module->showAction();
}
// Check whether we should trace SQL queries
if ($query_trace) {
    CSQLDataSource::$trace = false;
}
if ($query_report) {
    CSQLDataSource::$report = false;
    CSQLDataSource::displayReport();
}
CApp::$chrono->stop();
CApp::preparePerformance();
// Unlocalized strings
if (!$suppressHeaders || $ajax) {
    CAppUI::$unlocalized = array_map("utf8_encode", CAppUI::$unlocalized);
    $unloc = new CSmartyDP("modules/system");
    $unloc->display("inc_unlocalized_strings.tpl");
}
// Inclusion du footer
if (!$suppressHeaders) {
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:main.php

示例3: CSejour

$date_min = $see_yesterday ? CMbDT::date("-1 day", $date) : $date;
$date_max = CMbDT::date("+1 day", $date);
// Chargement des séjours concernés
$sejour = new CSejour();
$where = array();
$where["sejour.entree"] = "BETWEEN '{$date_min}' AND '{$date_max}'";
$where["sejour.group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
$order = "entree";
/** @var CSejour[] $sejours */
$sejours = $sejour->loadList($where, $order);
$count = 0;
$operations_merge = array();
foreach ($sejours as $_sejour) {
    CSQLDataSource::$trace = 1;
    $operations = $_sejour->loadRefCurrOperations($date);
    CSQLDataSource::$trace = 0;
    if (count($operations) != 2) {
        if (count($operations) > 2) {
            CAppUI::stepAjax("Il y a plus de deux opérations (" . count($operations) . ") pour {$_sejour->_view}", UI_MSG_WARNING);
        }
        continue;
    }
    $count++;
    $operations_merge[] = $operations;
}
CAppUI::stepAjax("{$count} interventions sont à fusionner");
foreach ($operations_merge as $_operation_merge) {
    /** @var COperation[] $op_merge */
    $op_merge = array_values($_operation_merge);
    $plageop = 0;
    foreach ($op_merge as $_operation) {
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:ajax_merge_interv.php


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