本文整理汇总了PHP中debug::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP debug::debug方法的具体用法?PHP debug::debug怎么用?PHP debug::debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类debug
的用法示例。
在下文中一共展示了debug::debug方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initialize debug
*
* @param array $options
*/
public static function init($options)
{
self::$debug = !empty($options['debug']) ? true : false;
if (self::$debug) {
self::$email = !empty($options['email']) ? $options['email'] : null;
self::$toolbar = !empty($options['toolbar']) ? true : false;
self::benchmark('application start');
}
}
示例2: array
$timeoutSql = $db->q("SELECT deviceConnectionTimout FROM settings");
$result = mysql_fetch_assoc($timeoutSql);
$timeout = $result['deviceConnectionTimout'];
// Get active nodes for a given task ID
// Query to retrieve row for given ID (tidxxxxxx is stored in nodes and is generated when task is created)
$getNodesSql = "SELECT \n\t\t\t\t\t\t\t\t\t\tid, \n\t\t\t\t\t\t\t\t\t\tdeviceName, \n\t\t\t\t\t\t\t\t\t\tdeviceIpAddr, \n\t\t\t\t\t\t\t\t\t\tdevicePrompt, \n\t\t\t\t\t\t\t\t\t\tdeviceUsername, \n\t\t\t\t\t\t\t\t\t\tdevicePassword, \n\t\t\t\t\t\t\t\t\t\tdeviceEnableMode, \n\t\t\t\t\t\t\t\t\t\tdeviceEnablePassword, \n\t\t\t\t\t\t\t\t\t\tnodeCatId, \n\t\t\t\t\t\t\t\t\t\tdeviceAccessMethodId, \n\t\t\t\t\t\t\t\t\t\tconnPort \n\t\t\t\t\t\t\t\t\t\tFROM nodes WHERE taskId" . $tid . " = 1 AND status = 1";
if ($result = $db->q($getNodesSql)) {
// push rows to $devices array
$devices = array();
while ($row = mysql_fetch_assoc($result)) {
array_push($devices, $row);
}
foreach ($devices as $device) {
// debugging check and action
if ($debugOnOff === '1' || isset($cliDebugOutput)) {
$debug->debug($device);
}
// ok, verification of host reachability based on fsockopen to host port i.e. 22 or 23. If fails, continue to next foreach iteration
$status = getHostStatus($device['deviceIpAddr'], $device['connPort']);
// getHostStatus() from functions.php
if ($status === "<font color=red>Unavailable</font>") {
$text = "Failure: Unable to connect to " . $device['deviceName'] . " - " . $device['deviceIpAddr'] . " when running taskID " . $tid;
$report->eachData($device['deviceName'], $connStatusFail, $text);
// log to report
echo $text . " - getHostStatus() Error:(File: " . $_SERVER['PHP_SELF'] . ")\n";
// log to console
$log->Conn($text . " - getHostStatus() Error:(File: " . $_SERVER['PHP_SELF'] . ")");
// logg to file
continue;
}
// get command list for device. This is based on the catId. i.e. catId->cmdId->CmdName->Node
示例3: stop
public static function stop()
{
self::$debug = false;
}
示例4:
function debug_mock()
{
parent::debug();
}
示例5: while
while ($row = mysql_fetch_assoc($result)) {
array_push($devices, $row);
}
// get the config snippet data from the DB
$cmdsSql = $db->q("SELECT * FROM snippets WHERE id = " . $snipId);
$result = mysql_fetch_assoc($cmdsSql);
$snippet = $result['snippet'];
$snippetArr = explode("\n", $snippet);
// explode text new lines to array
$snippetArr = array_map('trim', $snippetArr);
// trim whitespace from each array value
$tableRow = "";
foreach ($devices as $device) {
// debugging check and action
if ($debugOnOff === '1' || isset($cliDebugOutput)) {
$debug->debug($device);
}
// ok, verification of host reachability based on fsockopen to host port i.e. 22 or 23. If fails, continue to next foreach iteration
$status = getHostStatus($device['deviceIpAddr'], $device['connPort']);
// getHostStatus() from functions.php
if ($status === "<font color=red>Unavailable</font>") {
$text = "Failure: Unable to connect to " . $device['deviceName'] . " - " . $device['deviceIpAddr'] . " when running taskID " . $tid;
$report->eachComplianceDataRowDeviceName($device['deviceName'], $connStatusFail, $text);
// log to report
echo $text . " - getHostStatus() Error:(File: " . $_SERVER['PHP_SELF'] . ")\n";
// log to console
$log->Conn($text . " - getHostStatus() Error:(File: " . $_SERVER['PHP_SELF'] . ")");
// logg to file
continue;
}
// get the category for the device