本文整理汇总了PHP中Debug函数的典型用法代码示例。如果您正苦于以下问题:PHP Debug函数的具体用法?PHP Debug怎么用?PHP Debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Debug函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: System_Load
function System_Load($Name)
{
/****************************************************************************/
$__args_types = array('string');
#-----------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/****************************************************************************/
$Paths = Func_Get_Args();
if (!Count($Paths)) {
return ERROR | @Trigger_Error('[System_Load]: не передан ни один путь к системному компоненту');
}
#-----------------------------------------------------------------------------
$Loaded =& Link_Get('System', 'array');
#-----------------------------------------------------------------------------
foreach ($Paths as $Path) {
#---------------------------------------------------------------------------
if (System_IsLoaded($Path)) {
continue;
}
#---------------------------------------------------------------------------
$Loaded[] = $Path;
#---------------------------------------------------------------------------
$Path = System_Element(SPrintF('system/%s', $Path));
if (Is_Error($Path)) {
return ERROR | @Trigger_Error('[System_Load]: включение не найдено');
}
#---------------------------------------------------------------------------
if (Is_Error(Load($Path))) {
return ERROR | @Trigger_Error('[System_Load]: не удалось загрузить включение');
}
#---------------------------------------------------------------------------
Debug(SPrintF('[System_Load]: компонент системы (%s) был загружен', $Path));
}
}
示例2: _AddCLEditor
private function _AddCLEditor($Sender)
{
// Turn off safestyles so the inline styles get applied to comments
$Config = Gdn::Factory(Gdn::AliasConfig);
$Config->Set('Garden.Html.SafeStyles', FALSE);
// Add the CLEditor to the form
$Options = array('ie' => 'gt IE 6', 'notie' => TRUE);
// Exclude IE6
$Sender->RemoveJsFile('jquery.autogrow.js');
$Sender->AddJsFile('jquery.cleditor' . (Debug() ? '' : '.min') . '.js', 'plugins/cleditor', $Options);
$Sender->AddCssFile('jquery.cleditor.css', 'plugins/cleditor', $Options);
$Sender->Head->AddString('
<style type="text/css">
a.PreviewButton {
display: none !important;
}
</style>
<script type="text/javascript">
jQuery(document).ready(function($) {
// Make sure the removal of autogrow does not break anything
jQuery.fn.autogrow = function(o) { return; }
// Attach the editor to comment boxes
jQuery("#Form_Body").livequery(function() {
var frm = $(this).parents("div.CommentForm");
ed = jQuery(this).cleditor({width:"100%", height:"100%"})[0];
this.editor = ed; // Support other plugins!
jQuery(frm).bind("clearCommentForm", {editor:ed}, function(e) {
frm.find("textarea").hide();
e.data.editor.clear();
});
});
});
</script>');
}
示例3: getByURL
public function getByURL(string $url_string) : Url
{
$this->cache_name .= str_replace('/', ':', $url_string);
$serialized = get_instance()->cache->file->get($this->cache_name);
if ($serialized != FALSE) {
$url = unserialize($serialized);
debug($url, '$url from cache');
if ($url instanceof Url) {
return $url;
}
}
$this->db->group_start();
$this->db->where('short_url', $url_string)->or_where('long_url', $url_string);
$this->db->group_end();
$query = $this->db->get();
if ($query != FALSE) {
$result = $query->custom_result_object('Model\\Data\\Urls\\Url');
Debug($result, '$result');
if (isset($result[0])) {
$saveCache = get_instance()->cache->file->save($this->cache_name, serialize($result[0]), 3600);
return $result[0];
}
return new Url();
} else {
throw new \Exception('404 - URL Not Found!');
}
}
示例4: base_afterBody_handler
/**
* Add Debugger info to every page.
*
* @param $Sender
*/
public function base_afterBody_handler($Sender)
{
$Session = Gdn::session();
if (!Debug() && !$Session->checkPermission('Plugins.Debugger.View')) {
return;
}
require $Sender->fetchViewLocation('Debug', '', 'plugins/Debugger');
}
示例5: dbLog
function dbLog($sql, $update = false)
{
global $dbLogLevel;
$noExecute = $update && $dbLogLevel >= DB_LOG_DEBUG;
if ($dbLogLevel > DB_LOG_OFF) {
Debug("SQL-LOG: {$sql}" . ($noExecute ? " (not executed)" : ""));
}
return $noExecute;
}
示例6: getParams
public function getParams()
{
Debug(print_r($this->params, true));
$Service = DB_Select('Services', array('ID', 'Code', 'Name', 'NameShort'), array('UNIQ', 'ID' => $this->params['ServiceID']));
if (!Is_Array($Service)) {
return ERROR | @Trigger_Error(500);
}
$this->params['Service'] = $Service;
return $this->params;
}
示例7: base_afterRenderAsset_handler
/**
* Add Debugger info to dashboard after content asset.
*
* @param $sender
* @param $args
*/
public function base_afterRenderAsset_handler($sender, $args)
{
if (val('AssetName', $args) == 'Content' && $sender->MasterView == 'admin') {
$session = Gdn::session();
if (!Debug() || !$session->checkPermission('Plugins.Debugger.View')) {
return;
}
require $sender->fetchViewLocation('Debug', '', 'plugins/Debugger');
}
}
示例8: respond
private function respond()
{
if ($this->responded == false) {
$this->output->set_content_type('application/json');
$this->output->set_output($this->response);
Debug($this->response, '$this->response');
$this->responded = true;
}
return $this->responded;
}
示例9: DB_Insert
/**
* DB_Insert
* -------------------------
**/
public function DB_Insert()
{
$F = ['type', 'time', 'send_date', 'email', 'status', 'error', 'bounce', 'jobid', 'domain', 'ip', 'longip', 'server'];
if (!empty($this->V)) {
$this->DB->PUT('LOGS.logs.pmta_' . strtoupper(hostname), $F, $this->V, 'DELAYED');
file_put_contents(LOGS . 'apps/logger/db_insert.log', Debug($this->DB));
$this->V = [];
$this->i = 0;
}
}
示例10: parse
/**
* Parsing view content
*
* @param string $source
*
* @return mixed
*/
public function parse($source)
{
$this->resetParser();
preg_match_all($this->ionize_pattern, $source, $matches);
Debug($matches, '$matches');
require_once "Tag.php";
foreach ($matches[0] as $index => $src) {
$sourceCompiled = FALSE;
Debug($src, '$source');
// If the tag is a closing tag then close the parent
if (strpos($src, '</') !== FALSE) {
$parent = $this->getParent();
if ($parent != NULL) {
$this->compile[] = [$src => $parent->getNativeCodeClosing()];
$sourceCompiled = TRUE;
}
$this->closeParent();
}
// Creating the tag from the source
if ($sourceCompiled == FALSE) {
$parent = $this->getParent();
//Debug($parent, '$parent');
$tag = new Tag($src, $parent);
//Debug($tag, '$tag');
$this->compile[] = [$src => $tag->getNativeCodeOpening()];
$this->tags[] = $tag;
$this->openParent();
}
// If the tag closed in one line then close the parent
if (strpos($src, '/>') !== FALSE) {
$parent = $this->getParent();
if ($parent != NULL) {
$closingCode = $parent->getNativeCodeClosing();
if (!empty($closingCode)) {
$this->compile[] = [$src => $closingCode];
}
}
$this->closeParent();
}
}
Debug('Compiler contents:');
$parsed = $source;
foreach ($this->compile as $index => $task) {
$sourceCode = key($task);
Debug($sourceCode, '$sourceCode');
$nativeCode = $task[$sourceCode];
Debug($nativeCode, '$nativeCode');
$preg_search = '/' . preg_quote($sourceCode, '/') . '/im';
Debug($preg_search, '$preg_search');
$parsed = preg_replace($preg_search, $nativeCode, $parsed, 1);
}
//$parsed = str_replace(array_keys($this->compile), array_values($this->compile), $source);
Debug($parsed, '$parsed');
return $parsed;
}
示例11: __construct
/**
* Constructor.
*
* @param <type> $CodeID
* @param <type> $String
* @param <type> $Parent
* @return <type>
*/
function __construct($CodeID, $String, $Parent = NULL)
{
$__args_types = array('string', 'string', 'NULL,object');
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
Debug(SPrintF('[Exception]: [%s]=(%s)', $CodeID, $String));
$this->CodeID = $CodeID;
$this->String = $String;
$this->Parent = $Parent;
return $this;
}
示例12: get
public function get($key)
{
// Check args.
$__args_types = array('string');
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
$result = apc_fetch($key);
if (!$result) {
Debug(SPrintF('[APCCache::get]: не удалось извлечь объект [key=%s]', $key));
}
return $result;
}
示例13: getOutput
function getOutput()
{
/*
foreach($this->xml->channel->item as $item)
{
Debug($item);
}
*/
for ($i = 0; $i < sizeof($this->articles); $i++) {
Debug($this->articles[$i], $i);
}
}
示例14: __construct
public function __construct($attributes = NULL, $parent = NULL)
{
$ionize = \Ionize::getInstance();
Debug($ionize, '$ionize');
if (count($ionize->contents) > 0) {
$this->output = TRUE;
}
foreach ($ionize->contents as $content) {
$this->addItem(new Article($content));
}
Info(get_class() . ' Initialized');
}
示例15: DNSmanager4_Get_Users
function DNSmanager4_Get_Users($Settings)
{
/******************************************************************************/
$__args_types = array('array');
#-------------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/******************************************************************************/
$authinfo = SPrintF('%s:%s', $Settings['Login'], $Settings['Password']);
#-------------------------------------------------------------------------------
$HTTP = array('Address' => $Settings['Address'], 'Port' => $Settings['Port'], 'Host' => $Settings['Address'], 'Protocol' => $Settings['Protocol'], 'Hidden' => $authinfo, 'IsLogging' => $Settings['Params']['IsLogging']);
#-------------------------------------------------------------------------------
$Response = HTTP_Send('/manager/dnsmgr', $HTTP, array(), array('authinfo' => $authinfo, 'out' => 'xml', 'func' => 'user'));
if (Is_Error($Response)) {
return new gException('NOT_CONNECTED_TO_SERVER', 'Не удалось соедениться с сервером');
}
#-------------------------------------------------------------------------------
$Response = Trim($Response['Body']);
#-------------------------------------------------------------------------------
$XML = String_XML_Parse($Response);
if (Is_Exception($XML)) {
return new gException('WRONG_SERVER_ANSWER', $Response, $XML);
}
#-------------------------------------------------------------------------------
$XML = $XML->ToArray('elem');
#-------------------------------------------------------------------------------
$Users = $XML['doc'];
#-------------------------------------------------------------------------------
if (isset($Users['error'])) {
return new gException('GET_USERS_ERROR', $Users['error']);
}
#-------------------------------------------------------------------------------
Debug(SprintF('[system/libs/DNSmanager4.php]: Users = %s', print_r($Users, true)));
$Result = array();
#-------------------------------------------------------------------------------
foreach ($Users as $User) {
#-------------------------------------------------------------------------------
if (!isset($User['name'])) {
continue;
}
#-------------------------------------------------------------------------------
#if(!IsSet($User['owner']))
# continue;
#-------------------------------------------------------------------------------
#if($User['owner'] == $Settings['Login'])
$Result[] = $User;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
return $Result;
#-------------------------------------------------------------------------------
}