本文整理汇总了PHP中Illuminate\Foundation\AliasLoader类的典型用法代码示例。如果您正苦于以下问题:PHP AliasLoader类的具体用法?PHP AliasLoader怎么用?PHP AliasLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AliasLoader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: registerFacade
/**
* Register the Notify:: facade
*/
private function registerFacade()
{
$this->app->booting(function () {
$loader = AliasLoader::getInstance();
$loader->alias('GsalesApiClient', 'Rokde\\Gsales\\Api\\Supports\\Laravel\\GsalesApiClientFacade');
});
}
开发者ID:cwd,项目名称:gsales-api-client,代码行数:10,代码来源:LaravelGsalesApiClientServiceProvider.php
示例17: register
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$container = \Illuminate\Container\Container::getInstance();
$container->singleton('tckimlik', 'MuratUnal\\TcKimlik\\TcKimlik');
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('TcKimlik', "MuratUnal\\TcKimlik\\Laravel\\Facade\\TcKimlik");
}
开发者ID:muratunal,项目名称:tckimlik,代码行数:12,代码来源:TCKimlikServiceProvider.php
示例18: registerFacade
/**
* Register the vault facade without the user having to add it to the app.php file.
*
* @return void
*/
public function registerFacade()
{
$this->app->booting(function () {
$loader = AliasLoader::getInstance();
$loader->alias('Aio', 'App\\Services\\Aio\\Facades\\Aio');
});
}
开发者ID:herzcthu,项目名称:Laravel-HS,代码行数:12,代码来源:AioServiceProvider.php
示例19: registerFacade
/**
* Register the vault facade without the user having to add it to the app.php file.
*
* @return void
*/
public function registerFacade()
{
$this->app->booting(function () {
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('Access', \App\Services\Access\Facades\Access::class);
});
}
开发者ID:binaryk,项目名称:terenuripedia,代码行数:12,代码来源:AccessServiceProvider.php
示例20: register
/**
* Register the service provider.
*/
public function register()
{
$this->app->register('Vinelab\\Http\\HttpServiceProvider');
$this->app->register('Vinelab\\Assistant\\AssistantServiceProvider');
$this->app->bind('Vinelab\\Auth\\Contracts\\StoreInterface', function (App $app) {
return new Store($app->make('cache'));
});
$this->app->bind('Vinelab\\Auth\\Social\\Providers\\Twitter\\Contracts\\OAuthSignatureInterface', 'Vinelab\\Auth\\Social\\Providers\\Twitter\\OAuthSignature');
$this->app->bind('Vinelab\\Auth\\Social\\Providers\\Twitter\\Contracts\\OAuthConsumerInterface', 'Vinelab\\Auth\\Social\\Providers\\Twitter\\OAuthConsumer');
$this->app->bind('Vinelab\\Auth\\Social\\Providers\\Twitter\\Contracts\\OAuthTokenInterface', 'Vinelab\\Auth\\Social\\Providers\\Twitter\\OAuthToken');
$this->app->bind('Vinelab\\Auth\\Social\\Providers\\Twitter\\Contracts\\OAuthInterface', 'Vinelab\\Auth\\Social\\Providers\\Twitter\\OAuth');
$this->app->singleton('Vinelab\\Auth\\Contracts\\ProvidersManagerInterface', function (App $app) {
return new ProvidersManager($app->make('config'), $app->make('redirect'), $app->make('vinelab.httpclient'), $app->make('Vinelab\\Auth\\Contracts\\StoreInterface'), $app->make('Vinelab\\Auth\\Contracts\\ProfileInterface'), $app->make('Vinelab\\Auth\\Social\\Providers\\Facebook\\Contracts\\AccessTokenInterface'), $app->make('Vinelab\\Auth\\Social\\Providers\\Twitter\\Contracts\\OAuthInterface'), $app->make('Vinelab\\Auth\\Social\\Providers\\Twitter\\Contracts\\OAuthTokenInterface'), $app->make('Vinelab\\Auth\\Social\\Providers\\Twitter\\Contracts\\OAuthSignatureInterface'), $app->make('Vinelab\\Auth\\Social\\Providers\\Twitter\\Contracts\\OAuthConsumerInterface'));
});
$this->app->bind('Vinelab\\Auth\\Contracts\\ProfileInterface', 'Vinelab\\Auth\\Social\\Profile');
$this->app->bind('Vinelab\\Auth\\Social\\Providers\\Facebook\\Contracts\\AccessTokenInterface', 'Vinelab\\Auth\\Social\\Providers\\Facebook\\AccessToken');
// Expose the Facade
$this->app->bind('vinelab.socialauth', function (App $app) {
return new Auth($app->make('config'), $app->make('redirect'), $app->make('vinelab.httpclient'), $app->make('Vinelab\\Auth\\Contracts\\ProvidersManagerInterface'));
});
$this->app->booting(function () {
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
$loader->alias('SocialAuth', 'Vinelab\\Auth\\Facades\\Auth');
});
}
开发者ID:vinelab,项目名称:social-auth,代码行数:28,代码来源:AuthServiceProvider.php
注:本文中的Illuminate\Foundation\AliasLoader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论