Permalink
Browse files

Add commands loader to console

  • Loading branch information...
andrzejo committed Mar 29, 2017
1 parent b050e5e commit efa679a833b8825eedfd69c343acc7a710ee0587
Showing with 4 additions and 9 deletions.
  1. +3 −7 console
  2. +1 −2 test/Application/config/routes.php
View
10 console
@@ -1,10 +1,8 @@
#!/usr/bin/env php
<?php
use Command\ConsoleCommand;
use Command\ControllerGeneratorCommand;
use Command\ModelGeneratorCommand;
use Command\RoutesCommand;
use Ouzo\Console\CommandsLoader;
use Ouzo\Utilities\Files;
use Ouzo\Utilities\Path;
use Symfony\Component\Console\Application;
putenv('environment=prod');
@@ -16,7 +14,5 @@ require 'vendor/autoload.php';
Files::loadIfExists(ROOT_PATH . 'test/Application/config/routes.php');
$app = new Application();
$app->addCommands([
new ConsoleCommand(), new RoutesCommand(), new ModelGeneratorCommand(), new ControllerGeneratorCommand()
]);
CommandsLoader::forApplication($app)->registerCommandsFromPath(Path::join(ROOT_PATH, "bin"), "\\Command");
$app->run();
@@ -8,9 +8,8 @@
Route::get('/', 'index#index');
Route::allowAll('/users', 'users', ['except' => ['new', 'select_outbound_for_user']]);
Route::get('/agents/index', 'agents#index');
Route::post('/agents/index', 'agents#index');
Route::post('/agents', 'agents#update');
Route::allowAll('/photos', 'photos');
Route::any('/agents/index', 'agents#index');
Route::resource('phones');
Route::get('/agents', 'agents#index', ['as' => 'my_name']);
Route::get('/agents/show/id/:id/call_id/:call_id', 'agents#show');

0 comments on commit efa679a

Please sign in to comment.