本文整理汇总了PHP中get_included_files函数的典型用法代码示例。如果您正苦于以下问题:PHP get_included_files函数的具体用法?PHP get_included_files怎么用?PHP get_included_files使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_included_files函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getResources
public function getResources()
{
if ($this->resources === null) {
$this->resources = array('Memory' => memory_get_usage(true) / 1024 . ' KB', 'Time' => $this->formatTime(microtime(true) - DebugBar::getInit()) . ' ms', 'Files' => count(get_included_files()));
}
return $this->resources;
}
开发者ID:rubn-g,项目名称:debugbar,代码行数:7,代码来源:ResourcesPanel.php
示例2: outputData
/**
* Outputs gathered data to make Profiler
*
* @return html?
*/
public function outputData()
{
// Check if profiler config file is present
if (\Config::get('profiler::profiler')) {
// Sort the view data alphabetically
ksort($this->view_data);
$this->time->totalTime();
$data = array('times' => $this->time->getTimes(), 'view_data' => $this->view_data, 'app_logs' => $this->logs, 'includedFiles' => get_included_files(), 'counts' => $this->getCounts(), 'assetPath' => __DIR__ . '/../../../public/');
// Check if SQL connection can be established
try {
$data['sql_log'] = \DB::getQueryLog();
} catch (\PDOException $exception) {
$data['sql_log'] = array();
}
// Check if btns.storage config option is set
if (\Config::get('profiler::btns.storage')) {
// get last 24 webserver log entries
$data['storageLogs'] = $this->getStorageLogs(24);
}
// Check if btns.config config option is set
if (\Config::get('profiler::btns.config')) {
// get all Laravel config options and store in array
$data['config'] = array_dot(\Config::getItems());
}
return \View::make('profiler::profiler.core', $data);
}
}
开发者ID:seantrane,项目名称:profiler,代码行数:32,代码来源:Profiler.php
示例3: gatherFiles
/**
* gather included files and its size.
*/
private function gatherFiles()
{
if (!array_key_exists('Files', $this->log_sections)) {
return;
}
$files = get_included_files();
$section_data_array = array();
$total_size = 0;
$largest_size = 0;
if (is_array($files)) {
foreach ($files as $file) {
$size = filesize($file);
$section_data_array[] = array('data' => $file, 'size' => $size);
$total_size = bcadd($total_size, $size);
if ($size > $largest_size) {
$largest_size = $size;
}
}
// endforeach;
unset($file, $size);
}
$section_data_array['total_size'] = $total_size;
$section_data_array['largest_size'] = $largest_size;
unset($largest_size, $total_size);
$this->log_sections['Files'] = $section_data_array;
unset($files, $section_data_array);
}
开发者ID:rundiz,项目名称:profiler,代码行数:30,代码来源:Profiler.php
示例4: save
/**
* 日志写入接口
* @access public
* @param array $log 日志信息
* @return void
*/
public function save($log = [])
{
$now = date($this->config['time_format']);
$destination = $this->config['path'] . date('y_m_d') . '.log';
!is_dir($this->config['path']) && mkdir($this->config['path'], 0755, true);
//检测日志文件大小,超过配置大小则备份日志文件重新生成
if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) {
rename($destination, dirname($destination) . DS . time() . '-' . basename($destination));
}
// 获取基本信息
if (isset($_SERVER['HTTP_HOST'])) {
$current_uri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
} else {
$current_uri = "cmd:" . implode(' ', $_SERVER['argv']);
}
$runtime = number_format(microtime(true) - START_TIME, 6);
$reqs = number_format(1 / $runtime, 2);
$time_str = " [运行时间:{$runtime}s] [吞吐率:{$reqs}req/s]";
$memory_use = number_format((memory_get_usage() - START_MEM) / 1024, 2);
$memory_str = " [内存消耗:{$memory_use}kb]";
$file_load = " [文件加载:" . count(get_included_files()) . "]";
array_unshift($log, ['type' => 'log', 'msg' => $current_uri . $time_str . $memory_str . $file_load]);
$info = '';
foreach ($log as $line) {
$info .= '[' . $line['type'] . '] ' . $line['msg'] . "\r\n";
}
error_log("[{$now}] {$_SERVER['SERVER_ADDR']} {$_SERVER['REMOTE_ADDR']} {$_SERVER['REQUEST_URI']}\r\n{$info}\r\n", 3, $destination);
}
开发者ID:cy520win,项目名称:cyweb,代码行数:34,代码来源:file.php
示例5: onShutdown
protected function onShutdown()
{
// TODO: Allow client to switch this off
$files = get_included_files();
// exclude our own files
$excluding = false;
for ($i = 0; $i < count($files); $i++) {
// TODO: Make this more reliable
if (preg_match("/\\/FirePHP\\//", $files[$i]) || preg_match("/\\/FirePHPCore\\//", $files[$i]) || preg_match("/\\/Insight\\//", $files[$i]) || preg_match("/\\/Wildfire\\//", $files[$i]) || preg_match("/\\/Zend\\//", $files[$i])) {
// potentially exclude
$exclude = false;
// start excluding when
if (preg_match("/\\/FirePHP\\/Init.php\$/", $files[$i])) {
$excluding = true;
} else {
// stop excluding after
if (preg_match("/\\/Wildfire\\/Protocol\\/Component.php\$/", $files[$i]) || -preg_match("/\\/Insight\\/Encoder\\/Default.php\$/", $files[$i]) || preg_match("/\\/Zend\\/Reflection\\/Class.php\$/", $files[$i]) || preg_match("/\\/Zend\\/Reflection\\/Property.php\$/", $files[$i]) || preg_match("/\\/Zend\\/Reflection\\/Method.php\$/", $files[$i]) || preg_match("/\\/Zend\\/Reflection\\/Docblock.php\$/", $files[$i]) || preg_match("/\\/Zend\\/Reflection\\/Docblock\\/Tag.php\$/", $files[$i]) || preg_match("/\\/Zend\\/Loader.php\$/", $files[$i]) || preg_match("/\\/Zend\\/Reflection\\/Parameter.php\$/", $files[$i])) {
$excluding = false;
$exclude = true;
} else {
// always exclude
if (preg_match("/\\/FirePHP\\//", $files[$i]) || preg_match("/\\/FirePHPCore\\//", $files[$i]) || preg_match("/\\/Insight\\//", $files[$i]) || preg_match("/\\/Wildfire\\//", $files[$i])) {
$exclude = true;
}
}
}
if ($excluding || $exclude) {
array_splice($files, $i, 1);
$i--;
}
}
}
Insight_Helper::to('request')->files()->loaded($files);
}
开发者ID:janym,项目名称:angular-yii,代码行数:34,代码来源:Files.php
示例6: testLoadingOnlyPhpFiles
public function testLoadingOnlyPhpFiles()
{
$this->builder->setSource($this->files->get($this, '/no-parents'));
$this->builder->setDestination($this->files->get($this, '/settings'));
$this->builder->build('default');
self::assertFalse(in_array($this->files->get($this, '/no-parents/default/ignored.file'), get_included_files()));
}
开发者ID:visor,项目名称:nano,代码行数:7,代码来源:BuilderTest.php
示例7: display
public function display()
{
$profiler = KFactory::get('com://admin/debug.profiler.events');
$database = KFactory::get('com://admin/debug.profiler.queries');
$language = KFactory::get('joomla:language');
//Remove the template includes
$includes = get_included_files();
foreach($includes as $key => $value)
{
if($value == 'tmpl://koowa.template.stack') {
unset($includes[$key]);
}
}
$this->assign('memory' , $profiler->getMemory())
->assign('events' , $profiler->getEvents())
->assign('queries' , $database->getQueries())
->assign('languages', $language->getPaths())
->assign('includes' , $includes)
->assign('strings' , $language->getOrphans());
return parent::display();
}
开发者ID:raeldc,项目名称:com_learn,代码行数:25,代码来源:html.php
示例8: checkJavaExtension
/**
* checkJavaExtension
* check if the java extension was loaded.
*
*
* @return true or false
*/
function checkJavaExtension()
{
try {
if (!extension_loaded('java')) {
if (!@(include_once "java/Java.inc")) {
$urlJavaInc = "http://{$this->JavaBridgeHost}:{$this->JavaBridgePort}/{$this->JavaBridgeDir}/java/Java.inc";
@(include_once $urlJavaInc);
$includedFiles = get_included_files();
$found = false;
foreach ($includedFiles as $filename) {
if ($urlJavaInc == $filename) {
$found = true;
}
}
if (!$found) {
throw new Exception('The PHP/Java Bridge is not defined');
}
}
return true;
}
if (!function_exists("java_get_server_name")) {
throw new Exception('The loaded java extension is not the PHP/Java Bridge');
}
return true;
} catch (Exception $e) {
throw new Exception('Error in checkJavaExtension: ' . $e->getMessage());
}
}
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:35,代码来源:class.javaBridgePM.php
示例9: show
static function show()
{
$trace_tmp = self::$trace;
$files = get_included_files();
foreach ($files as $key => $file) {
$files[$key] = $file . ' ( ' . number_format(filesize($file) / 1024, 2) . ' KB )';
}
$cltime = T('POEM_TIME', -1);
$trace_tmp['SYS'] = array("请求信息" => $_SERVER['REQUEST_METHOD'] . ' ' . strip_tags($_SERVER['REQUEST_URI']) . ' ' . $_SERVER['SERVER_PROTOCOL'] . ' ' . date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']), "总吞吐量" => number_format(1 / $cltime, 2) . ' req/s', "总共时间" => number_format($cltime, 5) . ' s', "框架加载" => number_format($cltime - T('POEM_EXEC_TIME', -1), 5) . ' s (func:' . number_format(T('POEM_FUNC_TIME', -1) * 1000, 2) . 'ms conf:' . number_format(T('POEM_CONF_TIME', -1) * 1000, 2) . 'ms route:' . number_format(T('POEM_ROUTE_TIME', -1) * 1000, 2) . 'ms)', "App时间" => number_format(T('POEM_EXEC_TIME', -1), 5) . ' s (compile:' . number_format(T('POEM_COMPILE_TIME', -1) * 1000, 2) . ' ms)', "内存使用" => number_format(memory_get_usage() / 1024 / 1024, 5) . ' MB', '文件加载' => count($files), '会话信息' => 'SESSION_ID=' . session_id());
$trace_tmp['FILE'] = $files;
$arr = array('SYS' => '基本', 'FILE' => '文件', 'ERR' => '错误', 'SQL' => '数据库', 'DEBUG' => '调试');
foreach ($arr as $key => $value) {
$num = 50;
$len = 0;
if (is_array($trace_tmp[$key]) && ($len = count($trace_tmp[$key])) > $num) {
$trace_tmp[$key] = array_slice($trace_tmp[$key], 0, $num);
}
$trace[$value] = $trace_tmp[$key];
if ($len > $num) {
$trace[$value][] = "...... 共 {$len} 条";
}
}
$totalTime = number_format($cltime, 3);
include CORE_PATH . 'tpl/trace.php';
}
开发者ID:rehorn,项目名称:phppoem,代码行数:25,代码来源:log.php
示例10: load
/**
* Load plugin files
*
* @return boolean Always true.
*/
function load($all = false)
{
global $plugins, $set;
$files = glob(MAI_ROOT . "plugins/*_plugin.php");
// grab active plugins list
if (!is_array(unserialize($set->sinfo->active_plugins))) {
$set->sinfo->active_plugins = serialize(array());
}
foreach ($files as $file) {
// grab plugin name
$pname = substr(basename($file), 0, -11);
// require active plugins
if ($all == false) {
if (in_array($pname, unserialize($set->sinfo->active_plugins))) {
require_once $file;
}
} else {
if (!in_array(basename($file), array_map("basename", get_included_files()))) {
require_once $file;
}
}
}
if ($all) {
$this->hooks = array();
}
// we don't execute on plugin manager
return true;
}
开发者ID:itseasy21,项目名称:master_autoindex,代码行数:33,代码来源:plugin.class.php
示例11: gatherFileData
public function gatherFileData()
{
$files = array_filter(get_included_files(), create_function('$var', 'return (strpos($var, "pqp/classes") === false);'));
$fileList = array();
$fileTotals = array("count" => count($files), "size" => 0, "largest" => 0, "newest" => 0);
foreach ($files as $key => $file) {
$size = filesize($file);
$age = filemtime($file);
//if($fileTotals["size"] == 2)
//{
//$output = null;
//exec("svn status --show-updates $file",$output);
//Debugger::log("--------------------------------------------------------------");
//Debugger::log($output);
//error_log("output: " . print_r($output,true));
//}
$fileList[] = array('name' => $file, 'age' => $age, 'size' => $this->getReadableFileSize($size));
$fileTotals['size'] += $size;
if ($size > $fileTotals['largest']) {
$fileTotals['largest'] = $size;
}
if ($age > $fileTotals["newest"]) {
$fileTotals["newest"] = $age;
$fileTotals["newest-file"] = $file;
}
}
usort($fileList, array($this, "fileCompare"));
//$fileTotals["newest"] = $this->getReableFileSize($fileTotals["newest"]);
$fileTotals['size'] = $this->getReadableFileSize($fileTotals['size']);
$fileTotals['largest'] = $this->getReadableFileSize($fileTotals['largest']);
$this->output['files'] = $fileList;
$this->output['fileTotals'] = $fileTotals;
}
开发者ID:htmlgraphic,项目名称:HTMLgraphic-MVC,代码行数:33,代码来源:PhpQuickProfiler.php
示例12: loadCommonLib
/**
* @return bool
*/
protected function loadCommonLib()
{
$ret = false;
$errors = array();
if (!defined('ROKCOMMON_LIB_PATH')) {
define('ROKCOMMON_LIB_PATH', JPATH_SITE . '/libraries/rokcommon');
}
$rokcommon_inlcude_path = @realpath(ROKCOMMON_LIB_PATH . '/include.php');
if (file_exists($rokcommon_inlcude_path)) {
if (!defined('ROKCOMMON_ERROR_MISSING_LIBS')) {
define('ROKCOMMON_ERROR_MISSING_LIBS', true);
}
$included_files = get_included_files();
if (!in_array($rokcommon_inlcude_path, $included_files) && ($libret = (require_once $rokcommon_inlcude_path)) !== 'ROKCOMMON_LIB_INCLUDED') {
if (!defined('ROKCOMMON_ERROR_MISSING_LIBS')) {
define('ROKCOMMON_ERROR_MISSING_LIBS', true);
}
$errors = (array) $libret;
} else {
$ret = true;
}
} else {
$errors[] = 'Unable to find the RokCommon library at ' . ROKCOMMON_LIB_PATH;
}
if (!empty($errors)) {
$app = JFactory::getApplication();
if ($app->isAdmin()) {
foreach ($errors as $error) {
$app->enqueueMessage('RokCommon: ' . $error, 'warning');
}
}
}
return $ret;
}
开发者ID:densem-2013,项目名称:exikom,代码行数:37,代码来源:rokcommon.php
示例13: checkpoint
static function checkpoint($name)
{
if (!defined('PROFILER')) {
return false;
}
self::$checkpoints[$name] = array('time' => self::microtime(), 'memory' => memory_get_usage(), 'included_files' => count(get_included_files()), 'queries' => count(self::$queries));
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:7,代码来源:class.profiler.php
示例14: output
public function output(Pagemill_Data $data, Pagemill_Stream $stream)
{
Typeframe::Timestamp('Starting debug output');
$debug = new Pagemill_Data();
$timestamps = Typeframe::GetTimestamps();
$tdata = array();
if ($timestamps) {
$begin = $timestamps[0]->time();
foreach ($timestamps as $t) {
//$dump .= "{$t->action()}: " . ($t->time() - $begin) . "<br/>";
$tdata[] = array('action' => $t->action(), 'time' => $t->time() - $begin);
}
}
$debug['timestamps'] = $tdata;
$debug['memory_used'] = memory_get_usage();
$debug['memory_used_real'] = memory_get_usage(true);
$debug['includes'] = get_included_files();
$debug['querycount'] = Dbi_Source::QueryCount();
$debug['templates'] = Pagemill::ProcessedTemplates();
// TODO: Get template files
$debug['data'] = $data;
$this->_recurseTines($debug);
$include = new Typeframe_Tag_Include('include', array('template' => '/pagemill/tag/debug.html'));
$include->process($debug, $stream);
}
开发者ID:ssrsfs,项目名称:blg,代码行数:25,代码来源:Debug.php
示例15: Element
function Element($templateFile, array $options)
{
global $config, $debug, $twig;
if (!$twig) {
load_twig();
}
if (function_exists('create_pm_header') && (isset($options['mod']) && $options['mod'] || isset($options['__mod']))) {
$options['pm'] = create_pm_header();
}
if (isset($options['body']) && $config['debug']) {
if (isset($debug['start'])) {
$debug['time'] = '~' . round((microtime(true) - $debug['start']) * 1000, 2) . 'ms';
unset($debug['start']);
}
$debug['included'] = get_included_files();
$debug['memory'] = round(memory_get_usage(true) / (1024 * 1024), 2) . ' MiB';
$options['body'] .= '<h3>Debug</h3><pre style="white-space: pre-wrap;font-size: 10px;">' . str_replace("\n", '<br/>', utf8tohtml(print_r($debug, true))) . '</pre>';
}
// Read the template file
if (@file_get_contents("{$config['dir']['template']}/{$templateFile}")) {
$body = $twig->render($templateFile, $options);
if ($config['minify_html'] && preg_match('/\\.html$/', $templateFile)) {
$body = trim(preg_replace("/[\t\r\n]/", '', $body));
}
return $body;
} else {
throw new Exception("Template file '{$templateFile}' does not exist or is empty in '{$config['dir']['template']}'!");
}
}
开发者ID:niksfish,项目名称:Tinyboard,代码行数:29,代码来源:template.php
示例16: includePath
public function includePath($path, \closure $closure = null)
{
$errors = array();
$path = (string) $path;
$errorHandler = set_error_handler(function ($error, $message, $file, $line, $context) use(&$errors) {
$errors[] = func_get_args();
});
$closure = $closure ?: function ($path) {
include_once $path;
};
$closure($path);
restore_error_handler();
if (sizeof($errors) > 0) {
$realpath = parse_url($path, PHP_URL_SCHEME) !== null ? $path : realpath($path) ?: $path;
if (in_array($realpath, get_included_files(), true) === false) {
throw new includer\exception('Unable to include \'' . $path . '\'');
} else {
if ($errorHandler !== null) {
foreach ($errors as $error) {
call_user_func_array($errorHandler, $error);
}
}
}
}
return $this;
}
开发者ID:ronan-gloo,项目名称:atoum,代码行数:26,代码来源:includer.php
示例17: compile
public function compile($name = null)
{
$name = $name ?: self::BASE_FILE_NAME;
if (!($isCompiledExists = file_exists($location = $this->getLocation($name)))) {
$includedFiles = get_included_files();
// Remove first 4 files (index, _init, Kalibri, Compiler )
$includedFiles = array_slice($includedFiles, 4);
foreach ($includedFiles as $file) {
if (in_array($file, $this->_skipped) || strpos($file, '/Helper/') !== false || strpos($file, '/Config/') !== false) {
continue;
}
if ($name == self::NAME_BASE || $name == self::NAME_ROUTE && strpos($file, '_compiled.php') === false) {
if (!$isCompiledExists) {
file_put_contents($location, '<?php', FILE_APPEND);
chmod($location, 0777);
}
$this->skip($file);
// Drop comments, new lines and put content into "compiled" file
exec("cat {$file} | php -w | sed 's/<?php//g' >> {$location}");
// file_put_contents( $location, str_replace( array('<?php', '<?', '? >'), '', file_get_contents( $file ) ), FILE_APPEND);
$isCompiledExists = true;
}
}
//file_put_contents( $this->getLocation( $name, true ), json_encode($this->_infos[ $name ]) );
}
}
开发者ID:tenebras,项目名称:kalibri,代码行数:26,代码来源:Compiler.php
示例18: display
public static function display()
{
echo '<div style=" min-height:100%; position: fixed; background-color: #f7f7f7; background-image: -moz-linear-gradient(-90deg, #e4e4e4, #ffffff); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e4e4e4), to(#ffffff)); top:30px; bottom: 0; left:0; margin:0; padding: 0; z-index: 6000000; width: 100%; font: 12px Verdana, Arial, sans-serif; text-align: left; color: #2f2f2f;">
<div style="display: block; background-color: #2F2F2F; padding: 8px 20px; position: fixed; top: 0; left:0; width: 100%; font: 11px Verdana, Arial, sans-serif; text-align: left; color: #EEEEEE;">
asdf
</div>';
echo timeEnd(TIMESTART) / 1000;
pr(get_included_files());
echo self::convertSize(memory_get_usage());
echo '</div>
<div style="position: fixed; background-color: #f7f7f7; background-image: -moz-linear-gradient(-90deg, #e4e4e4, #ffffff); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#e4e4e4), to(#ffffff)); bottom: 0; left:0; margin:0; padding: 0; z-index: 6000000; width: 100%; border-top: 1px solid #bbb; font: 11px Verdana, Arial, sans-serif; text-align: left; color: #2f2f2f;">
<span style="white-space:nowrap; color:#2f2f2f; display:inline-block; min-height:24px; border-right:1px solid #cdcdcd; padding:8px 7px 1px 4px; ">
Cute Profiler
</span>
<span style="white-space:nowrap; color:#2f2f2f; display:inline-block; min-height:24px; border-right:1px solid #cdcdcd; padding:8px 7px 1px 4px; ">
<span><a href="#" style="color: #2f2f2f">PHP ' . phpversion() . '</a></span>
<span style="margin: 0; padding: 0; color: #979696;">|</span>
<span style="color: #a33">xdebug</span>
<span style="margin: 0; padding: 0; color: #979696">|</span>
<span style="color: #759e1a">accel</span>
</span>
<span style="display:block; position:absolute; top:10px; right:30px; width:14px; height:14px; cursor: pointer;">
close
</span>
</div>';
}
开发者ID:JaviereN,项目名称:CuteMVC,代码行数:26,代码来源:Profiler.php
示例19: __destruct
public function __destruct()
{
$included_files = get_included_files();
$file_msg = '文件加载[' . count($included_files) . ']' . print_r($included_files, true);
$mem = $this->mem;
$mem_end = memory_get_usage() / 1024;
$mem_msg = PHP_EOL . '[内存消耗统计]';
$mem_msg .= PHP_EOL . '启动消耗内存:' . $mem['start'] . 'Kb';
$mem_msg .= PHP_EOL . '路由消耗内存:' . ($mem['dispatch'] - $mem['start']) . 'Kb';
$mem_msg .= PHP_EOL . '处理消耗内存:' . ($mem_end - $mem['dispatch']) . 'Kb';
$mem_msg .= PHP_EOL . '总共消耗内存:' . $mem_end . 'Kb';
$time = $this->time;
$end = self::mtime();
$time_msg = '启动时间:' . $time['request'];
$time_msg .= PHP_EOL . '结束时间:' . $end;
$time_msg .= PHP_EOL . '框架启动耗时:' . ($time['routerstartup'] - $time['request']) . 'ms';
$time_msg .= PHP_EOL . '路由处理耗时:' . ($time['routershutdown'] - $time['routerstartup']) . 'ms';
$time_msg .= PHP_EOL . '分发准备耗时:' . ($time['dispatchloopstartup'] - $time['routershutdown']) . 'ms';
if (isset($time['dispatchloopshutdown'])) {
$time_msg .= PHP_EOL . '处理过程耗时:' . ($time['dispatchloopshutdown'] - $time['dispatchloopstartup']) . 'ms';
$time_msg .= PHP_EOL . '输出关闭耗时:' . ($end - $time['dispatchloopshutdown']) . 'ms';
} else {
$time_msg .= PHP_EOL . '处理过程耗时:' . ($end - $time['dispatchloopstartup']) . 'ms';
}
$time_msg .= PHP_EOL . '总耗时:' . ($end - $time['request']) . 'ms';
Log::write($file_msg . $time_msg . $mem_msg . PHP_EOL, 'TRACER');
}
开发者ID:derek-chow,项目名称:YunYinService,代码行数:27,代码来源:Tracer.php
示例20: renderLoadedFiles
public function renderLoadedFiles($tableName)
{
$status = opcache_get_status(true);
$loadedFiles = get_included_files();
$scriptInfo = array();
if (isset($status['scripts']) == false) {
return "Failed to load scripts info to generate OPCache info.";
}
foreach ($loadedFiles as $loadedFile) {
$newScriptInfo = array();
if (array_key_exists($loadedFile, $status['scripts']) == true) {
$newScriptInfo["memory_consumption"] = $status['scripts'][$loadedFile]["memory_consumption"];
$newScriptInfo["hits"] = $status['scripts'][$loadedFile]["hits"];
} else {
$newScriptInfo["memory_consumption"] = "-";
$newScriptInfo["hits"] = "-";
}
$newScriptInfo['path'] = $loadedFile;
if (mb_strpos($loadedFile, $this->root) === 0) {
$newScriptInfo['path'] = '.' . mb_substr($loadedFile, mb_strlen($this->root));
}
$scriptInfo[] = $newScriptInfo;
}
return $this->renderTable($tableName, $scriptInfo);
}
开发者ID:atawsports2,项目名称:Imagick-demos,代码行数:25,代码来源:OPCacheInfo.php
注:本文中的get_included_files函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论