public function __construct(Application $app, Filesystem $files, Dispatcher $events, Translation $translation)
 {
     $this->app = $app;
     $this->files = $files;
     $this->events = $events;
     $this->translation = $translation;
     $this->default_connection = $translation->getConnectionName();
     $this->preloadedGroupKeys = null;
     $this->preloadedGroup = null;
     $this->persistentPrefix = null;
     $this->cache = null;
     $this->usageCache = null;
     $this->package = ManagerServiceProvider::PACKAGE;
     $this->config = $this->app['config'][$this->package];
     $this->indatabase_publish = $this->getConnectionInDatabasePublish($this->default_connection);
     $this->groupList = null;
     $this->augmentedGroupList = null;
     $manager = $this;
     // Laravel 4
     //$app->after(function () use ($manager) {
     // Laravel 5
     $events = \App::make('events');
     $events->listen('router.after', function () use($manager) {
         // Common 4-5
         $manager->saveCache();
         $manager->saveUsageCache();
     });
 }
Ejemplo n.º 2
0
 public function __construct(Application $app, Filesystem $files, Dispatcher $events, Translation $translation)
 {
     $this->app = $app;
     $this->package = ManagerServiceProvider::PACKAGE;
     $this->config = $this->app['config'][$this->package];
     $this->files = $files;
     $this->events = $events;
     $this->translation = $translation;
     $this->default_connection = $translation->getConnectionName();
     $this->default_translation_connection = $this->config(self::DEFAULT_DB_CONNECTION_KEY, null);
     if (!$this->default_translation_connection) {
         $this->default_translation_connection = $this->default_connection;
     } else {
         $this->setConnectionName($this->default_translation_connection);
     }
     $this->preloadedGroupKeys = null;
     $this->preloadedGroup = null;
     $this->persistentPrefix = null;
     $this->cache = null;
     $this->usageCache = null;
     $this->indatabase_publish = $this->getConnectionInDatabasePublish($this->default_translation_connection);
     $this->groupList = null;
     $this->augmentedGroupList = null;
 }