Permalink
Please sign in to comment.
Showing
with
154 additions
and 129 deletions.
- +45 β0 CD-collection/app/Booting.php
- +0 β40 CD-collection/app/bootstrap.php
- +3 β0 CD-collection/composer.json
- +6 β4 CD-collection/www/index.php
- +32 β0 Fifteen/app/Booting.php
- +0 β31 Fifteen/app/bootstrap.php
- +3 β0 Fifteen/composer.json
- +6 β4 Fifteen/www/index.php
- +50 β0 Modules-Usage/app/Booting.php
- +0 β46 Modules-Usage/app/bootstrap.php
- +3 β0 Modules-Usage/composer.json
- +6 β4 Modules-Usage/www/index.php
@@ -0,0 +1,45 @@ | |||
<?php | |||
declare(strict_types=1); | |||
namespace App; | |||
use Nette\Application\Routers\Route; | |||
use Nette\Application\Routers\RouteList; | |||
use Nette\Application\Routers\SimpleRouter; | |||
use Nette\Configurator; | |||
class Booting | |||
{ | |||
public static function boot(): Configurator | |||
{ | |||
$configurator = new Configurator; | |||
// Enable Tracy for error visualisation & logging | |||
//$configurator->setDebugMode('23.75.345.200'); // enable for your remote IP | |||
$configurator->enableTracy(__DIR__ . '/../log'); | |||
// Enable RobotLoader - this will load all classes automatically | |||
$configurator->setTempDirectory(__DIR__ . '/../temp'); | |||
$configurator->createRobotLoader() | |||
->addDirectory(__DIR__) | |||
->register(); | |||
// Create Dependency Injection container from config.neon file | |||
$configurator->addConfig(__DIR__ . '/config.neon'); | |||
// Setup router using mod_rewrite detection | |||
if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules(), true)) { | |||
$router = new RouteList; | |||
$router[] = new Route('index.php', 'Dashboard:default', Route::ONE_WAY); | |||
$router[] = new Route('<presenter>/<action>[/<id>]', 'Dashboard:default'); | |||
} else { | |||
$router = new SimpleRouter('Dashboard:default'); | |||
} | |||
$configurator->addServices(['router' => $router]); | |||
return $configurator; | |||
} | |||
} |
@@ -0,0 +1,32 @@ | |||
<?php | |||
declare(strict_types=1); | |||
namespace App; | |||
use Nette\Application\Routers\SimpleRouter; | |||
use Nette\Configurator; | |||
class Booting | |||
{ | |||
public static function boot(): Configurator | |||
{ | |||
$configurator = new Configurator; | |||
// Enable Tracy for error visualisation & logging | |||
//$configurator->setDebugMode('23.75.345.200'); // enable for your remote IP | |||
$configurator->enableTracy(__DIR__ . '/../log'); | |||
// Enable RobotLoader - this will load all classes automatically | |||
$configurator->setTempDirectory(__DIR__ . '/../temp'); | |||
$configurator->createRobotLoader() | |||
->addDirectory(__DIR__) | |||
->register(); | |||
// Setup router | |||
$configurator->addServices(['router' => new SimpleRouter('Default:default')]); | |||
return $configurator; | |||
} | |||
} |
@@ -0,0 +1,50 @@ | |||
<?php | |||
declare(strict_types=1); | |||
namespace App; | |||
use Nette\Application\Routers\Route; | |||
use Nette\Application\Routers\RouteList; | |||
use Nette\Application\Routers\SimpleRouter; | |||
use Nette\Configurator; | |||
class Booting | |||
{ | |||
public static function boot(): Configurator | |||
{ | |||
$configurator = new Configurator; | |||
// Enable Tracy for error visualisation & logging | |||
//$configurator->setDebugMode('23.75.345.200'); // enable for your remote IP | |||
$configurator->enableTracy(__DIR__ . '/../log'); | |||
// Enable RobotLoader - this will load all classes automatically | |||
$configurator->setTempDirectory(__DIR__ . '/../temp'); | |||
$configurator->createRobotLoader() | |||
->addDirectory(__DIR__) | |||
->register(); | |||
// Create Dependency Injection container from config.neon file | |||
$configurator->addConfig(__DIR__ . '/config.neon'); | |||
// Setup router using mod_rewrite detection | |||
if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules(), true)) { | |||
$router = new RouteList; | |||
$router[] = new Route('index.php', 'Front:Default:default', Route::ONE_WAY); | |||
$router[] = $adminRouter = new RouteList('Admin'); | |||
$adminRouter[] = new Route('admin/<presenter>/<action>', 'Default:default'); | |||
$router[] = $frontRouter = new RouteList('Front'); | |||
$frontRouter[] = new Route('<presenter>/<action>[/<id>]', 'Default:default'); | |||
} else { | |||
$router = new SimpleRouter('Front:Default:default'); | |||
} | |||
$configurator->addServices(['router' => $router]); | |||
return $configurator; | |||
} | |||
} |
0 comments on commit
c0c1257