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


PHP Foundation\AliasLoader類代碼示例

本文整理匯總了PHP中Illuminate\Foundation\AliasLoader的典型用法代碼示例。如果您正苦於以下問題:PHP AliasLoader類的具體用法?PHP AliasLoader怎麽用?PHP AliasLoader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: getInstance

 /**
  * Get or create the singleton alias loader instance.
  *
  * @param  array  $aliases
  * @return \Illuminate\Foundation\AliasLoader
  */
 public static function getInstance(array $aliases = array())
 {
     if (is_null(static::$instance)) {
         static::$instance = new static($aliases);
     }
     $aliases = array_merge(static::$instance->getAliases(), $aliases);
     static::$instance->setAliases($aliases);
     return static::$instance;
 }
開發者ID:dlpc,項目名稱:O2OMobile_PHP,代碼行數:15,代碼來源:AliasLoader.php

示例2: getInstance

 /**
  * Get or create the singleton alias loader instance.
  *
  * @param  array  $aliases
  * @return \Illuminate\Foundation\AliasLoader
  */
 public static function getInstance(array $aliases = array())
 {
     //單例
     if (is_null(static::$instance)) {
         return static::$instance = new static($aliases);
     }
     $aliases = array_merge(static::$instance->getAliases(), $aliases);
     static::$instance->setAliases($aliases);
     //返回當前類對象,可以做鏈式操作
     return static::$instance;
 }
開發者ID:jellycheng,項目名稱:learnlaravel,代碼行數:17,代碼來源:AliasLoader.php

示例3: register

 public function register()
 {
     $url = parse_url(url()->current());
     if (isset($url['path']) && substr($url['path'], 1, 7) == 'backend') {
         $this->app->register(\Shopvel\ServiceProvider\BackendServiceProvider::class);
     } else {
         $this->app->register(\Shopvel\ServiceProvider\FrontendServiceProvider::class);
     }
     $loader = \Illuminate\Foundation\AliasLoader::getInstance();
     /*
      * Theme Setup
      */
     $loader->alias('Theme', \Shopvel\Facade\ThemeFacade::class);
     $this->app->singleton('shopvel.theme', function () {
         return new \Shopvel\Component\Theme\Themes();
     });
     $this->app->singleton('view.finder', function ($app) {
         $paths = $app['config']['view.paths'];
         return new \Shopvel\Component\Theme\ThemeViewFinder($app['files'], $paths, null, $app['shopvel.theme']);
     });
     $theme = $this->app->make('shopvel.theme');
     $theme->set(Config::get('theme.name'));
     /*
      * Language Setup
      */
     $loader->alias('Language', \Shopvel\Facade\LanguageFacade::class);
     $this->app->singleton('shopvel.language', function () {
         return new \Shopvel\Component\Language\Language();
     });
 }
開發者ID:shopvel,項目名稱:shopvel,代碼行數:30,代碼來源:CoreServiceProvider.php

示例4: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     // Register 'neo4j' instance container to our 'neo4j' object
     $this->app['neo4j'] = $this->app->share(function ($app) {
         // connection credentials loaded from config
         // if neo4j key exists in database.php config use this one
         if (Config::get('database.neo4j') != null) {
             $host = Config::get('database.neo4j.default.host');
             $port = Config::get('database.neo4j.default.port');
             $username = Config::get('database.neo4j.default.username');
             $password = Config::get('database.neo4j.default.password');
             // esle try to find config in packages configs
         } else {
             $host = Config::get('neo4j-4-laravel::default.host');
             $port = Config::get('neo4j-4-laravel::default.port');
             $username = Config::get('neo4j-4-laravel::default.username');
             $password = Config::get('neo4j-4-laravel::default.password');
         }
         // create mew neo4j node
         $neo4j = new Client($host, $port);
         $neo4j->getTransport()->setAuth($username, $password);
         // return pusher
         return $neo4j;
     });
     // Shortcut so developers don't need to add an Alias in app/config/app.php
     $this->app->booting(function () {
         $loader = AliasLoader::getInstance();
         $loader->alias('Neo4j', 'Artdarek\\Neo4j\\Facades\\Neo4j');
     });
 }
開發者ID:artdarek,項目名稱:neo4j-4-laravel,代碼行數:35,代碼來源:Neo4jServiceProvider.php

示例5: boot

 /**
  * Boot the service provider.
  *
  * @return void
  */
 public function boot()
 {
     // Auto create app alias with boot method.
     // Shortcut so developers don't need to add an Alias in app/config/app.php
     $loader = \Illuminate\Foundation\AliasLoader::getInstance();
     $loader->alias('FacebookConnect', 'Pitchanon\\FacebookConnect\\Facades\\FacebookConnect');
 }
開發者ID:centaurustech,項目名稱:musicequity,代碼行數:12,代碼來源:FacebookConnectServiceProvider.php

示例6: register

 /**
  * Register the application services.
  *
  * @return void
  */
 public function register()
 {
     $this->app->register('Illuminate\\Html\\HtmlServiceProvider');
     $loader = \Illuminate\Foundation\AliasLoader::getInstance();
     $loader->alias('HTML', 'Illuminate\\Html\\HtmlFacade');
     $loader->alias('Form', 'Illuminate\\Html\\FormFacade');
 }
