當前位置: 首頁>>代碼示例>>PHP>>正文


PHP static::loader方法代碼示例

本文整理匯總了PHP中static::loader方法的典型用法代碼示例。如果您正苦於以下問題:PHP static::loader方法的具體用法?PHP static::loader怎麽用?PHP static::loader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在static的用法示例。


在下文中一共展示了static::loader方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getLoader

 public static function getLoader()
 {
     if (null !== static::$loader) {
         return static::$loader;
     }
     spl_autoload_register(array('ComposerAutoloaderInitFilesAutoloadOrder', 'loadClassLoader'));
     static::$loader = $loader = new \Composer\Autoload\ClassLoader();
     spl_autoload_unregister(array('ComposerAutoloaderInitFilesAutoloadOrder', 'loadClassLoader'));
     $vendorDir = dirname(__DIR__);
     $baseDir = dirname($vendorDir);
     $map = (require __DIR__ . '/autoload_namespaces.php');
     foreach ($map as $namespace => $path) {
         $loader->add($namespace, $path);
     }
     $classMap = (require __DIR__ . '/autoload_classmap.php');
     if ($classMap) {
         $loader->addClassMap($classMap);
     }
     $loader->register();
     require $vendorDir . '/c/lorem/testC.php';
     require $vendorDir . '/z/foo/testA.php';
     require $baseDir . '/root.php';
     require $vendorDir . '/b/bar/testB.php';
     require $vendorDir . '/d/d/testD.php';
     require $vendorDir . '/e/e/testE.php';
     return $loader;
 }
開發者ID:nickelc,項目名稱:composer,代碼行數:27,代碼來源:autoload_real_files_by_dependency.php

示例2: init

 /**
  * 初始化加載器
  *
  * @return \Powernote\Autoloader\ClassAliasLoader
  */
 public static function init()
 {
     if (static::$loader == null) {
         static::$loader = new self();
     }
     return static::$loader;
 }
開發者ID:mejinke,項目名稱:powernote,代碼行數:12,代碼來源:ClassAliasLoader.php

示例3: initialize

 public static function initialize($paths, $baseNamespace = 'App')
 {
     static::$baseNamespace = rtrim($baseNamespace, '\\') . '\\';
     static::$config = new Config(APP_LOCAL ? $paths['config'] . 'local/' : $paths['config']);
     static::$paths = $paths;
     static::$loader = new Loader();
     static::$loader->registerNamespaces([static::$baseNamespace . 'Assets' => $paths['assets'], static::$baseNamespace . 'Bootstrap' => $paths['bootstrap'], static::$baseNamespace . 'Components' => $paths['components'], static::$baseNamespace . 'Helpers' => $paths['helpers'], static::$baseNamespace . 'Libraries' => $paths['libraries'], static::$baseNamespace . 'Models' => $paths['models'], static::$baseNamespace . 'Modules' => $paths['modules']]);
     static::$loader->register();
 }
開發者ID:panlatent,項目名稱:swilab,代碼行數:9,代碼來源:BaseSwilab.php

示例4: make

 /**
  * Makes autoloader.
  *
  * @return ClassLoader The class loader
  */
 public static function make()
 {
     if (!static::$loader) {
         $loader = new ClassLoader();
         $loader->register();
         static::$loader = $loader;
     }
     return static::$loader;
 }
開發者ID:easy-system,項目名稱:es-loader,代碼行數:14,代碼來源:AutoloaderFactory.php

示例5: init

 /**
  * 初始化加載器
  *
  * @return \Powernote\Autoloader\ClassLoader
  */
 public static function init()
 {
     if (static::$loader == null) {
         static::$loader = new self();
         // 添加框架名稱空間加載路徑
         static::$loader->addNamespace('Powernote', realpath(__DIR__ . '/../'), true);
     }
     return static::$loader;
 }
開發者ID:mejinke,項目名稱:powernote,代碼行數:14,代碼來源:ClassLoader.php

示例6: __construct

 public function __construct()
 {
     global $autoloader;
     static::$loader = $autoloader;
     session_start();
     parent::__construct();
     require_once __DIR__ . '/version.php';
     // Setup aliases
     $this->setupAliases();
     // Load translations
     $this->loadTranslations();
     // Load common functions
     require __DIR__ . '/common.php';
     // Load plugins
     $this->loadPlugins();
 }
開發者ID:nirix,項目名稱:traq,代碼行數:16,代碼來源:Kernel.php

示例7: getLoader

 public static function getLoader()
 {
     if (null !== static::$loader) {
         return static::$loader;
     }
     static::$loader = $loader = new \Composer\Autoload\ClassLoader();
     $vendorDir = dirname(__DIR__);
     $baseDir = dirname($vendorDir);
     $map = (require __DIR__ . '/autoload_namespaces.php');
     foreach ($map as $namespace => $path) {
         $loader->add($namespace, $path);
     }
     $classMap = (require __DIR__ . '/autoload_classmap.php');
     if ($classMap) {
         $loader->addClassMap($classMap);
     }
     $loader->register();
     return $loader;
 }
