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


PHP Console::logMemory方法代码示例

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


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

示例1: sampleMemoryLeak

    public function sampleMemoryLeak()
    {
        $ret = '';
        $longString = 'This is a really long string that when appended with the . symbol 
					  will cause memory to be duplicated in order to create the new string.';
        for ($i = 0; $i < 10; $i++) {
            $ret = $ret . $longString;
            Console::logMemory($ret, 'Watch memory leak -- iteration ' . $i);
        }
    }
开发者ID:ashutoshdev,项目名称:Open-Web-Analytics,代码行数:10,代码来源:index.php

示例2: def_list

 /**
  * Define the list
  * @public
  */
 function def_list()
 {
     Console::log('FormHandler -> def_list');
     Console::logMemory($this, 'FormHandler -> def_list : Line ' . __LINE__);
     Console::logSpeed('FormHandler -> def_list : Line ' . __LINE__);
     $this->tablelist['status_list']["1"] = array(gettext("INSERTED"), "1");
     $this->tablelist['status_list']["2"] = array(gettext("ENABLE"), "2");
     $this->tablelist['status_list']["3"] = array(gettext("DISABLE"), "3");
     $this->tablelist['status_list']["4"] = array(gettext("FREE"), "4");
 }
开发者ID:hellbound,项目名称:a2billing-mod,代码行数:14,代码来源:Class.FormHandler.inc.php

示例3: __construct

 public function __construct()
 {
     $this->profiler = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime());
     Console::logMemory();
 }
开发者ID:rtownsend,项目名称:pitchfork,代码行数:5,代码来源:particletree-class-profile.php

