本文整理汇总了PHP中DevblocksPlatform::start_memory方法的典型用法代码示例。如果您正苦于以下问题:PHP DevblocksPlatform::start_memory方法的具体用法?PHP DevblocksPlatform::start_memory怎么用?PHP DevblocksPlatform::start_memory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevblocksPlatform
的用法示例。
在下文中一共展示了DevblocksPlatform::start_memory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initializes the plugin platform (paths, etc).
*
* @static
* @return void
*/
static function init()
{
self::$start_time = microtime(true);
if (function_exists('memory_get_usage') && function_exists('memory_get_peak_usage')) {
self::$start_memory = memory_get_usage();
self::$start_peak_memory = memory_get_peak_usage();
}
// [JAS]: [TODO] Do we need an explicit init() call?
// [JAS] [MDF]: Automatically determine the relative webpath to Devblocks files
if (!defined('DEVBLOCKS_WEBPATH')) {
$php_self = $_SERVER["PHP_SELF"];
@($proxyhost = $_SERVER['HTTP_DEVBLOCKSPROXYHOST']);
@($proxybase = $_SERVER['HTTP_DEVBLOCKSPROXYBASE']);
if (!empty($proxybase)) {
$php_self = $proxybase . '/';
} elseif (DEVBLOCKS_REWRITE) {
$pos = strrpos($php_self, '/');
$php_self = substr($php_self, 0, $pos) . '/';
} else {
$pos = strrpos($php_self, 'index.php');
if (false === $pos) {
$pos = strrpos($php_self, 'ajax.php');
}
$php_self = substr($php_self, 0, $pos);
}
@define('DEVBLOCKS_WEBPATH', $php_self);
}
}
示例2: init
/**
* Initializes the plugin platform (paths, etc).
*
* @static
* @return void
*/
static function init()
{
self::$start_time = microtime(true);
if (function_exists('memory_get_usage') && function_exists('memory_get_peak_usage')) {
self::$start_memory = memory_get_usage();
self::$start_peak_memory = memory_get_peak_usage();
}
// Encoding (mbstring)
mb_internal_encoding(LANG_CHARSET_CODE);
// [JAS] [MDF]: Automatically determine the relative webpath to Devblocks files
@($proxyhost = $_SERVER['HTTP_DEVBLOCKSPROXYHOST']);
@($proxybase = $_SERVER['HTTP_DEVBLOCKSPROXYBASE']);
// App path (always backend)
$app_self = $_SERVER["SCRIPT_NAME"];
if (DEVBLOCKS_REWRITE) {
$pos = strrpos($app_self, '/');
$app_self = substr($app_self, 0, $pos) . '/';
} else {
$pos = strrpos($app_self, 'index.php');
if (false === $pos) {
$pos = strrpos($app_self, 'ajax.php');
}
$app_self = substr($app_self, 0, $pos);
}
// Context path (abstracted: proxies or backend)
if (!empty($proxybase)) {
// proxy
$context_self = $proxybase . '/';
} else {
// non-proxy
$context_self = $app_self;
}
@define('DEVBLOCKS_WEBPATH', $context_self);
@define('DEVBLOCKS_APP_WEBPATH', $app_self);
// Register shutdown function
register_shutdown_function(array('DevblocksPlatform', 'shutdown'));
}