開發者ID:pkdevboxy,項目名稱:webmail-lite,代碼行數:19,代碼來源:autoload_real.php

示例8: load

 /**
  * Load DI container config from the unit file into the given container builder.
  * 
  * @param ContainerBuilder $builder
  * 
  * @throws \RuntimeException
  */
 public function load(ContainerBuilder $builder)
 {
     if (static::$loader === NULL) {
         static::$loader = $this->createUnitLoader();
     }
     try {
         $unit = (static::$loader)($this->assertFile($this->file));
     } catch (\Throwable $e) {
         throw new \RuntimeException(sprintf('Failed to include unit: "%s"', $this->file), 0, $e);
     }
     if (!$unit instanceof \Closure) {
         $type = is_object($unit) ? get_class($unit) : gettype($unit);
         throw new \RuntimeException(sprintf('Unit requires a closure, value returned by "%s" is %s', $this->file, $type));
     }
     try {
         $unit($builder);
     } catch (\Throwable $e) {
         throw new \RuntimeException(sprintf('Failed to load unit "%s"', $this->file), 0, $e);
     }
 }
開發者ID:koolkode,項目名稱:unity,代碼行數:27,代碼來源:Unit.php

示例9: __construct

 protected function __construct($registry)
 {
     if (!isset($registry)) {
         $registry = new Registry();
         $registry->set('db', DB::getDB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE));
     }
     $this->registry = $registry;
     if (is_null(static::$newConfig)) {
         static::$newConfig = $this->registry->get('config');
     }
     $this->config = static::$newConfig;
     if (is_null(static::$db)) {
         static::$db = $this->registry->get('db');
     }
     if (is_null(static::$loader)) {
         static::$loader = $this->registry->get('load');
     }
     $this->load = static::$loader;
     $this->log = $this->registry->get("log");
 }
開發者ID:ralfeus,項目名稱:moomi-daeri.com,代碼行數:20,代碼來源:OpenCartBase.php

示例10: getLoader

 public static function getLoader()
 {
     if (null !== static::$loader) {
         return static::$loader;
     }
     spl_autoload_register(array('ComposerAutoloaderInitcaccbb1dae7e5bd0f3d1bf80a43364f8', 'loadClassLoader'));
     static::$loader = $loader = new \Composer\Autoload\ClassLoader();
     spl_autoload_unregister(array('ComposerAutoloaderInitcaccbb1dae7e5bd0f3d1bf80a43364f8', 'loadClassLoader'));
     $vendorDir = dirname(__DIR__);
     $baseDir = dirname($vendorDir);
     $map = (require __DIR__ . '/autoload_namespaces.php');
     foreach ($map as $namespace => $path) {
         $loader->add($namespace, $path);
     }
     $classMap = (require __DIR__ . '/autoload_classmap.php');
     if ($classMap) {
         $loader->addClassMap($classMap);
     }
     $loader->register();
     return $loader;
 }
開發者ID:nickfun,項目名稱:ajax,代碼行數:21,代碼來源:autoload_real.php

示例11: getLoader

 public static function getLoader()
 {
     if (null !== static::$loader) {
         return static::$loader;
     }
     static::$loader = $loader = new \Composer\Autoload\ClassLoader();
     $vendorDir = dirname(__DIR__);
     $baseDir = dirname($vendorDir);
     $includePaths = (require __DIR__ . '/include_paths.php');
     array_push($includePaths, get_include_path());
     set_include_path(join(PATH_SEPARATOR, $includePaths));
     $map = (require __DIR__ . '/autoload_namespaces.php');
     foreach ($map as $namespace => $path) {
         $loader->add($namespace, $path);
     }
     $classMap = (require __DIR__ . '/autoload_classmap.php');
     if ($classMap) {
         $loader->addClassMap($classMap);
     }
     $loader->register();
     return $loader;
 }
開發者ID:Kapitonova,項目名稱:codex,代碼行數:22,代碼來源:autoload_real.php

