本文整理汇总了PHP中get_required_files函数的典型用法代码示例。如果您正苦于以下问题:PHP get_required_files函数的具体用法?PHP get_required_files怎么用?PHP get_required_files使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_required_files函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: IsAvailable
function IsAvailable()
{
if ($this->_checked) {
return $this->_available;
}
$this->_checked = true;
if ($path = $this->getFullPath()) {
//Include class file if it not already included
if (!in_array($path, get_required_files())) {
require_once $path;
}
//Check that needly class exists
if (!class_exists(str_replace('.', '_', $this->Package) . '_' . $this->Class)) {
WriteLog("Class " . $this->Class . " from Package " . $this->Package . " not found", LOGFILE_LOGIC);
return $this->_available = false;
} else {
$class = str_replace('.', '_', $this->Package) . '_' . $this->Class;
$this->_methods = array_flip(get_class_methods($class));
unset($this->_methods['xobject']);
unset($this->_methods['show']);
unset($this->_methods[strtolower($class)]);
}
} else {
WriteLog("File for Class " . $this->Class . " from Package " . $this->Package . " not found", LOGFILE_LOGIC);
return $this->_available = false;
}
return $this->_available = true;
}
开发者ID:parxomchik,项目名称:Agro,代码行数:28,代码来源:XObjectInfo.class.php
示例2: end
public static function end(string $test)
{
$getMemoryUsage = memory_get_usage();
$test = $test . "_end";
Properties::$tests[$test] = microtime();
Properties::$usedtests[$test] = get_required_files();
Properties::$memtests[$test] = $getMemoryUsage;
}
开发者ID:znframework,项目名称:znframework,代码行数:8,代码来源:Testing.php
示例3: test_should_load_required_files
public function test_should_load_required_files()
{
$base_path = realpath(__DIR__) . '/mocks';
$this->autoload->add_prefix('Melody\\Mocks\\', $base_path . '/src');
$this->autoload->load_class('Melody\\Mocks\\Classic');
$this->autoload->load_class('Melody\\Mocks\\Contemporary');
$files = get_required_files();
$this->assertContains($base_path . '/src/classic.php', $files);
$this->assertContains($base_path . '/src/contemporary.php', $files);
}
开发者ID:nocttuam,项目名称:lyric,代码行数:10,代码来源:lyric-autoload-Test.php
示例4: isImport
function isImport($path = '')
{
if (!is_string($path)) {
return false;
}
if (in_array(realpath(suffix($path, '.php')), get_required_files())) {
return true;
} else {
return false;
}
}
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:11,代码来源:Functions.php
示例5: java_get_base
function java_get_base()
{
$ar = get_required_files();
$arLen = sizeof($ar);
if ($arLen > 0) {
$thiz = $ar[$arLen - 1];
return dirname($thiz);
} else {
return "java";
}
}
开发者ID:robocoder,项目名称:solublecomponents,代码行数:11,代码来源:functions.php
示例6: count
public static function count(string $result = NULL) : int
{
if (empty($result)) {
return count(get_required_files());
}
$resend = $result . "_end";
$restart = $result . "_start";
if (!isset(Properties::$usedtests[$restart])) {
throw new BenchmarkException('[Benchmark::usedFileCount(\'' . $result . '\')] -> Parameter is not a valid test start!');
}
if (!isset(Properties::$usedtests[$resend])) {
throw new BenchmarkException('[Benchmark::usedFileCount(\'' . $result . '\')] -> Parameter is not a valid test end!');
}
return count(Properties::$usedtests[$resend]) - count(Properties::$usedtests[$restart]);
}
开发者ID:znframework,项目名称:znframework,代码行数:15,代码来源:FileUsage.php
示例7: array
function &getEntity($class, $key, $params = array(), $mode = READ_MODE, $package = DEFAULT_PACKAGE)
{
// ñìîòðèì ðåæèì ñêà÷èâàíèÿ (ìîæåò èñïîëüçîâàòüñÿ ïîòîì äëÿ ïðàâ)
$mode = intval($mode);
if (!$mode) {
WriteLog('Invalid mode of entity ' . $class . ' in mode ' . $mode, LOGFILE_ENITY);
return;
}
// èùåì ñóùíîñòü â êåøå (äëÿ óáûñòðåíèÿ è îáñåïå÷åíèÿ ïîâòîðíîãî ÷òåíèÿ)
$hash = md5($package . $class . $mode . serialize($params) . serialize($key));
if (!empty($this->_entity[$hash])) {
return $this->_entity[$hash]['entity'];
} else {
//Try build new entity
if (empty($class)) {
return null;
}
if (empty($package)) {
$package = DEFAULT_PACKAGE;
}
$class .= "Entity";
$full_path = PACKAGES_DIR . '/' . str_replace('.', '/', $package) . '/' . $class . '.class.php';
if (file_exists($full_path)) {
if (!in_array($full_path, get_required_files())) {
require_once $full_path;
}
//Check that needly class exists
if (!class_exists(str_replace('.', '_', $package) . '_' . $class)) {
class_log('XEntityCache', 'Class ' . $class . ' not found ', ENTITYCACHE_LOG);
return null;
} else {
$full_class = str_replace('.', '_', $package) . '_' . $class;
$methods = array_flip(get_class_methods($full_class));
//If called class not derived from entity return null
if (!in_array('xentity', $methods)) {
return null;
}
}
return $this->_createEntity($full_class, $key, $params, $mode, $hash);
} else {
$sth = null;
return $sth;
}
}
}
开发者ID:parxomchik,项目名称:Agro,代码行数:45,代码来源:XEntityCache.class.php
示例8: dropdown
function dropdown($selected_value)
{
$ajax = ajax();
switch ($selected_value) {
case 'classes':
$data = get_declared_classes();
$ajax->label_4 = "PHP Classes Loaded";
break;
case 'files':
$data = get_required_files();
$ajax->label_4 = "PHP Files";
break;
case 'ext':
$data = get_loaded_extensions();
$ajax->label_4 = "PHP Extensions";
}
$data += array('classes' => 'PHP Clases', 'files' => 'PHP Files Loaded', 'ext' => 'PHP Extensions Loaded');
//propagate data to dropdown
$ajax->select('dropdown', $data);
}
开发者ID:glensc,项目名称:cjax,代码行数:20,代码来源:form.php
示例9: errorLog
/**
* 功能: 日志记录
* $message
*/
function errorLog($message, $type, $file = '')
{
if (empty($file)) {
//如果没有将文件传输过来,则使用调用此方法的文件名
$fileInfo = get_required_files();
$fileInfo = explode('.', basename($fileInfo[0]));
array_pop($fileInfo);
$file = implode('.', $fileInfo);
}
$path = WEB_PATH . 'log/' . $file . '/' . date('Y-m/d/');
//$root.'/log/';
if (!is_dir($path)) {
$mkdir = mkdir($path, 0777, true);
if (!$mkdir) {
exit('不能建立日志文件');
}
}
$status = error_log(date("Y-m-d H:i:s") . " {$message}\r\n", 3, $path . CURRENT_DATE . '_' . $type . '.log');
return $status;
}
开发者ID:ulpyuxa,项目名称:wishorder.wishtool.com,代码行数:24,代码来源:functions.php
示例10: render
/**
* PHP_Debug default output function, first we finish the processes and
* then a render object is created and its render method is invoked
*
* The renderer used is set with the options, all the possible renderer
* are in the directory Debug/Renderer/*.php
* (not the files ending by '_Config.php')
*
* @since V2.0.0 - 13 apr 2006
* @see Debug_Renderer
*/
public function render()
{
// Finish process
$this->endTime = PHP_Debug::getMicroTimeNow();
// Render output if we are allowed to
if ($this->isAllowed()) {
// Create render object and invoke its render function
$renderer = PHP_Debug_Renderer::factory($this, $this->options);
// Get required files here to have event all Debug classes
$this->requiredFiles = get_required_files();
// Call rendering
return $renderer->render();
}
}
开发者ID:Clansuite,项目名称:Clansuite,代码行数:25,代码来源:Debug.php
示例11: define
* If you remove this no one will be able to see responses unless from an XHR request, Flash Request, etc.
*
* If you are not interested in viewing the response on the browser or you unexpectly see the response,
* you may remove this setting by removing the line below.
*
* @constant AJAX_VIEW
*/
define('AJAX_VIEW', 1);
/**
*
* Allows to include 'ajax.php' as well as 'ajaxfw.php' back to back compatibility.
* @var unknown_type
*/
$included_files = get_included_files();
if (!$included_files) {
$included_files = get_required_files();
}
if ($included_files && count($included_files) > 1) {
return require_once 'ajaxfw.php';
}
/**
* *End Cjax configuration*
*/
/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*
* You can load different configurations depending on your
* current environment. Setting the environment also influences
* things like logging and error reporting.
开发者ID:kcbikram,项目名称:ajax-framework-for-codeigniter,代码行数:31,代码来源:ci_ajax.php
示例12: autoload
/**
* 框架本身的自动加载
* @param string $class
*/
public static function autoload($class)
{
$classFile = BASIC_ROOT . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
if (is_file($classFile) && !in_array($classFile, get_required_files())) {
require $classFile;
}
}
开发者ID:Oblood,项目名称:framework,代码行数:11,代码来源:Dispatcher.php
示例13: var_dump
// Try to require a non-existant file
//$inc = require_once('XXPositions.inc');
//var_dump($inc);
echo "----------------------------------\n";
// require an existing file
$inc = (require 'Positions.inc');
//$inc = require_once('Positions.inc');
var_dump($inc);
// require an existing file. It doesn't matter if the first require was with/without
// _once; subsequent use of require_once returns true
$inc = (require_once 'Positions.inc');
var_dump($inc);
var_dump(Positions\LEFT);
var_dump(Positions\TOP);
echo "----------------------------------\n";
///*
// require Point.inc to get at the Point class type
$inc = (require 'Point.inc');
var_dump($inc);
$p1 = new Point(10, 20);
//*/
echo "----------------------------------\n";
// require Circle.inc to get at the Circle class type, which in turn uses the Point type
$inc = (require 'Circle.inc');
var_dump($inc);
$p2 = new Point(5, 6);
$c1 = new Circle(9, 7, 2.4);
echo "----------------------------------\n";
// get the set of required files
print_r(get_required_files());
开发者ID:badlamer,项目名称:hhvm,代码行数:30,代码来源:require_once.php
示例14: usedFileCount
public function usedFileCount($result = '')
{
if (!is_string($result)) {
return Error::set('Error', 'stringParameter', 'result');
}
if (empty($result)) {
return get_required_files();
}
$resend = $result . "_end";
$restart = $result . "_start";
if (isset($this->usedtests[$resend]) && isset($this->usedtests[$restart])) {
return count($this->usedtests[$resend]) - count($this->usedtests[$restart]);
}
}
开发者ID:bytemtek,项目名称:znframework,代码行数:14,代码来源:Benchmark.php
示例15: isImport
function isImport(string $path) : bool
{
return !in_array(realpath(suffix($path, '.php')), get_required_files()) ? false : true;
}
开发者ID:znframework,项目名称:znframework,代码行数:4,代码来源:Control.php
示例16: _templateWizard
protected function _templateWizard()
{
$requiredFiles = implode('[+++]', get_required_files());
preg_match('/\\w+\\.wizard\\.php/', $requiredFiles, $match);
$exceptionData['file'] = VIEWS_DIR . ($match[0] ?? strtolower(CURRENT_FUNCTION) . '.wizard.php');
$exceptionData['message'] = lang('Error', 'templateWizard');
return (object) $exceptionData;
}
开发者ID:znframework,项目名称:znframework,代码行数:8,代码来源:InternalExceptions.php
示例17: xapp_import
/**
* xapp java style dot and wildcard class/package loader imports/requires class or packages from the default xapp base
* path or paths passed as conf value defined by XAPP_CONF_IMPORT_PATH. the import $parameter can be:
*
* 1) absolute file like /var/www/app/foo.php - includes file directly
* 2) relative file like /app/foo.php - tries to include file from known xapp paths
* 3) java style class xapp.Xapp.Event - imports class
* 4) java style package xapp.Xapp.* - imports packages
*
* this function can not import:
* 3) absolute dirs like /var/www/app - not supported!
* 4) relative dirs like /app - not supported!
*
* the function store all imported java style classes and packages into a global package cache to check if package has been
* already imported and therefore does not execute any import code. the function does not throw any error but simply tries
* to require the $import param with triggering php error when $import value require fails.
*
* The import function does have hidden additional parameters when using java style dotmnotation wildcard loading. the
* hidden function arguments/parameters are:
* 1 = either a custom base path from where to load the package or an array with regex exclude rules/patterns
* 2 = an array with regex exclude rules if 1 is a custom base path. call like:
*
* <code>
* xapp_import('xapp.Package.*, '/custom/path/');
* xapp_import('xapp.Package.*, array('/^regex1$/', '/regex2/i'));
* xapp_import('xapp.Package.*, '/custom/path/', array('/^regex1$/', '/regex2/i'));
* </code>
*
* NOTE: the regex syntax for the the path/name exclusion argument must be a valid and complete regex pattern! Also the
* exclude argument MUST be an array!
*
* @param string $import expects a a valid import value as defined above
* @return boolean
*/
function xapp_import($import)
{
$path = null;
//if is php includable file with relative or absolute path with DS separator or . dot separator include directly trying to resolve absolute path
if (preg_match('/(.*)\\.(php|php5|phps|phtml|inc)$/i', $import, $m)) {
if (stripos($import, DS) === false) {
$import = implode(DS, explode('.', trim($m[1], '.* '))) . '.' . trim($m[2], '.* ');
}
if (in_array($import, get_required_files())) {
return;
}
if (is_file($import)) {
require_once $import;
return true;
}
$class = xapp_path(XAPP_PATH_XAPP) . trim($import, DS);
if (in_array($class, get_required_files())) {
return;
}
if (is_file($class)) {
require_once $class;
return true;
}
$class = xapp_path(XAPP_PATH_BASE) . trim($import, DS);
if (in_array($class, get_required_files())) {
return;
}
if (is_file($class)) {
require_once $class;
return true;
}
$class = xapp_path(XAPP_PATH_ROOT) . trim($import, DS);
if (in_array($class, get_required_files())) {
return;
}
if (is_file($class)) {
require_once $class;
return true;
}
require_once $import;
//is java style import . dot notation with wildcard
} else {
$ns = substr($import, 0, strpos($import, '.'));
$pk = substr(substr($import, strlen($ns) + 1), 0, strpos(substr($import, strlen($ns) + 1), '.'));
//if ns is not xapp check if composer autoloader and package to import exists
if (stripos($ns, 'xapp') === false) {
$ns = substr($import, 0, strpos($import, '.'));
$pk = substr(substr($import, strlen($ns) + 1), 0, strpos(substr($import, strlen($ns) + 1), '.'));
//if ns is not xapp check if composer autoloader and package to import exists
if (stripos($ns, 'xapp') === false) {
$searchPath = xapp_path(XAPP_PATH_BASE) . 'xapp' . DIRECTORY_SEPARATOR;
if (!in_array(xapp_path(XAPP_PATH_BASE) . 'autoload.php', get_required_files())) {
/**
* @Core-Hack
*/
if (is_file($searchPath . 'autoload.php')) {
require_once $searchPath . 'autoload.php';
} else {
trigger_error("unable to include composer vendor autoloader - please make sure composer is installed", E_USER_ERROR);
}
/*
if(is_file(xapp_path(XAPP_PATH_BASE) . 'autoload.php'))
{
require_once xapp_path(XAPP_PATH_BASE) . 'autoload.php';
}else{
trigger_error("unable to include composer vendor autoloader - please make sure composer is installed", E_USER_ERROR);
//.........这里部分代码省略.........
开发者ID:xamiro-dev,项目名称:xamiro,代码行数:101,代码来源:core.php
示例18: ActionAccessInterceptor
* Register auto load
*/
Zood_Loader::registerAutoload();
//require_once 'Zend/Registry.php';
//require_once 'Zood/Util.php';
//require_once 'Zood/Controller/Front.php';
/**
* Set default configuration dir
*/
//Zood_Loader::loadClass('Zood_Config');
//Zood_Config::addConfigDirectory(ZOODPP_ROOT . '/app' . '/config');
//Access authentication
require_once ZOODPP_ROOT . '/app/lib/access/ActionAccessInterceptor.php';
Zood_Controller_Action::addInterceptor(new ActionAccessInterceptor(), 'access');
/**
* Get front controller instance, set controller dir and dispatch
*/
try {
Zood_Controller_Front::getInstance()->setBaseUrl()->setControllerDirectory(ZOODPP_APP . '/controllers')->dispatch();
} catch (Exception $e) {
Zood_Util::print_r($e->getMessage(), 'Exception!');
}
/**
* Execution end time
* @var Float
*/
$endTime = microtime(true);
Zood_Util::print_r($endTime - $bootTime, 'Full execution time(sec)');
Zood_Util::print_r(memory_get_usage(), 'memory_get_usage');
Zood_Util::print_r($rf = get_required_files(), 'All included files (' . count($rf) . ')');
// End ^ LF ^ UTF-8
开发者ID:BGCX261,项目名称:zoodphp-svn-to-git,代码行数:31,代码来源:index.php
示例19: required
public function required() : array
{
return get_required_files();
}
开发者ID:znframework,项目名称:znframework,代码行数:4,代码来源:Info.php
示例20: collectInfo
/**
* collects all Info for being displayed by the Toolbar
*
* @access private
* @param \Smarty $oView
* @return array $aToolbar containing all Info for toolbar
*/
private function collectInfo(\Smarty $oView)
{
$aToolbar = array();
$aToolbar['sPHP'] = phpversion();
$aToolbar['sOS'] = PHP_OS;
$aToolbar['sEnv'] = \MVC\Registry::get('MVC_ENV');
$aToolbar['aGet'] = array_map('htmlentities', $_GET);
$aToolbar['aPost'] = array_map('htmlentities', $_POST);
$aToolbar['aCookie'] = array_map('htmlentities', $_COOKIE);
$aToolbar['aRequest'] = array_map('htmlentities', $_REQUEST);
$aToolbar['aSession'] = $_SESSION;
$aToolbar['aSmartyTemplateVars'] = $oView->getTemplateVars();
$aConstants = get_defined_constants(true);
$aToolbar['aConstant'] = $aConstants['user'];
$aToolbar['aServer'] = $_SERVER;
$aToolbar['oMvcRequestGetWhitelistParams'] = \MVC\Request::getInstance()->getWhitelistParams();
$aToolbar['oMvcRequestGetQueryArray'] = \MVC\Request::getInstance()->getQueryArray();
$aToolbar['aEvent'] = \MVC\Registry::isRegistered('MVC_EVENT') ? \MVC\Registry::get('MVC_EVENT') : array();
$aRequest = \MVC\Request::GETCURRENTREQUEST();
$aToolbar['aRouting'] = array('aRequest' => \MVC\Request::GETCURRENTREQUEST(), 'sModule' => \MVC\Request::getInstance()->getModule(), 'sController' => \MVC\Request::getInstance()->getController(), 'sMethod' => \MVC\Request::getInstance()->getMethod(), 'sArg' => isset($aToolbar['oMvcRequestGetQueryArray']['GET']['a']) ? $aToolbar['oMvcRequestGetQueryArray']['GET']['a'] : '', 'aRoute' => \MVC\Registry::get('MVC_ROUTING_CURRENT'), 'sRoutingJsonBuilder' => \MVC\Registry::get('MVC_ROUTING_JSON_BUILDER'), 'sRoutingHandling' => \MVC\Registry::get('MVC_ROUTING_HANDLING'));
$aPolicy = \MVC\Registry::get('MVC_POLICY');
$sController = '\\' . \MVC\Request::getInstance()->getModule() . '\\Controller\\' . \MVC\Request::getInstance()->getController();
$sMethod = \MVC\Request::getInstance()->getMethod();
$aToolbar['aPolicy']['aRule'] = \MVC\Registry::isRegistered('MVC_POLICY') ? \MVC\Registry::get('MVC_POLICY') : array();
$aToolbar['aPolicy']['aApplied'] = isset($aPolicy[$sController][$sMethod]) ? $aPolicy[$sController][$sMethod] : false;
$aToolbar['aPolicy']['sAppliedAt'] = isset($aPolicy[$sController][$sMethod]) ? $sController . '::' . $sMethod : false;
$sTemplate = file_exists($oView->sTemplate) ? $oView->sTemplate : (file_exists($oView->_joined_template_dir . '/' . $oView->sTemplate) ? $oView->_joined_template_dir . '/' . $oView->sTemplate : false);
$aToolbar['sTemplate'] = $sTemplate;
$aToolbar['sTemplateContent'] = file_get_contents($aToolbar['sTemplate']);
ob_start();
$sTemplate = file_get_contents($oView->sTemplate, true);
$oView->renderString($sTemplate);
$sRendered = ob_get_contents();
ob_end_clean();
$aToolbar['sRendered'] = $sRendered;
$aToolbar['aFilesIncluded'] = get_required_files();
$aToolbar['aMemory'] = array('iRealMemoryUsage' => memory_get_usage(true) / 1024, 'dMemoryUsage' => memory_get_usage() / 1024, 'dMemoryPeakUsage' => memory_get_peak_usage() / 1024);
$aToolbar['aRegistry'] = \MVC\Registry::getStorageArray();
$aToolbar['aCache'] = $this->getCaches();
$aToolbar['aError'] = \MVC\Error::getERROR();
$aToolbar['oIds'] = \MVC\Registry::isRegistered('MVC_IDS_IMPACT') ? \MVC\Registry::get('MVC_IDS_IMPACT') : '';
$aToolbar['aIdsConfig'] = \MVC\Registry::isRegistered('MVC_IDS_INIT') ? \MVC\Registry::get('MVC_IDS_INIT') : '';
$aToolbar['aIdsDisposed'] = \MVC\Registry::isRegistered('MVC_IDS_DISPOSED') ? \MVC\Registry::get('MVC_IDS_DISPOSED') : '';
$iMicrotime = microtime(true);
$sMicrotime = sprintf("%06d", ($iMicrotime - floor($iMicrotime)) * 1000000);
$oDateTime = new \DateTime(date('Y-m-d H:i:s.' . $sMicrotime, $iMicrotime));
$oStart = \MVC\Session::getInstance()->get('startDateTime');
$dDiff = date_format($oDateTime, "s.u") - date_format($oStart, "s.u");
$aToolbar['sConstructionTime'] = round($dDiff, 3);
return $aToolbar;
}
开发者ID:gueff,项目名称:mymvc,代码行数:58,代码来源:Index.php
注:本文中的get_required_files函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论