当前位置: 首页>>代码示例>>PHP>>正文


PHP ClassLoader::instance方法代码示例

本文整理汇总了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;
 }
开发者ID:BackupTheBerlios,项目名称:frameorm-svn,代码行数:7,代码来源:autoload.php

示例2: getInstance

 /**
  * 获取类的单一实例
  *
  * @return static
  */
 public static function getInstance()
 {
     if (!is_object(self::$instance)) {
         self::$instance = new static();
     }
     return self::$instance;
 }
开发者ID:saoyor,项目名称:php-framework,代码行数:12,代码来源:ClassLoader.php

示例3: instance

 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new ClassLoader();
     }
     return self::$instance;
 }
开发者ID:pathum,项目名称:mvctest,代码行数:7,代码来源:ClassLoader.php

示例4: getInstance

 /**
  * 
  * @return ClassLoader
  */
 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:RandomUsernameHere,项目名称:megainfo-corporate-cms,代码行数:11,代码来源:ClassLoader.php

示例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();
    }
开发者ID:reddragon010,项目名称:RG-ServerPanel,代码行数:28,代码来源:ClassLoader.php

示例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;
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:13,代码来源:Layout.class.php

示例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;
         }
     }
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:14,代码来源:ControllerFactory.class.php

示例8: init

 private static function init()
 {
     self::$instance = new ClassLoader(self::CLASS_FILENAME_SUFFIX, true, false);
     self::$instance->autoconfigure();
 }
开发者ID:mbcraft,项目名称:frozen,代码行数:5,代码来源:classloader.php

示例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();
开发者ID:pathum,项目名称:mvctest,代码行数:31,代码来源:index.php


注:本文中的ClassLoader::instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。