本文整理汇总了PHP中dbg函数的典型用法代码示例。如果您正苦于以下问题:PHP dbg函数的具体用法?PHP dbg怎么用?PHP dbg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dbg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dbg
function dbg($variable = "", $description = 'Value', $table_started = 0)
{
# WARNING recursive
if (!$table_started) {
echo "<ul type='circle' style='border:1px solid #a0a0a0;padding-bottom:4px;padding-right:4px'>\n<li>{" . getenv("REQUEST_URI") . "} ";
}
echo "<i>{$description}</i>: ";
if (is_array($variable) || is_object($variable)) {
if (is_array($variable)) {
echo "(array)[" . count($variable) . "]";
} else {
echo "<B>(object)</B>[" . count($variable) . "]";
}
echo "<ul type='circle' style='border:1px solid #a0a0a0;padding-bottom:4px;padding-right:4px'>\n";
foreach ($variable as $key => $value) {
echo "<li>\"{$key}\" => ";
dbg($value, '', TRUE);
echo "</li>\n";
}
echo "</ul>\n";
} else {
echo "(" . gettype($variable) . ") '{$variable}'\n";
}
if (!$table_started) {
echo "</li></ul>\n";
}
}
示例2: quarantine_clean
function quarantine_clean()
{
$oldest = date('U', strtotime('-' . QUARANTINE_DAYS_TO_KEEP . " days"));
$quarantine = get_conf_var('QuarantineDir');
$d = dir($quarantine) or die($php_errormsg);
while (false !== ($f = $d->read())) {
// Only interested in quarantine directories (yyyymmdd)
if (preg_match('/^\\d{8}$/', $f)) {
$unixtime = quarantine_date_to_unixtime($f);
if ($unixtime < $oldest) {
// Needs to be deleted
$array = quarantine_list_dir($f);
dbg("Processing directory {$f}: found " . count($array) . " records to delete");
foreach ($array as $id) {
// Update the quarantine flag
$sql = "UPDATE maillog SET timestamp=timestamp, quarantined = NULL WHERE id='{$id}'";
dbquery($sql);
}
dbg("Deleting: " . escapeshellarg($quarantine . '/' . $f));
exec('rm -rf ' . escapeshellarg($quarantine . '/' . $f), $output, $return);
if ($return > 0) {
echo "Error: {$output}\n";
}
}
}
}
$d->close();
}
示例3: result
function result($status, $value)
{
$json = json_encode(array("status" => $status, "value" => $value));
dbg($json);
echo $json;
exit;
}
示例4: initSqlInjectionFilter
private function initSqlInjectionFilter()
{
if (function_exists('sqlInjectionFilter') && $this->isNeedFilterSql) {
dbg('sqlInjectionFilter');
sqlInjectionFilter();
}
}
示例5: getFileContent
function getFileContent($m)
{
global $xmlrpcerruser;
global $xmlrpcString;
$file_name = $m->getParam(0);
$file_path = $m->getParam(1);
$file_name = $file_name->scalarval();
$file_path = $file_path->scalarval();
$sql = "SELECT * FROM `" . DB_PREFIX . DB_TBL_FILES . "` WHERE \n\t\t`name` = '" . mysql_escape_string($file_name) . "' AND \n\t\t`path` = '" . mysql_escape_string($file_path) . "'";
$sql = mysql_query($sql);
if (false == $sql) {
dbg();
my_die();
}
$aList = array();
while ($row = mysql_fetch_assoc($sql)) {
$aList[] = $row;
}
if (empty($aList)) {
return new xmlrpcresp(0, $xmlrpcerruser, 'file not exist');
}
$aList = current($aList);
if (!defined($aList['path'])) {
return new xmlrpcresp(0, $xmlrpcerruser, 'file path not correct (remote error)');
}
$response = saferead(constant($aList['path']) . '/' . $aList['name']);
// Возвращаем
$response = base64_encode($response);
return new xmlrpcresp(new xmlrpcval($response), $xmlrpcString);
}
示例6: cycle
public function cycle()
{
$this->dirServer->setPageSize(500);
$this->dirServer->setPageNo(0);
dbg("CYCLE");
$_SESSION['show'] = true;
}
示例7: runtimeError
public function runtimeError()
{
$solutionId = I('get.sid', 0, 'intval');
$type = SourceModel::RUNTIMEERROR;
$error = SourceModel::instance()->getErrorBySolutionId($solutionId, $type);
dbg($error);
}
示例8: viewport
function viewport()
{
$relativeCategoriesPath = '../' . appdataDir . '/' . categoriesDir . '/' . $_SESSION['category'] . '/';
$urlbase = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
$categDirs = $this->catsource->getList();
$key = array_search(all, $categDirs);
if ($key !== false) {
dbg("reducing array:");
dbgmp($categDirs);
unset($categDirs[$key]);
dbgmp($categDirs);
// array_splice($categDirs, $key,1);//not needed?
dbgmp($categDirs);
}
$files = $this->source->getList();
dbgmp($files);
include "ui/header.php";
if (isset($_SESSION['show'])) {
if ($_SESSION['show']) {
include "ui/slideshow.php";
$_SESSION['show'] = false;
} else {
include "ui/thumbnails.php";
}
} else {
include "ui/thumbnails.php";
}
}
示例9: daemon_body
function daemon_body()
{
# The main loop
dbg("start main loop");
while (sleep(1) == 0) {
info("I'm working hard!");
}
}
示例10: s_clean
function s_clean($max)
{
dbg(__FUNCTION__);
exit;
global $Db;
$old = time() - $max;
$sql = "DELETE FROM " . DB_PREFIX . DB_TBL_SESSIONS . " WHERE `access` < '{$old}'";
return $Db->query($sql);
}
示例11: dav_init
/**
* @param App $a
*/
function dav_init(&$a)
{
/*
* Recommended settings:
* ALTER TABLE `photo` ADD INDEX ( `contact-id` )
*/
dav_include_files();
if (false) {
dbg(true);
error_reporting(E_ALL);
ini_set("display_errors", 1);
}
wdcal_create_std_calendars();
if ($a->argc >= 2 && $a->argv[1] == "wdcal") {
if ($a->argc >= 3 && $a->argv[2] == "feed") {
wdcal_print_feed($a->get_baseurl() . "/dav/wdcal/");
killme();
} elseif ($a->argc >= 3 && strlen($a->argv[2]) > 0) {
wdcal_addRequiredHeadersEdit();
} else {
wdcal_addRequiredHeaders();
}
return;
}
if ($a->argc >= 2 && $a->argv[1] == "settings") {
return;
}
$authBackend = new Sabre_DAV_Auth_Backend_Friendica();
$principalBackend = new Sabre_DAVACL_PrincipalBackend_Friendica($authBackend);
$caldavBackend_std = new Sabre_CalDAV_Backend_Std();
$caldavBackend_community = new Sabre_CalDAV_Backend_Friendica();
$carddavBackend_std = new Sabre_CardDAV_Backend_Std();
$carddavBackend_community = new Sabre_CardDAV_Backend_FriendicaCommunity();
if (isset($_SERVER["PHP_AUTH_USER"])) {
$tree = new Sabre_DAV_SimpleCollection('root', array(new Sabre_DAV_SimpleCollection('principals', array(new Sabre_CalDAV_Principal_Collection($principalBackend, "principals/users"))), new Sabre_CalDAV_AnimexxCalendarRootNode($principalBackend, array($caldavBackend_std, $caldavBackend_community)), new Sabre_CardDAV_AddressBookRootFriendica($principalBackend, array($carddavBackend_std, $carddavBackend_community))));
} else {
$tree = new Sabre_DAV_SimpleCollection('root', array());
}
// The object tree needs in turn to be passed to the server class
$server = new Sabre_DAV_Server($tree);
$url = parse_url($a->get_baseurl());
$server->setBaseUri(CALDAV_URL_PREFIX);
$authPlugin = new Sabre_DAV_Auth_Plugin($authBackend, 'SabreDAV');
$server->addPlugin($authPlugin);
$aclPlugin = new Sabre_DAVACL_Plugin_Friendica();
$aclPlugin->defaultUsernamePath = "principals/users";
$server->addPlugin($aclPlugin);
$caldavPlugin = new Sabre_CalDAV_Plugin();
$server->addPlugin($caldavPlugin);
$carddavPlugin = new Sabre_CardDAV_Plugin();
$server->addPlugin($carddavPlugin);
$browser = new Sabre_DAV_Browser_Plugin();
$server->addPlugin($browser);
$server->exec();
killme();
}
示例12: show_audit
function show_audit($log)
{
$info = date('c', $log->_when);
$info .= ' ' . $log->_who;
$info .= ': ' . $log->_what;
if ($log->_extra != "") {
$info .= ' context:' . $log->_extra;
}
dbg($info);
}
示例13: load
/**
* @param string $id
* @return string|null
*/
public function load($id)
{
$cacheFile = $this->getCacheFileName($id);
if (file_exists($cacheFile) && Carbon::createFromTimestamp(filemtime($cacheFile))->diffInSeconds(Carbon::now()) < $this->cacheTtlSeconds) {
dbg('CACHE LOAD: ' . $cacheFile . ', cache ttl ' . $this->cacheTtlSeconds . ' (' . $id . ')');
return file_get_contents($cacheFile);
}
dbg('CACHE NOT FOUND: ' . $cacheFile . ', cache ttl ' . $this->cacheTtlSeconds . ' (' . $id . ')');
return null;
}
示例14: ExecDispatcher
function ExecDispatcher($sExec, $aParams)
{
//dbg($aParams, $sExec);
$component_id = 0;
if (isset($aParams['component_id'])) {
$component_id = $aParams['component_id'];
}
//dbg($component_id,'$component_id');
unset($aParams['component_id']);
switch ($sExec) {
case 'getAllTablesAndAliases':
return cComponents::getAllTablesAndAliases();
break;
case 'getTables_Component':
return cComponents::getTables_Component($component_id);
break;
case 'getModules_Component':
return cComponents::getModules_Component($component_id);
break;
case 'getTpls_Component':
return cComponents::getTpls_Component($component_id);
break;
case 'getPages_Component':
return cp1251_to_utf(cComponents::getPages_Component($component_id));
break;
case 'delPage_Component':
return cComponents::delLink_Component($component_id, $aParams, DB_TBL_COMPONENTS2PAGES, 'page_id');
break;
case 'delTable_Component':
return cComponents::delLink_Component($component_id, $aParams, DB_TBL_COMPONENTS2TABLES, 'table_id');
break;
case 'delTpl_Component':
return cComponents::delLink_Component($component_id, $aParams, DB_TBL_COMPONENTS2TPLS, 'tpl_id');
break;
case 'delModule_Component':
return cComponents::delLink_Component($component_id, $aParams, DB_TBL_COMPONENTS2MODULES, 'module_id');
break;
case 'setPages_Component':
return cComponents::setLink_Component($component_id, $aParams, DB_TBL_COMPONENTS2PAGES, 'page_id');
break;
case 'setTables_Component':
return cComponents::setLink_Component($component_id, $aParams, DB_TBL_COMPONENTS2TABLES, 'table_id');
break;
case 'setTpls_Component':
return cComponents::setLink_Component($component_id, $aParams, DB_TBL_COMPONENTS2TPLS, 'tpl_id');
break;
case 'setModules_Component':
return cComponents::setLink_Component($component_id, $aParams, DB_TBL_COMPONENTS2MODULES, 'module_id');
break;
default:
dbg($sParams, 'Execution Dispatcher Fault: ' . $sExec);
return '';
break;
}
}
示例15: logit
function logit($msg)
{
global $db;
$msg = preg_replace("/'/", "\\'", $msg);
dbg("logging '{$msg}'");
$sql = "insert into log (stamp, msg) values (now(), '{$msg}')";
$rs = $db->Execute($sql);
if (!$rs) {
p_sqlfail($db, $sql);
}
}