本文整理汇总了PHP中ClassLoader::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassLoader::instance方法的具体用法?PHP ClassLoader::instance怎么用?PHP ClassLoader::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassLoader
的用法示例。
在下文中一共展示了ClassLoader::instance方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
public static function getInstance()
{
if (is_null(self::$instance)) {
self::$instance = new ClassLoader();
}
return self::$instance;
}
示例2: getInstance
/**
* 获取类的单一实例
*
* @return static
*/
public static function getInstance()
{
if (!is_object(self::$instance)) {
self::$instance = new static();
}
return self::$instance;
}
示例3: instance
public static function instance()
{
if (!self::$instance) {
self::$instance = new ClassLoader();
}
return self::$instance;
}
示例4: getInstance
/**
*
* @return ClassLoader
*/
public static function getInstance()
{
if (self::$instance == null) {
self::$instance = new self();
}
return self::$instance;
}
示例5: startup
public static function startup(){
self::$instance = new ClassLoader();
// --- Contrib Namespaced Classes/Libs
/*self::$instance->registerNamespaces(array(
'Symfony' => LIB_ROOT . '/vendor',
'Dreamblaze' => LIB_ROOT . '/vendor',
'RisingGods' => LIB_ROOT . '/vendor'
));*/
// --- Contrib Prefixed Classes/Libs
self::$instance->registerPrefixes(array(
'Twig_' => LIB_ROOT . '/vendor',
'FB' => LIB_ROOT . '/FirePHPCore',
));
self::$instance->registerNamespaceFallbacks(array(
LIB_ROOT . '/vendor'
));
self::$instance->registerPrefixFallbacks(array(
APP_ROOT . '/controllers',
APP_ROOT . '/models',
APP_ROOT . '/viewextentions',
));
self::$instance->register();
}
示例6: get_layout_cache_key
private function get_layout_cache_key()
{
if ($this->layout_cache_key != null) {
return $this->layout_cache_key;
}
$layout_class_source = ClassLoader::instance()->get_element_content_by_name(get_class($this));
$f = new File("/" . $this->layout_path);
$layout_file_path = $f->getPath();
$layout_file_size = $f->getSize();
$layout_modification_time = $f->getModificationTime();
$this->layout_cache_key = md5($layout_class_source . $layout_file_path . $layout_file_size . $layout_modification_time);
return $this->layout_cache_key;
}
示例7: __construct
private function __construct()
{
$this->controllers = array();
$class_keys = ClassLoader::instance()->get_element_keys();
foreach ($class_keys as $key) {
if (self::is_controller_class($key)) {
$controller_name = self::get_controller_name_from_class($key);
if ($controller_name == "abstract" || $controller_name == "i") {
continue;
}
$this->controllers[$controller_name] = $key;
}
}
}
示例8: init
private static function init()
{
self::$instance = new ClassLoader(self::CLASS_FILENAME_SUFFIX, true, false);
self::$instance->autoconfigure();
}
示例9: user_error
case E_USER_WARNING:
echo "<b>My WARNING</b> [{$errNo}] {$errStr}<br />\n";
break;
case E_USER_NOTICE:
echo "<b>My NOTICE</b> [{$errNo}] {$errStr}<br />\n";
break;
default:
echo "Unknown error type: [{$errNo}] {$errStr}<br>{$errFile} Line {$errLine}<br />\n";
break;
}
/* Don't execute PHP internal error handler */
return true;
});
if (file_exists(BASE_PATH . '/vendor/autoload.php')) {
require_once BASE_PATH . '/vendor/autoload.php';
} else {
user_error('It doesnt look like you\'ve done a composer update.', E_USER_WARNING);
}
require_once 'utils/ClassLoader.php';
require_once 'utils/Object.php';
require_once 'utils/TokenisedRegularExpression.php';
require_once 'utils/Manifest.php';
require_once 'utils/ClassManifest.php';
require_once 'utils/ConfigManifest.php';
if (Manifest::make_manifest()) {
Manifest::reload_manifest();
}
$loader = ClassLoader::instance();
$loader->registerAutoLoader();
DB::init();
Router::route();