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


PHP Logging::debug方法代码示例

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


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

示例1:

 /**
  * overwrite __construct() function
  * @return void
  */
 function __construct()
 {
     # these variables are assumed to be globally available
     global $logging;
     # set global references for this object
     $this->_log =& $logging;
     $this->reset();
     $this->_log->debug("constructed new ListState object");
 }
开发者ID:jzp74,项目名称:firstthingsfirst,代码行数:13,代码来源:Class.ListState.php

示例2: initialize

 static function initialize($settings, $version = "-")
 {
     self::$version = $version;
     self::$debug = (isset($settings) and isset($settings["debug"]) and $settings['debug'] === TRUE);
     self::$firebug = (isset($settings) and isset($settings["firebug_logging"]) and $settings['firebug_logging'] === TRUE);
     if (self::$firebug) {
         require_once 'FirePHPCore/fb.php';
         FB::setEnabled(true);
     }
 }
开发者ID:Zveroloff,项目名称:kloudspeaker,代码行数:10,代码来源:Logging.class.php

示例3: getTimelineDatatableAction

 public function getTimelineDatatableAction()
 {
     $start = microtime(true);
     $data = Application_Model_Preference::getTimelineDatatableSetting();
     if (!is_null($data)) {
         $this->view->settings = $data;
     }
     $end = microtime(true);
     Logging::debug("getting timeline datatables info took:");
     Logging::debug(floatval($end) - floatval($start));
 }
开发者ID:nidzix,项目名称:Airtime,代码行数:11,代码来源:UsersettingsController.php

示例4: exists

 /**
  * check if given table exists in database
  * @param string $table name of table
  * @return bool indicates if given table exists in database
  */
 function table_exists($table)
 {
     $query = "SHOW TABLES";
     $this->_log->debug("check if table exists (table=" . $table . ")");
     $result = $this->query($query);
     while ($row = $this->fetch($result)) {
         if ($row[0] == $table) {
             return TRUE;
         }
     }
     return FALSE;
 }
开发者ID:jzp74,项目名称:firstthingsfirst,代码行数:17,代码来源:Class.Database.php

示例5: generateToken

 private function generateToken($action, $user_id)
 {
     $salt = md5("pro");
     $token = self::generateRandomString();
     $info = new CcSubjsToken();
     $info->setDbUserId($user_id);
     $info->setDbAction($action);
     $info->setDbToken(sha1($token . $salt));
     $info->setDbCreated(gmdate('Y-m-d H:i:s'));
     $info->save();
     Logging::debug("generated token {$token}");
     return $token;
 }
开发者ID:RadioCampusFrance,项目名称:airtime,代码行数:13,代码来源:Auth.php

示例6: dispatchLoopShutdown

 public function dispatchLoopShutdown()
 {
     if (Application_Model_RabbitMq::$doPush) {
         $md = array('schedule' => Application_Model_Schedule::getSchedule());
         Application_Model_RabbitMq::SendMessageToPypo("update_schedule", $md);
         if (!isset($_SERVER['AIRTIME_SRV'])) {
             Application_Model_RabbitMq::SendMessageToShowRecorder("update_recorder_schedule");
         }
     }
     if (memory_get_peak_usage() > 30 * pow(2, 20)) {
         Logging::debug("Peak memory usage: " . memory_get_peak_usage() / 1000000 . " MB while accessing URI " . $_SERVER['REQUEST_URI']);
         Logging::debug("Should try to keep memory footprint under 25 MB");
     }
 }
开发者ID:RadioCampusFrance,项目名称:airtime,代码行数:14,代码来源:RabbitMqPlugin.php

