本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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');
}
示例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);
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}
示例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);
}