Esempio n. 1
0
 /**
  * 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);
 }
 /**
  * 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;
 }
Esempio n. 3
0
 public function createApplication()
 {
     $app = new Application();
     $app->register(\Illuminate\Database\DatabaseServiceProvider::class);
     $app->register(\ShiftOneLabs\LaravelNomad\LaravelNomadServiceProvider::class);
     return $app;
 }
Esempio n. 4
0
 /**
  * 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);
 }
Esempio n. 5
0
 /**
  * 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);
     }
 }
 private function setupServiceProvider(Application $app)
 {
     $provider = new ApaiIOServiceProvider($app);
     $app->register($provider);
     $provider->boot();
     return $provider;
 }
Esempio n. 7
0
 public function setupServiceProvider(Application $app)
 {
     $provider = new StatsdServiceProvider($app);
     $app->register($provider);
     $provider->boot();
     return $provider;
 }
Esempio n. 8
0
 /**
  * Register the service providers from this module.
  */
 private function registerProviders()
 {
     foreach ($this->get('providers', []) as $provider) {
         if (class_exists($provider)) {
             $this->app->register($provider);
         }
     }
 }
Esempio n. 9
0
 /**
  * Register all modules
  */
 public function register()
 {
     $this->all()->each(function (Module $module) {
         if ($module->hasProvider()) {
             $this->app->register($module->getProvider());
         }
     });
 }
 /**
  * @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;
 }
Esempio n. 11
0
 /**
  * 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']]);
 }
Esempio n. 12
0
 /**
  * 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);
 }
Esempio n. 13
0
 /**
  * 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));
         }
     }
 }
Esempio n. 14
0
 /**
  * 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);
 }
 /**
  * Setup session service provider.
  *
  * @param 	Application  	$app
  * @return 	SessionServiceProvider
  */
 protected function setupSessionServiceProvider(Application $app)
 {
     $session = new SessionServiceProvider($app);
     $app->register($session);
     return $session;
 }
Esempio n. 16
0
 /**
  * Register theme service provider to composer
  *
  * @param Application $app
  */
 public function registerNamespace($theme, Application $app)
 {
     $loader = (require base_path() . '/vendor/autoload.php');
     $namespace = 'Themes\\' . ucfirst($theme);
     $loader->setPsr4($namespace . "\\", $this->finder->getThemePath($theme));
     $provider = $namespace . '\\ThemeServiceProvider';
     $app->register(new $provider($app));
 }
Esempio n. 17
0
 public function testServiceProvidersAreCorrectlyRegistered()
 {
     $provider = m::mock('Illuminate\\Support\\ServiceProvider');
     $class = get_class($provider);
     $provider->shouldReceive('register')->once();
     $app = new Application();
     $app->register($provider);
     $this->assertTrue(in_array($class, $app->getLoadedProviders()));
 }
Esempio n. 18
0
 /**
  * Registers the service provider.
  * @return mixed
  */
 public function registerServiceProvider()
 {
     $provider = 'Modules\\' . $this->name . '\\Providers\\' . $this->name . 'ServiceProvider';
     return $this->app->register($provider);
 }
Esempio n. 19
0
 protected function registerLoadEvents(Application $app, $provider, array $events)
 {
     if (count($events) < 1) {
         return;
     }
     $app->make('events')->listen($events, function () use($app, $provider) {
         $app->register($provider);
     });
 }
Esempio n. 20
0
 /**
  * Register the service providers from this module.
  */
 protected function registerProviders()
 {
     foreach ($this->get('providers', []) as $provider) {
         $this->app->register($provider);
     }
 }
Esempio n. 21
0
 /**
  * @param \Illuminate\Foundation\Application $app
  *
  * @return $this
  */
 public function register($app)
 {
     if (!$this->isRegistered) {
         $this->loadSystemRoutes($app['router']);
         $serviceProviderPath = $this->getServiceProviderPath();
         if (is_file($serviceProviderPath)) {
             $app->register($this->getNamespace() . '\\Providers\\ModuleServiceProvider');
         }
         $this->isRegistered = true;
     }
     return $this;
 }
Esempio n. 22
0
 /**
  * Register a service provider with the application.
  *
  * @param \Illuminate\Support\ServiceProvider|string $provider
  * @param array $options
  * @param bool $force
  * @return \Illuminate\Support\ServiceProvider 
  * @static 
  */
 public static function register($provider, $options = array(), $force = false)
 {
     return \Illuminate\Foundation\Application::register($provider, $options, $force);
 }
Esempio n. 23
0
 /**
  * Define environment setup.
  *
  * @param  \Illuminate\Foundation\Application   $app
  *
  * @return void
  */
 protected function getEnvironmentSetUp($app)
 {
     $app->register(ServiceServiceProvider::class);
 }