示例7: hasBeenUpdatedSince

 public function hasBeenUpdatedSince($timestamp, $instances)
 {
     $outdated = false;
     $shows = Application_Model_Show::getShows($this->startDT, $this->endDT);
     $include = array();
     if ($this->opts["showFilter"] !== 0) {
         $include[] = $this->opts["showFilter"];
     } elseif ($this->opts["myShows"] === 1) {
         $include = $this->getUsersShows();
     }
     $currentInstances = array();
     foreach ($shows as $show) {
         if (empty($include) || in_array($show["show_id"], $include)) {
             $currentInstances[] = $show["instance_id"];
             if (isset($show["last_scheduled"])) {
                 $dt = new DateTime($show["last_scheduled"], new DateTimeZone("UTC"));
             } else {
                 $dt = new DateTime($show["created"], new DateTimeZone("UTC"));
             }
             //check if any of the shows have a more recent timestamp.
             $showTimeStamp = intval($dt->format("U"));
             if ($timestamp < $showTimeStamp) {
                 $outdated = true;
                 break;
             }
         }
     }
     //see if the displayed show instances have changed. (deleted,
     //empty schedule etc)
     if ($outdated === false && count($instances) !== count($currentInstances)) {
         Logging::debug("show instances have changed.");
         $outdated = true;
     }
     return $outdated;
 }
开发者ID:RadioCampusFrance,项目名称:airtime,代码行数:35,代码来源:ShowBuilder.php

