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