本文整理汇总了PHP中get_included_files函数的典型用法代码示例。如果您正苦于以下问题:PHP get_included_files函数的具体用法?PHP get_included_files怎么用?PHP get_included_files使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_included_files函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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()));
}
示例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();
}
示例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());
}
}
示例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';
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}
示例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);
}
示例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']}'!");
}
}