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


PHP Application::alias方法代碼示例

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


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

示例1: registerLogger

 /**
  * Register the logger class.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerLogger(Application $app)
 {
     $app->singleton('logger', function ($app) {
         $loggers = [];
         foreach ($app->config->get('logger.loggers', []) as $logger => $levels) {
             $loggers[] = new LevelAwareLogger($app->make($logger), (array) $levels);
         }
         return new LoggerWrapper($loggers);
     });
     $app->alias('logger', LoggerWrapper::class);
     $app->alias('logger', LoggerInterface::class);
     $app->alias('logger', Log::class);
 }
開發者ID:nikhilben,項目名稱:Logger,代碼行數:20,代碼來源:LoggerServiceProvider.php

示例2: registerUserVerification

 /**
  * Register the user verification.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerUserVerification(Application $app)
 {
     $app->bind('user.verification', function ($app) {
         return new UserVerification(app()->make('mailer'), app()->make('db')->connection()->getSchemaBuilder());
     });
     $app->alias('user.verification', UserVerification::class);
 }
開發者ID:tshafer,項目名稱:laravel-user-verification,代碼行數:14,代碼來源:UserVerificationServiceProvider.php

示例3: registerGitlib

 /**
  * Register the git client class.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerGitlib(Application $app)
 {
     $app->singleton('gitlib', function ($app) {
         return new BaseClient(null);
     });
     $app->alias('gitlib', BaseClient::class);
 }
開發者ID:phecho,項目名稱:Gitlib,代碼行數:14,代碼來源:GitlibServiceProvider.php

示例4: registerBindings

 /**
  * Register the bindings.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerBindings(Application $app)
 {
     $app->bind('telegram.bot', function ($app) {
         $manager = $app['telegram'];
         return $manager->bot();
     });
     $app->alias('telegram.bot', Api::class);
 }
開發者ID:emayk,項目名稱:telegram-bot-sdk,代碼行數:15,代碼來源:TelegramServiceProvider.php

示例5: registerSecurity

 /**
  * Register the security class.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerSecurity(Application $app)
 {
     $app->singleton('security', function ($app) {
         $evil = $app->config->get('security.evil');
         return new Security($evil);
     });
     $app->alias('security', Security::class);
 }
開發者ID:ssomenzi,項目名稱:silence,代碼行數:15,代碼來源:SecurityServiceProvider.php

示例6: registerBindings

 /**
  * Register the bindings.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerBindings(Application $app)
 {
     $app->bind('cachet.connection', function ($app) {
         $manager = $app['cachet'];
         return $manager->connection();
     });
     $app->alias('cachet.connection', CachetConnection::class);
 }
開發者ID:nikkiii,項目名稱:laravel-cachet,代碼行數:15,代碼來源:CachetServiceProvider.php

示例7: registerManager

 /**
  * Register the manager class.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerManager(Application $app)
 {
     $app->singleton('pusher', function ($app) {
         $config = $app['config'];
         $factory = $app['pusher.factory'];
         return new PusherManager($config, $factory);
     });
     $app->alias('pusher', 'Vinkla\\Pusher\\PusherManager');
 }
開發者ID:huseyinbabal,項目名稱:RealtimeChatLaravel,代碼行數:16,代碼來源:PusherServiceProvider.php

示例8: registerUrlShortener

 /**
  * @param Application $app
  */
 private function registerUrlShortener($app)
 {
     $this->mergeConfigFrom(__DIR__ . '/../lj-shortener.php', 'lj-shortener');
     $app->singleton('lj.shortener', function () {
         $cfg = config('lj-shortener');
         return new Shortener(null, false, $cfg);
     });
     $app->alias('lj.shortener', Shortener::class);
 }
開發者ID:laravel-junkies,項目名稱:url-shortener,代碼行數:12,代碼來源:UrlShortenerProvider.php

示例9: registerManager

 /**
  * Register the manager class.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerManager(Application $app)
 {
     $app->singleton('hashids', function ($app) {
         $config = $app['config'];
         $factory = $app['hashids.factory'];
         return new HashidsManager($config, $factory);
     });
     $app->alias('hashids', 'Vinkla\\Hashids\\HashidsManager');
 }
開發者ID:htien,項目名稱:hashids,代碼行數:16,代碼來源:HashidsServiceProvider.php

示例10: registerManager

 /**
  * Register the manager class.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerManager(Application $app)
 {
     $app->singleton('twitter', function ($app) {
         $config = $app['config'];
         $factory = $app['twitter.factory'];
         return new TwitterManager($config, $factory);
     });
     $app->alias('twitter', 'EliuFlorez\\Twitter\\TwitterManager');
 }
開發者ID:eliuflorez,項目名稱:twitter,代碼行數:16,代碼來源:TwitterServiceProvider.php

示例11: registerManager

 /**
  * Register the manager class.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerManager(Application $app)
 {
     $app->singleton('flysystem', function ($app) {
         $config = $app['config'];
         $factory = $app['flysystem.factory'];
         return new FlysystemManager($config, $factory);
     });
     $app->alias('flysystem', 'GrahamCampbell\\Flysystem\\FlysystemManager');
 }
開發者ID:kurtinau,項目名稱:titanium,代碼行數:16,代碼來源:FlysystemServiceProvider.php

示例12: registerManager

 /**
  * Register the manager class.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerManager(Application $app)
 {
     $app->singleton('vimeo', function ($app) {
         $config = $app['config'];
         $factory = $app['vimeo.factory'];
         return new VimeoManager($config, $factory);
     });
     $app->alias('vimeo', 'Vinkla\\Vimeo\\VimeoManager');
 }
開發者ID:emtudo,項目名稱:vimeo,代碼行數:16,代碼來源:VimeoServiceProvider.php

示例13: registerManager

 /**
  * Register the manager class.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerManager(Application $app)
 {
     $app->singleton('opensearch', function ($app) {
         $config = $app['config'];
         $factory = $app['opensearch.factory'];
         return new OpensearchManager($config, $factory);
     });
     $app->alias('opensearch', 'Orzcc\\Opensearch\\OpensearchManager');
 }
開發者ID:orzcc,項目名稱:aliyun-opensearch,代碼行數:16,代碼來源:OpensearchServiceProvider.php

示例14: registerManager

 /**
  * Register the manager class.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerManager(Application $app)
 {
     $app->singleton('topclient', function ($app) {
         $config = $app['config'];
         $factory = $app['topclient.factory'];
         return new TopClientManager($config, $factory);
     });
     $app->alias('topclient', 'Orzcc\\TopClient\\TopClientManager');
 }
開發者ID:ricoa,項目名稱:taobao-top-client,代碼行數:16,代碼來源:TopClientServiceProvider.php

示例15: registerManager

 /**
  * Register the manager class.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function registerManager(Application $app)
 {
     $app->singleton('vineq', function ($app) {
         $factory = $app['vineq.factory'];
         $manager = new VineQManager($factory);
         return $manager->createConnection();
     });
     $app->alias('vineq', VineQ::class);
 }
開發者ID:heosua91,項目名稱:vine-q,代碼行數:16,代碼來源:VineQServiceProvider.php


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