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


PHP debugLog函数代码示例

本文整理汇总了PHP中debugLog函数的典型用法代码示例。如果您正苦于以下问题:PHP debugLog函数的具体用法?PHP debugLog怎么用?PHP debugLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: ErrorLogFunction

function ErrorLogFunction($errno, $errstr, $errfile, $errline)
{
    //echo "<b>Custom error:</b> [$errno] $errstr<br />";
    //echo " Error on line $errline in $errfile<br />";
    //debugLog('errorLog\\'.date("Ymd").'.log', date("Y-m-d H:i:s"). '  '.$errno. ' : '.$errstr.' on line '.$errline.' in '.$errfile . "\n");
    debugLog('errorLog/' . date("Ymd") . '.log', date("Y-m-d H:i:s") . '  ' . $errno . ' : ' . $errstr . ' on line ' . $errline . ' in ' . $errfile . "\n");
}
开发者ID:heshuai64,项目名称:ebo,代码行数:7,代码来源:service.php

示例2: _saveFolderData

function _saveFolderData($devid, $folders)
{
    if (!is_array($folders) || empty($folders)) {
        return false;
    }
    $unique_folders = array();
    foreach ($folders as $folder) {
        if (!isset($folder->type)) {
            continue;
        }
        // don't save folder-ids for emails
        if ($folder->type == SYNC_FOLDER_TYPE_INBOX) {
            continue;
        }
        // no folder from that type    or the default folder
        if (!array_key_exists($folder->type, $unique_folders) || $folder->parentid == 0) {
            $unique_folders[$folder->type] = $folder->serverid;
        }
    }
    // Treo does initial sync for calendar and contacts too, so we need to fake
    // these folders if they are not supported by the backend
    if (!array_key_exists(SYNC_FOLDER_TYPE_APPOINTMENT, $unique_folders)) {
        $unique_folders[SYNC_FOLDER_TYPE_APPOINTMENT] = SYNC_FOLDER_TYPE_DUMMY;
    }
    if (!array_key_exists(SYNC_FOLDER_TYPE_CONTACT, $unique_folders)) {
        $unique_folders[SYNC_FOLDER_TYPE_CONTACT] = SYNC_FOLDER_TYPE_DUMMY;
    }
    if (!file_put_contents(BASE_PATH . STATE_DIR . "/compat-{$devid}", serialize($unique_folders))) {
        debugLog("_saveFolderData: Data could not be saved!");
    }
}
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:31,代码来源:utils.php

示例3: readFeed

function readFeed($location, $cacheLife, $cacheDir, $proxy)
{
    $cachePrefix = 'pmgallery_';
    $cacheDir = empty($cacheDir) ? dirname(__FILE__) . '/cache' : $cacheDir;
    $cache = $cacheDir . '/' . $cachePrefix . md5($location);
    // clean out old cache files
    cleanDir($cacheDir, $cachePrefix . '*', $cacheLife);
    //First check for an existing version of the time, and then check to see whether or not it's expired.
    if (!empty($cacheLife) && file_exists($cache) && filesize($cache) > 0 && filemtime($cache) > time() - $cacheLife) {
        debugLog('cached...: ' . $cache);
        //If there's a valid cache file, load its data.
        $feedXml = file_get_contents($cache);
    } else {
        debugLog('NOT cached...');
        //If there's no valid cache file, grab a live version of the data and save it to a temporary file.
        //Once the file is complete, copy it to a permanent file.  (This prevents concurrency issues.)
        //TODO: Error handling -- unable to open stream
        $ctx = stream_context_create(array('http' => array('proxy' => $proxy, 'request_fulluri' => true)));
        debugLog('Location: ' . $location);
        $feedXml = file_get_contents($location, false, $ctx);
        $tempName = tempnam($cacheDir, 't_' . $cachePrefix);
        // prefix with t_ to prevent other processes deleting
        file_put_contents($tempName, $feedXml);
        if (copy($tempName, $cache)) {
            // copy forces overwrite if file is past cachelife
            unlink($tempName);
        }
    }
    return $feedXml;
}
开发者ID:Nepherim,项目名称:PmGallery,代码行数:30,代码来源:feeder.php