示例12: __construct

 public function __construct()
 {
     global $autoloader;
     parent::__construct();
     static::$loader = $autoloader;
     require __DIR__ . '/version.php';
     // Connect to the database
     $db = $this->config['db'][$this->config['environment']];
     // $GLOBALS['db'] = DriverManager::getConnection([
     $GLOBALS['db'] = ConnectionManager::create(['dbname' => $db['database'], 'user' => $db['username'], 'password' => $db['password'], 'host' => $db['host'], 'driver' => $db['driver'], 'prefix' => $db['prefix']]);
     define('PREFIX', $db['prefix']);
     unset($db);
     // Alias some commonly used classes
     class_alias('Avalon\\Templating\\View', 'View');
     class_alias('Avalon\\Http\\Request', 'Request');
     class_alias('Avalon\\Hook', 'Hook');
     class_alias('Traq\\Helpers\\Errors', 'Errors');
     class_alias('Traq\\Helpers\\Format', 'Format');
     class_alias('Traq\\Helpers\\Ticketlist', 'Ticketlist');
     class_alias('Traq\\Helpers\\TicketFilters', 'TicketFilters');
     class_alias('Avalon\\Helpers\\HTML', 'HTML');
     class_alias('Avalon\\Helpers\\Form', 'Form');
     class_alias('Avalon\\Helpers\\TWBS', 'TWBS');
     class_alias('Avalon\\Helpers\\Gravatar', 'Gravatar');
     // Load commonly used functions
     require __DIR__ . '/common.php';
     View::loadFunctions();
     // If a theme is set, prepend it's views directory
     if (setting('theme') !== 'default') {
         View::addPath(__DIR__ . '/../' . setting('theme') . '/views', true);
     }
     $this->loadTranslations();
     $this->loadPlugins();
     // Set mailer config
     if (isset($this->config['email'])) {
         Notification::setConfig($this->config['email']);
     }
 }
開發者ID:dasklney,項目名稱:traq,代碼行數:38,代碼來源:Kernel.php

示例13: getLoader

 public static function getLoader()
 {
     if (null !== static::$loader) {
         return static::$loader;
     }
     spl_autoload_register(array('ComposerAutoloaderInit93f1e84b83781b432268394c32fb013f', 'loadClassLoader'));
     static::$loader = $loader = new \Composer\Autoload\ClassLoader();
     spl_autoload_unregister(array('ComposerAutoloaderInit93f1e84b83781b432268394c32fb013f', 'loadClassLoader'));
     $vendorDir = dirname(__DIR__);
     $baseDir = dirname($vendorDir);
     $map = (require __DIR__ . '/autoload_namespaces.php');
     foreach ($map as $namespace => $path) {
         $loader->add($namespace, $path);
     }
     $classMap = (require __DIR__ . '/autoload_classmap.php');
     if ($classMap) {
         $loader->addClassMap($classMap);
     }
     $loader->register();
     require $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php';
     require $vendorDir . '/kriswallsmith/assetic/src/functions.php';
     return $loader;
 }
開發者ID:coldni,項目名稱:Jobeet,代碼行數:23,代碼來源:autoload_real.php

示例14: init

 /**
  * Renderer initialisieren
  */
 private static function init()
 {
     // Loader nur einmal pro Skriptlaufzeit erstellen
     if (is_null(static::$loader)) {
         // Autoloader der Renderers aktivieren
         Twig_Autoloader::register();
         // Basisverzeichnis des Renderers zuweisen
         static::$loader = new Twig_Loader_Filesystem(DIR_TEMPLATES);
         // UMGEBUNGS-EINSTELLUNGEN DES RENDERERS SETZEN
         $twigSettings = array('cache' => DIR_COMPILED);
         if (static::DEBUG) {
             $twigSettings['debug'] = true;
             // dump()-Methode zur Verfügung stellen
             $twigSettings['auto_reload'] = true;
             // Bei Templateänderungen sofort neu kompilieren
         }
         static::$twig = new Twig_Environment(static::$loader, $twigSettings);
         // dump()-Methode zur Verfügung stellen
         if (static::DEBUG) {
             static::$twig->addExtension(new Twig_Extension_Debug());
         }
         // EIGENE METHODEN FUER RENDERER ZUWEISEN
         $renderUrl = new Twig_SimpleFunction('url', array('Renderer', 'renderUrl'));
         static::$twig->addFunction($renderUrl);
         $renderPrice = new Twig_SimpleFunction('price', array('Renderer', 'renderPrice'), array('is_safe' => array('html')));
         static::$twig->addFunction($renderPrice);
         $renderLimitUnit = new Twig_SimpleFunction('unit', array('Renderer', 'renderLimitUnit'), array('is_safe' => array('html')));
         static::$twig->addFunction($renderLimitUnit);
         $formatNumber = new Twig_SimpleFunction('formatNumber', array('Renderer', 'formatNumber'));
         static::$twig->addFunction($formatNumber);
         $markError = new Twig_SimpleFunction('markError', array('Renderer', 'markError'));
         static::$twig->addFunction($markError);
         $getError = new Twig_SimpleFunction('getError', array('Renderer', 'getError'));
         static::$twig->addFunction($getError);
     }
 }
開發者ID:enigmatic-user,項目名稱:resellershop,代碼行數:39,代碼來源:renderer.class.php

示例15: _setLoader

 protected static function _setLoader($loader)
 {
     static::$loader = $loader;
 }
開發者ID:sostart,項目名稱:phpkit,代碼行數:4,代碼來源:PHPKit.php


注:本文中的static::loader方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。