当前位置: 首页>>代码示例>>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;未经允许,请勿转载。