示例4: ImportMessageChange

 function ImportMessageChange($id, $message)
 {
     if (strtolower(get_class($message)) != $this->_type) {
         return true;
     }
     // ignore other types
     // prevent sending the same object twice in one request
     if (in_array($id, $this->_seenObjects)) {
         debugLog("Object {$id} discarded! Object already sent in this request.");
         return true;
     }
     $this->_seenObjects[] = $id;
     if ($message->flags === false || $message->flags === SYNC_NEWMESSAGE) {
         $this->_encoder->startTag(SYNC_ADD);
     } else {
         $this->_encoder->startTag(SYNC_MODIFY);
     }
     $this->_encoder->startTag(SYNC_SERVERENTRYID);
     $this->_encoder->content($id);
     $this->_encoder->endTag();
     $this->_encoder->startTag(SYNC_DATA);
     $message->encode($this->_encoder);
     $this->_encoder->endTag();
     $this->_encoder->endTag();
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:26,代码来源:streamimporter.php

示例5: sanitize

function sanitize($post)
{
    foreach ($post as $key => $val) {
        $post[$key] = strip_tags($val);
    }
    debugLog("Sanitized POST: " . print_r($post, 1));
    return $post;
}
开发者ID:plaihonen,项目名称:tasker,代码行数:8,代码来源:auth.http.php

示例6: zarafa_error_handler

function zarafa_error_handler($errno, $errstr, $errfile, $errline, $errcontext)
{
    $bt = debug_backtrace();
    debugLog("------------------------- ERROR BACKTRACE -------------------------");
    debugLog("trace error: {$errfile}:{$errline} {$errstr} ({$errno}) - backtrace: " . (count($bt) - 1) . " steps");
    for ($i = 1, $bt_length = count($bt); $i < $bt_length; $i++) {
        debugLog("trace: {$i}:" . $bt[$i]['file'] . ":" . $bt[$i]['line'] . " - " . (isset($bt[$i]['class']) ? $bt[$i]['class'] . $bt[$i]['type'] : "") . $bt[$i]['function'] . "()");
    }
}
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:9,代码来源:debug.php

示例7: cacheImage_protected

/**
 * Provides an error protected cacheImage for PHP 5
 *
 */
function cacheImage_protected($newfilename, $imgfile, $args, $allow_watermark = false, $theme, $album)
{
    try {
        cacheImage($newfilename, $imgfile, $args, $allow_watermark, $theme, $album);
        return true;
    } catch (Exception $e) {
        debugLog('cacheImage(' . $newfilename . ') exception: ' . $e->getMessage());
        return false;
    }
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:14,代码来源:_functions-image.php

示例8: dbgprintf_wrapout

function dbgprintf_wrapout($string, $html)
{
    if (!CITADEL_DEBUG_HTML) {
        if ($html) {
            debugLog("<< " . $string . "\n");
        }
    } else {
        printf($string);
    }
}
开发者ID:zcw159357,项目名称:citadel,代码行数:10,代码来源:ctdlprotocol.php

示例9: read_exif_data_protected

/**
 * Provides an [not] error protected read of image EXIF/IPTC data for PHP 4
 *
 * @param string $path image path
 * @return array
 */
function read_exif_data_protected($path)
{
    if (DEBUG_EXIF) {
        debugLog("Begin read_exif_data_protected({$path})");
    }
    $rslt = read_exif_data_raw($path, false);
    if (DEBUG_EXIF) {
        debugLog("End read_exif_data_protected({$path})");
    }
    return $rslt;
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:17,代码来源:_functions.php

示例10: __autoload

/**
 * 自动加载类文件
 *
 * @return void
 */
function __autoload($class)
{
    // $class_file = ROOT_DIR.(strpos($class,'M_')===0?'model':'lib').'/class.' . $class . '.php';
    $class_file = ROOT_DIR . 'include/class.' . $class . '.php';
    if (class_exists($class_file, false)) {
        return;
    } elseif (!is_readable($class_file)) {
        debugLog("unable to read class file " . $class, debug_backtrace());
        throw new Exception("unable to read class file ");
    } else {
        include $class_file;
    }
}
开发者ID:iorichina,项目名称:geo,代码行数:18,代码来源:func.Global.php

示例11: ImportFolderChange

 function ImportFolderChange($folder)
 {
     // The HierarchyExporter exports all kinds of changes.
     // Frequently these changes are not relevant for the mobiles,
     // as something changes but the relevant displayname and parentid
     // stay the same. These changes will be dropped and not sent
     if (is_array($this->foldercache) && array_key_exists($folder->serverid, $this->foldercache) && $this->foldercache[$folder->serverid]->displayname == $folder->displayname && $this->foldercache[$folder->serverid]->parentid == $folder->parentid && $this->foldercache[$folder->serverid]->type == $folder->type) {
         debugLog("Change for folder '" . $folder->displayname . "' will not be sent as modification is not relevant");
         return true;
     }
     array_push($this->changed, $folder);
     $this->count++;
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:14,代码来源:memimporter.php

示例12: regionInfo

 /**
  * 获取并设置区域信息   	
  */
 protected function regionInfo()
 {
     if (empty($key)) {
         // 采用行政区域参数
         if (!empty($_GET['region'])) {
             $_region = Tools::convertToUtf8(urldecode($_GET['region']));
             $city = explode('市', $_region);
             if (!empty($city[0])) {
                 $key = explode('省', $city[0]);
             } else {
                 $key = $_region;
             }
         } elseif (!empty($_GET['area'])) {
             $_area = Tools::convertToUtf8(urldecode($_GET['area']));
             $key = explode(',', $_area);
         } elseif (!empty($_GET['prov']) || !empty($_GET['city'])) {
             $key[] = Tools::convertToUtf8(trim($_GET['prov']));
             // 关键词——2
             $key[] = empty($_GET['city']) ? '' : Tools::convertToUtf8(trim($_GET['city']));
             // 关键词2——2
         }
         // 采用ip参数
         if (empty($key[1]) && empty($key[0])) {
             if (!empty($_GET['geoip'])) {
                 $ip = trim($_GET['geoip']);
             } else {
                 $ip = !empty($_COOKIE['geoip']) ? trim($_COOKIE['geoip']) : '';
             }
             preg_match('/[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}/', $ip, $matches);
             $ip = $matches[0];
             $key = !$ip ? null : GeoTool::getAreaNameByIp($ip);
         }
     }
     // 市
     if (empty($key[1])) {
         // $key [1] = $key [0];
         // unset ( $key [0] );
     } else {
         $this->region['city'] = Tools::convertToUtf8($key[1]);
     }
     // 省
     if (empty($key[0])) {
         // unset ( $key [0] );
     } else {
         $this->region['prov'] = Tools::convertToUtf8($key[0]);
     }
     debugLog(__CLASS__ . ':region', $this->region);
 }
开发者ID:iorichina,项目名称:geo,代码行数:51,代码来源:app.ApiRegion.php

示例13: invokeRoute

 /**
  * Decides what to do with the current url setup
  *
  * @version 1.0
  * @since   1.0.0
  * @author  Dan Aldridge
  * 
  * @return  void
  */
 public function invokeRoute()
 {
     // Get instanced
     $objRoute = Core_Classes_coreObj::getRoute();
     $module = $this->module;
     $this->module = 'Admin_Modules_' . $this->module;
     // if defaults are being loaded for the core acp panel, then we want dashboard not index
     if ($this->action == 'index' && $module == 'core') {
         $this->action = 'dashboard';
     }
     // if nothing is selected, index all the way
     if (is_empty($this->action)) {
         $this->action = 'index';
     }
     $action = array($this->action);
     if (strpos($this->action, '/') !== false) {
         $action = explode('/', $this->action);
     }
     $panels = cmsROOT . 'modules/%s/panels/';
     $panels = sprintf($panels, $module);
     // check if we are dealing with the sub panels or not
     if (file_exists($panels) && is_readable($panels) && count(glob($panels . 'panel.*.php'))) {
         // we are !
         $method = array_shift($action);
         if (!isset($action[0]) || is_empty($action[0])) {
             $action[0] = $method;
         }
         $args = array('method' => $method, 'args' => $action);
         // check the panel to see if it exists, if so include it
         $path = sprintf($panels, $module) . 'panel.' . $args['method'] . '.php';
         if (file_exists($path) && is_readable($path)) {
             require_once $path;
             DEBUG ? debugLog($path, 'invokeRoute(): Loaded sub panel... ') : '';
         } else {
             trigger_error('Error: Could not load ACP Panel: ' . $path);
         }
         // then call to it like normal :D
         $method = reflectMethod($this->module . '_' . $args['method'], $args['args'][0], $args);
     } else {
         $method = reflectMethod($this->module, array_shift($action), $action);
     }
     if ($method === false) {
         $objRoute->throwHTTP(404);
     }
 }
开发者ID:richard-clifford,项目名称:CSCMS,代码行数:54,代码来源:class.admincp.php

示例14: stop

function stop($queue_name)
{
    debugLog('stop now ..');
    $pidfile = APP . "log/monitor/{$queue_name}.pid";
    if (file_exists($pidfile)) {
        $pid = file_get_contents($pidfile);
        if ($pid && posix_kill($pid, 0)) {
            $ret = posix_kill($pid, SIGTERM);
            if ($ret) {
                debugLog("Send stop signal to process {$pid} success");
                pcntl_waitpid($pid, $status);
                debugLog("process {$pid} is stop");
                file_put_contents($pidfile, "0");
            } else {
                debugLog("Send stop signal to {$pid} faild");
            }
        }
    }
}
开发者ID:xjlelf,项目名称:php_test,代码行数:19,代码来源:monitor.php

示例15: zarafa_error_handler

function zarafa_error_handler($errno, $errstr, $errfile, $errline, $errcontext)
{
    $bt = debug_backtrace();
    switch ($errno) {
        case 8192:
            // E_DEPRECATED since PHP 5.3.0
            // do not handle this message
            break;
        case E_NOTICE:
        case E_WARNING:
            debugLog("{$errfile}:{$errline} {$errstr} ({$errno})");
            break;
        default:
            debugLog("------------------------- ERROR BACKTRACE -------------------------");
            debugLog("trace error: {$errfile}:{$errline} {$errstr} ({$errno}) - backtrace: " . (count($bt) - 1) . " steps");
            for ($i = 1, $bt_length = count($bt); $i < $bt_length; $i++) {
                debugLog("trace: {$i}:" . $bt[$i]['file'] . ":" . $bt[$i]['line'] . " - " . (isset($bt[$i]['class']) ? $bt[$i]['class'] . $bt[$i]['type'] : "") . $bt[$i]['function'] . "()");
            }
            break;
    }
}
开发者ID:BackupTheBerlios,项目名称:z-push-svn,代码行数:21,代码来源:debug.php


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