예제 #1
0
 /**
  * Define the routes for the application.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function map(Router $router)
 {
     // Module routes.
     $modules = new \Ormic\Modules();
     foreach ($modules->getAll() as $mod) {
         require app_path() . '/../' . $mod . '/Http/routes.php';
     }
     // Core application routes.
     $router->group(['namespace' => $this->namespace], function ($router) {
         require app_path('Http/routes.php');
     });
 }
예제 #2
0
 /**
  * Register any application services.
  *
  * This service provider is a great spot to register your various container
  * bindings with the application. As you can see, we are registering our
  * "Registrar" implementation here. You can add your own bindings too!
  *
  * @return void
  */
 public function register()
 {
     $this->app->bind('Illuminate\\Contracts\\Auth\\Registrar', 'Ormic\\Services\\Registrar');
     $modules = new \Ormic\Modules();
     foreach ($modules->getAll() as $name => $path) {
         $modServiceProvider = 'Ormic\\modules\\' . $name . '\\Providers\\' . studly_case($name) . 'ServiceProvider';
         if (class_exists($modServiceProvider)) {
             $this->app->register($modServiceProvider);
         }
         $viewDir = app_path() . '/../' . $path . '/resources/views';
         $this->loadViewsFrom($viewDir, snake_case($name));
     }
 }
예제 #3
0
파일: Upgrade.php 프로젝트: samwilson/ormic
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $this->call('down');
     $this->info("Upgrading core application.");
     $this->call('migrate');
     $modules = new \Ormic\Modules();
     foreach ($modules->getAll() as $name => $path) {
         $this->info("Upgrading {$name} module.");
         $dbPath = $path . '/database/migrations';
         $this->call('migrate', array('--path' => $dbPath));
     }
     $this->call('up');
 }
예제 #4
0
파일: Kernel.php 프로젝트: samwilson/ormic
 public function __construct(Application $app, Dispatcher $events)
 {
     parent::__construct($app, $events);
     $fs = new Filesystem();
     $modules = new \Ormic\Modules();
     foreach ($modules->getAll() as $name => $path) {
         $commandsDir = app_path() . '/../' . $path . '/Console/Commands';
         $commandFiles = $fs->files($commandsDir);
         foreach ($commandFiles as $commandFile) {
             $command = substr(basename($commandFile), 0, -4);
             $this->commands[] = "Ormic\\modules\\{$name}\\Console\\Commands\\{$command}";
         }
     }
 }