示例8: findEntries

 public static function findEntries($con, $displayColumns, $fromTable, $data, $dataProp = "aaData")
 {
     $librarySetting = Application_Model_Preference::getCurrentLibraryTableColumnMap();
     //$displayColumns[] = 'owner';
     // map that maps original column position to db name
     $current2dbname = array();
     // array of search terms
     $orig2searchTerm = array();
     foreach ($data as $key => $d) {
         if (strstr($key, "mDataProp_")) {
             list($dump, $index) = explode("_", $key);
             $current2dbname[$index] = $d;
         } elseif (strstr($key, "sSearch_")) {
             list($dump, $index) = explode("_", $key);
             $orig2searchTerm[$index] = $d;
         }
     }
     // map that maps dbname to searchTerm
     $dbname2searchTerm = array();
     foreach ($current2dbname as $currentPos => $dbname) {
         $new_index = $librarySetting($currentPos);
         // TODO : Fix this retarded hack later. Just a band aid for
         // now at least we print some warnings so that we don't
         // forget about this -- cc-4462
         if (array_key_exists($new_index, $orig2searchTerm)) {
             $dbname2searchTerm[$dbname] = $orig2searchTerm[$new_index];
         } else {
             Logging::warn("Trying to reorder to unknown index\n                    printing as much debugging as possible...");
             $debug = array('$new_index' => $new_index, '$currentPos' => $currentPos, '$orig2searchTerm' => $orig2searchTerm);
             Logging::warn($debug);
         }
     }
     $where = array();
     /* Holds the parameters for binding after the statement has been
        prepared */
     $params = array();
     if (isset($data['advSearch']) && $data['advSearch'] === 'true') {
         $advancedWhere = self::buildWhereClauseForAdvancedSearch($dbname2searchTerm);
         if (!empty($advancedWhere['clause'])) {
             $where[] = join(" AND ", $advancedWhere['clause']);
             $params = $advancedWhere['params'];
         }
     }
     if ($data["sSearch"] !== "") {
         $searchTerms = explode(" ", $data["sSearch"]);
     }
     $selectorCount = "SELECT COUNT(*) ";
     $selectorRows = "SELECT " . join(",", $displayColumns) . " ";
     $sql = $selectorCount . " FROM " . $fromTable;
     $sqlTotalRows = $sql;
     if (isset($searchTerms)) {
         $searchCols = array();
         for ($i = 0; $i < $data["iColumns"]; $i++) {
             if ($data["bSearchable_" . $i] == "true") {
                 $searchCols[] = $data["mDataProp_{$i}"];
             }
         }
         $outerCond = array();
         $simpleWhere = array();
         foreach ($searchTerms as $term) {
             foreach ($searchCols as $col) {
                 $simpleWhere['clause']["simple_" . $col] = "{$col}::text ILIKE :simple_" . $col;
                 $simpleWhere['params']["simple_" . $col] = "%" . $term . "%";
             }
             $outerCond[] = "(" . implode(" OR ", $simpleWhere['clause']) . ")";
         }
         $where[] = "(" . implode(" AND ", $outerCond) . ")";
         $params = array_merge($params, $simpleWhere['params']);
     }
     // End Where clause
     // Order By clause
     $orderby = array();
     for ($i = 0; $i < $data["iSortingCols"]; $i++) {
         $num = $data["iSortCol_" . $i];
         $orderby[] = $data["mDataProp_{$num}"] . " " . $data["sSortDir_" . $i];
     }
     $orderby[] = "id";
     $orderby = join(",", $orderby);
     // End Order By clause
     $displayLength = intval($data["iDisplayLength"]);
     $needToBind = false;
     if (count($where) > 0) {
         $needToBind = true;
         $where = join(" OR ", $where);
         $sql = $selectorCount . " FROM " . $fromTable . " WHERE " . $where;
         $sqlTotalDisplayRows = $sql;
         $sql = $selectorRows . " FROM " . $fromTable . " WHERE " . $where . " ORDER BY " . $orderby;
         //limit the results returned.
         if ($displayLength !== -1) {
             $sql .= " OFFSET " . $data["iDisplayStart"] . " LIMIT " . $displayLength;
         }
     } else {
         $sql = $selectorRows . " FROM " . $fromTable . " ORDER BY " . $orderby;
         //limit the results returned.
         if ($displayLength !== -1) {
             $sql .= " OFFSET " . $data["iDisplayStart"] . " LIMIT " . $displayLength;
         }
     }
     try {
         $r = $con->query($sqlTotalRows);
//.........这里部分代码省略.........
开发者ID:nidzix,项目名称:Airtime,代码行数:101,代码来源:Datatables.php

示例9: notifyWebstreamDataAction

 public function notifyWebstreamDataAction()
 {
     $request = $this->getRequest();
     $data = $request->getParam("data");
     $media_id = $request->getParam("media_id");
     $data_arr = json_decode($data);
     if (!is_null($media_id) && isset($data_arr->title) && strlen($data_arr->title) < 1024) {
         $previous_metadata = CcWebstreamMetadataQuery::create()->orderByDbStartTime('desc')->filterByDbInstanceId($media_id)->findOne();
         $do_insert = true;
         if ($previous_metadata) {
             if ($previous_metadata->getDbLiquidsoapData() == $data_arr->title) {
                 Logging::debug("Duplicate found: " . $data_arr->title);
                 $do_insert = false;
             }
         }
         if ($do_insert) {
             $webstream_metadata = new CcWebstreamMetadata();
             $webstream_metadata->setDbInstanceId($media_id);
             $webstream_metadata->setDbStartTime(new DateTime("now", new DateTimeZone("UTC")));
             $webstream_metadata->setDbLiquidsoapData($data_arr->title);
             $webstream_metadata->save();
         }
     } else {
         throw new Error("Unexpected error. media_id {$media_id} has a null stream value in cc_schedule!");
     }
     $this->view->response = $data;
     $this->view->media_id = $media_id;
 }
开发者ID:nidzix,项目名称:Airtime,代码行数:28,代码来源:ApiController.php

示例10: passwordChangeAction

 public function passwordChangeAction()
 {
     //uses separate layout without a navigation.
     $this->_helper->layout->setLayout('login');
     $request = $this->getRequest();
     $token = $request->getParam("token", false);
     $user_id = $request->getParam("user_id", 0);
     $form = new Application_Form_PasswordChange();
     $auth = new Application_Model_Auth();
     $user = CcSubjsQuery::create()->findPK($user_id);
     //check validity of token
     if (!$auth->checkToken($user_id, $token, 'password.restore')) {
         Logging::debug("token not valid");
         $this->_helper->redirector('index', 'login');
     }
     if ($request->isPost() && $form->isValid($request->getPost())) {
         $user->setDbPass(md5($form->password->getValue()));
         $user->save();
         $auth->invalidateTokens($user, 'password.restore');
         $zend_auth = Zend_Auth::getInstance();
         $zend_auth->clearIdentity();
         $authAdapter = Application_Model_Auth::getAuthAdapter();
         $authAdapter->setIdentity($user->getDbLogin())->setCredential($form->password->getValue());
         $zend_auth->authenticate($authAdapter);
         //all info about this user from the login table omit only the password
         $userInfo = $authAdapter->getResultRowObject(null, 'password');
         //the default storage is a session with namespace Zend_Auth
         $authStorage = $zend_auth->getStorage();
         $authStorage->write($userInfo);
         $this->_helper->redirector('index', 'showbuilder');
     }
     $this->view->form = $form;
 }
开发者ID:nidzix,项目名称:Airtime,代码行数:33,代码来源:LoginController.php

示例11: Logging

$loglevel = Logging::$LOG_INFO;
$dryrun = $args['--dry-run'];
if ($args['--quiet']) {
    $loglevel = Logging::$LOG_QUIET;
} else {
    if ($args['--debug']) {
        $loglevel = Logging::$LOG_DEBUG;
    } else {
        $loglevel = Logging::$LOG_INFO;
    }
}
$logger = new Logging($loglevel);
/**
 * Just do some debug with arguments scanned by docopt
 */
$logger->debug("Script " . $_SERVER['argv'][0] . "called with following arguments:");
foreach ($args as $k => $v) {
    $logger->debug($k . ': ' . json_encode($v));
}
/**
 * Get every manifests in use in packages
 */
$manifests_used = getManifestsUsed($logger);
$logger->info(count($manifests_used) . " manifest(s) used in packages.");
$logger->debug($manifests_used);
/**
 * Get every manifests registered in database
 */
$manifests_registered = getManifestsRegistered($logger);
$logger->info(count($manifests_registered) . " manifest(s) registered in database.");
$logger->debug($manifests_registered);
开发者ID:korial29,项目名称:fusioninventory-for-glpi,代码行数:31,代码来源:cleanup_repository.php

示例12: Logging

$logging = new Logging($firstthingsfirst_loglevel, "../logs/" . $firstthingsfirst_logfile);
# the tmp file name has to be given by means of a parameter
if (isset($_GET['tmp_file'])) {
    $tmp_file = $_GET['tmp_file'];
} else {
    $tmp_file = 'tmp.txt';
    $logging->warn("parameter tmp_file not given, assuming tmp.txt");
}
# the original file name has to be given by means of a parameter
if (isset($_GET['file_name'])) {
    $file_name = $_GET['file_name'];
} else {
    $file_name = 'list_export.csv';
    $logging->warn("parameter file_name not given, assuming list_export.csv");
}
$logging->debug("exporting file (tmp_file={$tmp_file}, file_name={$file_name})");
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private, false");
#header("Content-Type: text/plain" );
header("Content-Disposition: attachment; filename=\"{$file_name}\";");
header("Content-Transfer-Encoding:­ binary");
ob_clean();
flush();
# read the file to standard out
$full_tmp_file_name = "../uploads/" . $tmp_file;
if (readfile($full_tmp_file_name) == FALSE) {
    print "ERROR could not read temporary file";
}
# delete the tmp file
开发者ID:jzp74,项目名称:firstthingsfirst,代码行数:31,代码来源:Html.Export.php

示例13: insert

 /**
  * add a new record to database
  * @param $name_values_array array array containing name-values of the record
  * @param $user_name string name of current user
  * @return int number indicates the id of the new record or 0 when no record was added
  */
 function insert($name_values_array, $user_name)
 {
     $values = array();
     $db_field_names = array_keys($name_values_array);
     $this->_log->trace("inserting into DatabaseTable (user_name=" . $user_name . ")");
     # check if database connection is working
     if ($this->_check_database_connection() == FALSE) {
         return 0;
     }
     # check if database table exists
     if (!$this->_database->table_exists($this->table_name)) {
         if ($this->create() == FALSE) {
             return 0;
         }
     }
     foreach ($db_field_names as $db_field_name) {
         $value = $name_values_array[$db_field_name];
         $field_type = $this->fields[$db_field_name][1];
         # check if db_field_name is known
         if ($field_type == "") {
             $this->_handle_error("unknown field type (db_field_name=" . $db_field_name . ")", "ERROR_DATABASE_PROBLEM");
             return 0;
         }
         $this->_log->debug("building insert query (db_field_name=" . $db_field_name . ", value=" . $value . ")");
         # encode text field
         if (stristr($field_type, "TEXT")) {
             $value = htmlentities($value, ENT_QUOTES);
         }
         if (stristr($field_type, "DATE")) {
             if (!$this->_check_datetime($value)) {
                 $this->_handle_error("given date string is incorrect (date_str=" . $value . ")", "ERROR_DATE_WRONG_FORMAT");
                 return 0;
             } else {
                 array_push($values, "'" . $value . "'");
             }
         } else {
             if ($field_type == FIELD_TYPE_DEFINITION_AUTO_CREATED || $field_type == FIELD_TYPE_DEFINITION_AUTO_MODIFIED) {
                 array_push($values, "'0'");
             } else {
                 array_push($values, "'" . $value . "'");
             }
         }
     }
     $query = "INSERT INTO " . $this->table_name . " VALUES (0, " . implode($values, ", ");
     # add archiver name and datetime
     if ($this->metadata_str[DATABASETABLE_METADATA_ENABLE_ARCHIVE] != DATABASETABLE_METADATA_FALSE) {
         $query .= ", \"\"";
         $query .= ", \"" . DB_NULL_DATETIME . "\"";
     }
     # add creator name and datetime
     if ($this->metadata_str[DATABASETABLE_METADATA_ENABLE_CREATE] != DATABASETABLE_METADATA_FALSE) {
         $query .= ", \"" . $user_name . "\"";
         $query .= ", \"" . strftime(DB_DATETIME_FORMAT) . "\"";
     }
     # add modifier name and datetime
     if ($this->metadata_str[DATABASETABLE_METADATA_ENABLE_MODIFY] != DATABASETABLE_METADATA_FALSE) {
         $query .= ", \"" . $user_name . "\"";
         $query .= ", \"" . strftime(DB_DATETIME_FORMAT) . "\"";
     }
     $query .= ")";
     $result = $this->_database->insertion_query($query);
     if ($result == 0) {
         $this->_handle_error("could not insert record to DatabaseTable", "ERROR_DATABASE_PROBLEM");
         return 0;
     }
     $this->_log->trace("inserted record into DatabaseTable (result=" . $result . ")");
     return $result;
 }
开发者ID:jzp74,项目名称:firstthingsfirst,代码行数:74,代码来源:Class.DatabaseTable.php

示例14: debug_sparse

 public static function debug_sparse(array $p_msg)
 {
     Logging::debug("Sparse output:");
     Logging::debug(array_filter($p_msg));
 }
开发者ID:nidzix,项目名称:Airtime,代码行数:5,代码来源:Logging.php

示例15: methods

<?php 
$doc = <<<DOC
get_job_logs.php

Usage:
   get_job_logs.php [-h | -q | -d ] [-m methods] [-t task_ids]

-h, --help     Show this help
-q, --quiet    Run quietly
-d, --debug    Show informations.

-m, --methods=methods   Show only tasks defined with a list of methods (separated by commas).
-t, --tasks=task_ids    Filter logs by tasks (separated by commas)
DOC;
chdir(dirname($_SERVER["SCRIPT_FILENAME"]));
include "../../../inc/includes.php";
include "./docopt.php";
require "./logging.php";
/**
 * Process arguments passed to the script
 */
$docopt = new \Docopt\Handler();
$args = $docopt->handle($doc);
$logger = new Logging();
$logger->setLevelFromArgs($args['--quiet'], $args['--debug']);
$logger->debug($args);
/*
 * Get Running Tasks
 */
$logs = PluginFusioninventoryTask::getJobLogs();
$logger->info($logs);
开发者ID:korial29,项目名称:fusioninventory-for-glpi,代码行数:31,代码来源:get_job_logs.php


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