当前位置: 首页>>代码示例>>PHP>>正文


PHP Application::register方法代码示例

本文整理汇总了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);
 }
开发者ID:mubassirhayat,项目名称:modules,代码行数:14,代码来源:Modules.php

示例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;
 }
开发者ID:sebudesign,项目名称:laravel-sql-server-grammar,代码行数:12,代码来源:TestCase.php

示例3: createApplication

 public function createApplication()
 {
     $app = new Application();
     $app->register(\Illuminate\Database\DatabaseServiceProvider::class);
     $app->register(\ShiftOneLabs\LaravelNomad\LaravelNomadServiceProvider::class);
     return $app;
 }
开发者ID:shiftonelabs,项目名称:laravel-nomad,代码行数:7,代码来源:TestCase.php

示例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);
 }
开发者ID:fabriciorabelo,项目名称:modules,代码行数:14,代码来源:Modules.php

示例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);
     }
 }
开发者ID:caffeinated,项目名称:modules,代码行数:14,代码来源:Modules.php

示例6: setupServiceProvider

 private function setupServiceProvider(Application $app)
 {
     $provider = new ApaiIOServiceProvider($app);
     $app->register($provider);
     $provider->boot();
     return $provider;
 }
开发者ID:rezzafr33,项目名称:apaiio-laravel,代码行数:7,代码来源:ApaiIOServiceProviderTest.php

示例7: setupServiceProvider

 public function setupServiceProvider(Application $app)
 {
     $provider = new StatsdServiceProvider($app);
     $app->register($provider);
     $provider->boot();
     return $provider;
 }
开发者ID:threesquared,项目名称:statsd,代码行数:7,代码来源:LaravelTestCase.php

示例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);
         }
     }
 }
开发者ID:arcanedev,项目名称:workbench,代码行数:11,代码来源:Module.php

示例9: register

 /**
  * Register all modules
  */
 public function register()
 {
     $this->all()->each(function (Module $module) {
         if ($module->hasProvider()) {
             $this->app->register($module->getProvider());
         }
     });
 }
开发者ID:arcanedev,项目名称:moduly,代码行数:11,代码来源:Moduly.php

示例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;
 }
开发者ID:phazei,项目名称:aws-sdk-php-laravel,代码行数:13,代码来源:AwsServiceProviderTest.php

示例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']]);
 }
开发者ID:czim,项目名称:laravel-jsonapi,代码行数:17,代码来源:TestCase.php

示例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);
 }
开发者ID:czim,项目名称:laravel-nestedupdater,代码行数:17,代码来源:TestCase.php

示例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));
         }
     }
 }
开发者ID:huycao,项目名称:yoplatform,代码行数:17,代码来源:Module.php

示例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);
 }
开发者ID:jorzhikgit,项目名称:MLM-Nexus,代码行数:12,代码来源:_ide_helper.php

示例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;
 }
开发者ID:elevencodes,项目名称:instagram-laravel,代码行数:12,代码来源:InstagramTestCase.php


注:本文中的Illuminate\Foundation\Application::register方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。