本文整理汇总了PHP中Illuminate\Foundation\Application::register方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::register方法的具体用法?PHP Application::register怎么用?PHP Application::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Foundation\Application
的用法示例。
在下文中一共展示了Application::register方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerServiceProvider
/**
* Register the module service provider.
*
* @param string $properties
* @return string
* @throws \Caffeinated\Modules\Exception\FileMissingException
*/
protected function registerServiceProvider($properties)
{
$namespace = $this->resolveNamespace($properties);
$file = $this->repository->getPath() . "/{$namespace}/Providers/{$namespace}ServiceProvider.php";
$serviceProvider = $this->repository->getNamespace() . "\\" . $namespace . "\\Providers\\{$namespace}ServiceProvider";
$this->app->register($serviceProvider);
}
示例2: createApplication
/**
* Setup the test application
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = new Application();
$app->register(\Illuminate\Database\DatabaseServiceProvider::class);
$app->register(\SeBuDesign\SqlServerGrammar\SqlServerGrammarServiceProvider::class);
return $app;
}
示例3: createApplication
public function createApplication()
{
$app = new Application();
$app->register(\Illuminate\Database\DatabaseServiceProvider::class);
$app->register(\ShiftOneLabs\LaravelNomad\LaravelNomadServiceProvider::class);
return $app;
}
示例4: registerServiceProvider
/**
* Register the module service provider.
*
* @param string $properties
* @return string
* @throws \Fabriciorabelo\Modules\Exception\FileMissingException
*/
protected function registerServiceProvider($properties)
{
$module = studly_case($properties['slug']);
$file = $this->repository->getPath() . "/{$module}/Providers/{$module}ServiceProvider.php";
$namespace = $this->repository->getNamespace() . "\\" . $module . "\\Providers\\{$module}ServiceProvider";
$this->app->register($namespace);
}
示例5: registerServiceProvider
/**
* Register the module service provider.
*
* @param array $module
*
* @return void
*/
private function registerServiceProvider($module)
{
$serviceProvider = module_class($module['slug'], 'Providers\\ModuleServiceProvider');
if (class_exists($serviceProvider)) {
$this->app->register($serviceProvider);
}
}
示例6: setupServiceProvider
private function setupServiceProvider(Application $app)
{
$provider = new ApaiIOServiceProvider($app);
$app->register($provider);
$provider->boot();
return $provider;
}
示例7: setupServiceProvider
public function setupServiceProvider(Application $app)
{
$provider = new StatsdServiceProvider($app);
$app->register($provider);
$provider->boot();
return $provider;
}
示例8: registerProviders
/**
* Register the service providers from this module.
*/
private function registerProviders()
{
foreach ($this->get('providers', []) as $provider) {
if (class_exists($provider)) {
$this->app->register($provider);
}
}
}
示例9: register
/**
* Register all modules
*/
public function register()
{
$this->all()->each(function (Module $module) {
if ($module->hasProvider()) {
$this->app->register($module->getProvider());
}
});
}
示例10: setupServiceProvider
/**
* @param Application $app
*
* @return AwsServiceProvider
*/
private function setupServiceProvider(Application $app)
{
// Create and register the provider.
$provider = new AwsServiceProvider($app);
$app->register($provider);
$provider->boot();
return $provider;
}
示例11: getEnvironmentSetUp
/**
* Define environment setup.
*
* @param \Illuminate\Foundation\Application $app
* @return void
*/
protected function getEnvironmentSetUp($app)
{
// set bindings
$app->register(JsonApiServiceProvider::class);
// Setup default database to use sqlite :memory:
$app['config']->set('database.default', 'testbench');
$app['config']->set('database.connections.testbench', ['driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '']);
$app['config']->set('jsonapi.base_url', 'http://www.test.com');
$app['config']->set('jsonapi.base_path', 'v1');
$app['config']->set('jsonapi.relations.always_show_data', [\Czim\JsonApi\Test\Helpers\Models\TestModel::class => ['testRelatedModels']]);
}
示例12: getEnvironmentSetUp
/**
* Define environment setup.
*
* @param \Illuminate\Foundation\Application $app
*/
protected function getEnvironmentSetUp($app)
{
$app->register(NestedModelUpdaterServiceProvider::class);
// Setup default database to use sqlite :memory:
$app['config']->set('database.default', 'testbench');
$app['config']->set('database.connections.testbench', ['driver' => 'sqlite', 'database' => ':memory:', 'prefix' => '']);
// Setup basic config for nested relation testing
$app['config']->set('nestedmodelupdater.relations', [Author::class => ['posts' => true, 'comments' => ['updater' => AlternativeUpdater::class]], Comment::class => ['author' => true, 'tags' => true], Post::class => ['comments' => true, 'genre' => true, 'authors' => ['link-only' => true], 'tags' => true, 'exceptional_attribute_name' => ['method' => 'someOtherRelationMethod'], 'comment_has_one' => true, 'specials' => true]]);
$app['config']->set('nestedmodelupdater.validation.model-rules-namespace', 'Czim\\NestedModelUpdater\\Test\\Helpers\\Rules');
$app['config']->set('nestedmodelupdater.validation.model-rules-postfix', 'Rules');
$app['config']->set('nestedmodelupdater.validation.allow-missing-rules', true);
}
示例13: registerProviders
/**
* Register service provider for module
* @return void
*/
public function registerProviders()
{
$providers = $this->def('provider');
if ($providers) {
if (is_array($providers)) {
foreach ($providers as $provider) {
$this->app->register($instance = new $provider($this->app));
}
} else {
$this->app->register($instance = new $providers($this->app));
}
}
}
示例14: register
/**
* Register a service provider with the application.
*
* @param \Illuminate\Support\ServiceProvider|string $provider
* @param array $options
* @return \Illuminate\Support\ServiceProvider
* @static
*/
public static function register($provider, $options = array())
{
return \Illuminate\Foundation\Application::register($provider, $options);
}
示例15: setupSessionServiceProvider
/**
* Setup session service provider.
*
* @param Application $app
* @return SessionServiceProvider
*/
protected function setupSessionServiceProvider(Application $app)
{
$session = new SessionServiceProvider($app);
$app->register($session);
return $session;
}