|
1 | 1 | <?php
|
2 | 2 |
|
3 |
| -class App_Bootstrap { |
| 3 | +namespace App; |
| 4 | + |
| 5 | +class Bootstrap { |
4 | 6 | public static function Init () {
|
5 |
| - $app = MvcCore::GetInstance(); |
| 7 | + $app = \MvcCore::GetInstance(); |
6 | 8 |
|
7 | 9 | // patch core to use extended debug class
|
8 |
| - if (class_exists('MvcCoreExt_Tracy')) { |
9 |
| - MvcCoreExt_Tracy::$Editor = 'MSVS2015'; |
10 |
| - $app->SetDebugClass('MvcCoreExt_Tracy'); |
| 10 | + if (class_exists('\MvcCore\Ext\Debug\Tracy')) { |
| 11 | + \MvcCore\Ext\Debug\Tracy::$Editor = 'MSVS2015'; |
| 12 | + $app->SetDebugClass(\MvcCore\Ext\Debug\Tracy::class); |
11 | 13 | }
|
12 | 14 |
|
13 | 15 | $app
|
14 |
| - ->SetRouterClass(MvcCoreExt_LangRouter::class) |
15 |
| - ->SetDefaultControllerName('Front_Index'); |
| 16 | + ->SetRouterClass(\MvcCore\Ext\Router\Lang::class) |
| 17 | + ->SetDefaultControllerName('Front\Index'); |
16 | 18 |
|
17 | 19 | // use this line only if you want to pack application without JS/CSS/fonts/images
|
18 | 20 | // inside package and you want to have all those files placed on hard drive manualy
|
19 | 21 | // you can use this variant in modes PHP_PRESERVE_PACKAGE, PHP_PRESERVE_HDD and PHP_STRICT_HDD
|
20 | 22 | //MvcCoreExt_ViewHelpers_Assets::SetAssetUrlCompletion(FALSE);
|
21 | 23 |
|
22 |
| - // add another view helper namespace |
23 |
| - MvcCore_View::AddHelpersClassBases('MvcCoreExt_ViewHelpers'); |
24 |
| - |
25 |
| - /** @var $router MvcCoreExt_LangRouter */ |
26 |
| - $router = & MvcCore_Router::GetInstance(); |
| 24 | + /** @var $router \MvcCore\Ext\Router\Lang */ |
| 25 | + $router = & \MvcCore\Router::GetInstance(); |
27 | 26 | $router
|
28 | 27 | ->SetAllowedLangs('en', 'cs')
|
29 | 28 | ->SetFirstRequestStrictlyByUserAgent()
|
30 | 29 | ->SetRoutes(array(
|
31 |
| - 'Admin_Index:Index' => array( |
| 30 | + 'Admin\Index:Index' => array( |
32 | 31 | 'pattern' => "#^/admin#",
|
33 | 32 | ),
|
34 |
| - 'Front_Index:Index' => new MvcCoreExt_LangRouter_Route(array( |
35 |
| - 'name' => 'Front_Index:Index', |
| 33 | + 'Front\Index:Index' => new \MvcCore\Ext\Router\Lang\Route(array( |
| 34 | + 'controller' => 'Front\Index', |
| 35 | + 'action' => 'Index', |
36 | 36 | 'pattern' => "#^([a-zA-Z0-9/_\-]*)#",
|
37 | 37 | 'reverse' => '{%path}',
|
38 | 38 | )),
|
|
0 commit comments