示例4: PKPApplication

 function PKPApplication()
 {
     // Configure error reporting
     // FIXME: Error logging needs to be suppressed for strict
     // and deprecation errors in PHP5 as long as we support PHP 4.
     // This is primarily for static method warnings and warnings
     // about use of ... =& new ... Static class members cannot be
     // declared in PHP4 and ... =& new ... is deprecated since PHP 5.
     $errorReportingLevel = E_ALL;
     if (defined('E_STRICT')) {
         $errorReportingLevel &= ~E_STRICT;
     }
     if (defined('E_DEPRECATED')) {
         $errorReportingLevel &= ~E_DEPRECATED;
     }
     @error_reporting($errorReportingLevel);
     // Instantiate the profiler
     import('lib.pkp.classes.core.PKPProfiler');
     $pkpProfiler = new PKPProfiler();
     // Begin debug logging
     Console::logMemory('', 'PKPApplication::construct');
     Console::logSpeed('PKPApplication::construct');
     // Seed random number generator
     mt_srand((double) microtime() * 1000000);
     import('lib.pkp.classes.core.Core');
     import('lib.pkp.classes.core.String');
     import('lib.pkp.classes.core.Registry');
     import('lib.pkp.classes.config.Config');
     if (Config::getVar('debug', 'display_errors')) {
         // Try to switch off normal error display when error display
         // is being managed by OJS.
         @ini_set('display_errors', false);
     }
     if (Config::getVar('debug', 'deprecation_warnings')) {
         // Switch deprecation warnings back on. This can only be done
         // after declaring the Config class as we need access to the
         // configuration and we cannot declare the Config class before
         // we've switched of deprecation warnings as its declaration
         // causes warnings itself.
         // FIXME: When we drop PHP4 support and can declare static methods
         // as such then we can also include E_STRICT/E_DEPRECATED here as
         // nearly all strict/deprecated warnings concern PHP4 support.
         @error_reporting($errorReportingLevel);
     }
     Registry::set('application', $this);
     import('lib.pkp.classes.db.DAORegistry');
     import('lib.pkp.classes.db.XMLDAO');
     import('lib.pkp.classes.cache.CacheManager');
     import('classes.security.Validation');
     import('lib.pkp.classes.session.SessionManager');
     import('classes.template.TemplateManager');
     import('lib.pkp.classes.plugins.PluginRegistry');
     import('lib.pkp.classes.plugins.HookRegistry');
     import('classes.i18n.AppLocale');
     String::init();
     set_error_handler(array($this, 'errorHandler'));
     $microTime = Core::microtime();
     Registry::set('system.debug.startTime', $microTime);
     $notes = array();
     Registry::set('system.debug.notes', $notes);
     Registry::set('system.debug.profiler', $pkpProfiler);
     if (Config::getVar('general', 'installed')) {
         // Initialize database connection
         $conn =& DBConnection::getInstance();
         if (!$conn->isConnected()) {
             if (Config::getVar('database', 'debug')) {
                 $dbconn =& $conn->getDBConn();
                 fatalError('Database connection failed: ' . $dbconn->errorMsg());
             } else {
                 fatalError('Database connection failed!');
             }
         }
     }
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:74,代码来源:PKPApplication.inc.php

示例5: profile

 public static function profile($that = '', $function = '', $line = '', $msg = '')
 {
     if (defined('OWA_PROFILER')) {
         if (OWA_PROFILER === true) {
             static $profiler;
             if (!class_exists('PhpQuickProfiler')) {
                 require_once OWA_INCLUDE_DIR . 'pqp/classes/PhpQuickProfiler.php';
             }
             if (empty($profiler)) {
                 $profiler = new PhpQuickProfiler(PhpQuickProfiler::getMicroTime(), OWA_INCLUDE_DIR . 'pqp/');
             }
             $class = get_class($that);
             Console::logSpeed($class . "::{$function} - Line: {$line} - Msg: {$msg}");
             Console::logMemory($that, $class . "::{$function} - Line: {$line}");
             return $profiler;
         }
     }
 }
开发者ID:ashutoshdev,项目名称:Open-Web-Analytics,代码行数:18,代码来源:owa_coreAPI.php

示例6: pqp_post_controller

 static function pqp_post_controller()
 {
     Console::logMemory(FALSE, 'CI POST CONTROLLER');
     Console::logSpeed('CI POST CONTROLLER');
 }
开发者ID:intekhabrizvi,项目名称:php-mongo-quick-profiler-for-codeigniter,代码行数:5,代码来源:pqp_pi.php

示例7: wpdt_widget_title

 function wpdt_widget_title($content)
 {
     Console::log($content, 'widget_title');
     Console::logMemory();
     Console::logSpeed();
     return $content;
 }
开发者ID:netconstructor,项目名称:wp-developer-tools,代码行数:7,代码来源:wp-developer-tools.php

示例8: ShowAlliancePage


//.........这里部分代码省略.........
                 $db->query("UPDATE {{table}} SET\r\n\t\t\t\t\t`ally_id`='{$allyquery['id']}',\r\n\t\t\t\t\t`ally_name`='{$allyquery['ally_name']}',\r\n\t\t\t\t\t`ally_register_time`='" . time() . "'\r\n\t\t\t\t\tWHERE `id`='{$CurrentUser['id']}'", "users");
                 $displays->message("Alianza creada");
             } else {
                 $displays->newblock("fundar");
             }
             $displays->display();
         }
         //BUSCAR ALIANZA
         if ($mode == 'search' && $CurrentUser['ally_request'] == 0) {
             //$page = parsetemplate(gettemplate('alliance/alliance_searchform'), $parse);
             $displays->newblock("buscar");
             if ($_POST) {
                 $search = $db->query("SELECT * FROM {{table}} WHERE ally_name LIKE '%{$_POST['searchtext']}%' or ally_tag LIKE '%{$_POST['searchtext']}%' LIMIT 30", "alliance");
                 if (mysql_num_rows($search) != 0) {
                     $displays->newblock("buscar_encontrar");
                     while ($s = mysql_fetch_array($search)) {
                         $displays->newblock("buscar_encontrado");
                         $displays->assign('ally_tag', "<a href=\"game.php?page=alliance&mode=apply&allyid={$s['id']}\">{$s['ally_tag']}</a>");
                         $displays->assign('ally_name', $s['ally_name']);
                         $displays->assign('ally_members', $s['ally_members']);
                     }
                 }
             }
             $displays->display();
         }
         if ($mode == 'apply' && $CurrentUser['ally_request'] == 0) {
             //SOLICITUDES
             if (!is_numeric($_GET['allyid']) || !$_GET['allyid'] || $CurrentUser['ally_request'] != 0 || $CurrentUser['ally_id'] != 0) {
                 header("location:game." . $phpEx . "?page=alliance", 2);
             }
             $allyrow = $db->query("SELECT ally_tag,ally_request,ally_request_notallow FROM {{table}} WHERE id='" . intval($_GET['allyid']) . "'", "alliance", true);
             $allyrow['ally_request_notallow'] == 1 ? $displays->message($lang['al_alliance_closed'], "game.php?page=alliance", 2) : "";
             !$allyrow ? header("location:game." . $phpEx . "?page=alliance", 2) : "";
             Console::logMemory();
             extract($allyrow);
             Console::logMemory();
             if ($_POST['enviar'] == $lang['al_applyform_send']) {
                 $db->query("UPDATE {{table}} SET\r\n\t\t\t\t\t\t\t`ally_request`='" . intval($allyid) . "',\r\n\t\t\t\t\t\t\tally_request_text='" . mysql_escape_string(strip_tags($_POST['text'])) . "',\r\n\t\t\t\t\t\t\tally_register_time='" . time() . "' WHERE `id`='" . $CurrentUser['id'] . "'", "users");
                 $displays->message($lang['al_request_confirmation_message']);
             } else {
                 $displays->newblock("solicitud");
                 $text_apply = $ally_request ? $ally_request : $lang['al_default_request_text'];
                 $lang['allyid'] = intval($_GET['allyid']);
                 $lang['chars_count'] = strlen($text_apply);
                 $lang['text_apply'] = $text_apply;
                 $lang['Write_to_alliance'] = str_replace('%s', $ally_tag, $lang['al_write_request']);
             }
             $displays->display();
         }
         if ($CurrentUser['ally_request'] != 0) {
             $allyquery = $db->query("SELECT ally_tag FROM {{table}} WHERE id='" . intval($CurrentUser['ally_request']) . "' ORDER BY `id`", "alliance", true);
             extract($allyquery);
             $displays->newblock("esp_solicitud");
             if ($_POST['bcancel']) {
                 $db->query("UPDATE {{table}} SET `ally_request`=0 WHERE `id`=" . $CurrentUser['id'], "users");
                 $lang['request_text'] = str_replace('%s', $ally_tag, $lang['al_request_deleted']);
                 $lang['button_text'] = $lang['al_continue'];
             } else {
                 $lang['request_text'] = str_replace('%s', $ally_tag, $lang['al_request_wait_message']);
                 $lang['button_text'] = $lang['al_delete_request'];
             }
             $displays->display();
         } else {
             $displays->newblock("default");
             $displays->display();
         }
开发者ID:sonicmaster,项目名称:RPG,代码行数:67,代码来源:class.ShowAlliancePage.php

示例9: memory

 public static function memory($object = null, $name = 'PHP')
 {
     if (isset(self::$profiler)) {
         Console::logMemory($object, $name);
     }
 }
开发者ID:htmlgraphic,项目名称:HTMLgraphic-MVC,代码行数:6,代码来源:Debugger.class.inc.php


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