開發者ID:ntamvl,項目名稱:admin-panel-generator,代碼行數:12,代碼來源:AdminPanelGeneratorProvider.php

示例7: registerFacade

 /**
  * 注冊門麵(一般將門麵放在config/app.php中注冊)
  *
  * @return void
  */
 public function registerFacade()
 {
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('Power', \Alpfish\Power\Facades\Power::class);
     });
 }
開發者ID:alpfish,項目名稱:alp,代碼行數:12,代碼來源:PowerServiceProvider.php

示例8: registerAliases

 /**
  * Create aliases for the dependency.
  */
 private function registerAliases()
 {
     if (class_exists('Illuminate\\Foundation\\AliasLoader')) {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('Datatables', \Yajra\Datatables\Datatables::class);
     }
 }
開發者ID:nsadeghieh,項目名稱:laravel-datatables,代碼行數:10,代碼來源:DatatablesServiceProvider.php

示例9: registerAliases

 protected function registerAliases()
 {
     $aliases = config('foundation.aliases');
     foreach ($aliases as $alias => $class) {
         AliasLoader::getInstance()->alias($alias, $class);
     }
 }
開發者ID:laravolt,項目名稱:foundation,代碼行數:7,代碼來源:ServiceProvider.php

示例10: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     // Register 'gameanalytics' instance container to our 'gameanalytics' object
     $this->app['gameanalytics'] = $this->app->share(function ($app) {
         // connection credentials loaded from config
         // if gameanalytics key exists in database.php config use this one
         if (Config::get('gameanalytics.game.key') != null) {
             $key = Config::get('gameanalytics.game.key');
             $secret = Config::get('gameanalytics.game.secret');
             $version = Config::get('gameanalytics.api.version');
             $handler = Config::get('gameanalytics.handler');
             // esle try to find config in packages configs
         } else {
             $key = Config::get('ga-4-laravel::game.key');
             $secret = Config::get('ga-4-laravel::game.secret');
             $version = Config::get('ga-4-laravel::api.version');
             $handler = Config::get('ga-4-laravel::handler');
         }
         // create mew gameanalytics node
         $ga = new GameAnalytics($handler);
         $ga->setSecret($secret);
         $ga->setVersion($version);
         $ga->setKey($key);
         // return ga
         return $ga;
     });
     // Shortcut so developers don't need to add an Alias in app/config/app.php
     $this->app->booting(function () {
         $loader = AliasLoader::getInstance();
         $loader->alias('GameAnalytics', 'Artdarek\\GameAnalytics\\Facades\\GameAnalytics');
     });
 }
開發者ID:artdarek,項目名稱:ga-4-laravel,代碼行數:37,代碼來源:GameAnalyticsServiceProvider.php

示例11: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('DataTree', 'Tacone\\RapydDataTree\\DataTree');
     });
 }
開發者ID:tacone,項目名稱:rapyd-datatree,代碼行數:12,代碼來源:RapydDataTreeServiceProvider.php

示例12: register

 /**
  * Register the service provider.
  */
 public function register()
 {
     $this->app->singleton('vinelab.assistant.formatter', function () {
         return new Formatter();
     });
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('Formatter', 'Vinelab\\Assistant\\Facades\\Formatter');
     });
     $this->app->singleton('vinelab.assistant.devicedetector', function () {
         return new DeviceDetector();
     });
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('DeviceDetector', 'Vinelab\\Assistant\\Facades\\DeviceDetector');
     });
     $this->app->singleton('vinelab.assistant.generator', function () {
         return new Generator();
     });
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('Generator', 'Vinelab\\Assistant\\Facades\\Generator');
     });
     $this->app->singleton('vinelab.assistant.address', function () {
         return new Address();
     });
     $this->app->booting(function () {
         $loader = \Illuminate\Foundation\AliasLoader::getInstance();
         $loader->alias('Address', 'Vinelab\\Assistant\\Facades\\Address');
     });
 }
開發者ID:harris21,項目名稱:assistant,代碼行數:34,代碼來源:AssistantServiceProvider.php

示例13: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     // Register the package namespace
     $this->package('torann/hashids');
     // Add 'Assets' facade alias
     AliasLoader::getInstance()->alias('Hashids', 'Torann\\Hashids\\Facade');
 }
開發者ID:lidoma,項目名稱:laravel-hashids,代碼行數:12,代碼來源:HashidsServiceProvider.php

示例14: boot

 /**
  * Perform post-registration booting of services.
  *
  * @return void
  */
 public function boot()
 {
     $loader = AliasLoader::getInstance();
     // Add 'Form' and 'Html' facade aliases
     $loader->alias('Form', 'Illuminate\\Html\\FormFacade');
     $loader->alias('Html', 'Illuminate\\Html\\HtmlFacade');
 }
開發者ID:stolz,項目名稱:laravel-form-builder,代碼行數:12,代碼來源:ServiceProvider.php

示例15: registerAlias

 /**
  * Register the alias for package.
  *
  * @return void
  */
 protected function registerAlias()
 {
     $this->app->booting(function () {
         $loader = AliasLoader::getInstance();
         $loader->alias('Steam', 'Syntax\\SteamApi\\Facades\\SteamApi');
     });
 }
開發者ID:adamdburton,項目名稱:Steam,代碼行數:12,代碼來源:SteamApiServiceProvider.php


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