21
21
/**
22
22
* Bootstrap. Provides common functionality including dependency checking
23
23
* algorithms and the ability to load bootstrap resources on demand.
24
- *
25
- * @package Core
26
24
*/
27
25
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
28
26
{
@@ -73,8 +71,8 @@ protected function _initConfig()
73
71
Zend_Registry::set ('configCore ' , $ configCore );
74
72
75
73
// check if internationalization enabled
76
- if (isset ($ configCore ->internationalization ) && $ configCore ->internationalization == " 0 " ) {
77
- $ configGlobal ->application ->lang = " en " ;
74
+ if (isset ($ configCore ->internationalization ) && $ configCore ->internationalization == ' 0 ' ) {
75
+ $ configGlobal ->application ->lang = ' en ' ;
78
76
}
79
77
80
78
$ config = new Zend_Config_Ini (APPLICATION_CONFIG , $ configGlobal ->environment , true );
@@ -194,7 +192,7 @@ protected function _initZFDebug()
194
192
'Exception ' ,
195
193
'File ' => array ('basePath ' => BASE_PATH ),
196
194
'Html ' ,
197
- )
195
+ ),
198
196
);
199
197
200
198
$ debug = new ZFDebug_Controller_Plugin_Debug ($ options );
@@ -289,36 +287,36 @@ protected function _initRouter()
289
287
$ apiModules = array ();
290
288
foreach ($ modules as $ key => $ module ) {
291
289
if ($ module == 1 && file_exists (BASE_PATH .'/modules/ ' .$ key ) && file_exists (
292
- BASE_PATH ." /modules/ " .$ key ." /AppController.php "
290
+ BASE_PATH .' /modules/ ' .$ key .' /AppController.php '
293
291
)
294
292
) {
295
293
$ listeModule [] = $ key ;
296
294
// get web API controller directories and web API module names for enabled modules
297
- if (file_exists (BASE_PATH ." /modules/ " .$ key ." /controllers/api " )) {
295
+ if (file_exists (BASE_PATH .' /modules/ ' .$ key .' /controllers/api ' )) {
298
296
$ frontController ->addControllerDirectory (
299
- BASE_PATH ." /modules/ " .$ key ." /controllers/api " ,
300
- " api " .$ key
297
+ BASE_PATH .' /modules/ ' .$ key .' /controllers/api ' ,
298
+ ' api ' .$ key
301
299
);
302
300
$ apiModules [] = $ key ;
303
301
}
304
302
} elseif ($ module == 1 && file_exists (BASE_PATH .'/privateModules/ ' .$ key ) && file_exists (
305
- BASE_PATH ." /privateModules/ " .$ key ." /AppController.php "
303
+ BASE_PATH .' /privateModules/ ' .$ key .' /AppController.php '
306
304
)
307
305
) {
308
306
$ listeModule [] = $ key ;
309
307
// get web API controller directories and web API module names for enabled modules
310
- if (file_exists (BASE_PATH ." /privateModules/ " .$ key ." /controllers/api " )) {
308
+ if (file_exists (BASE_PATH .' /privateModules/ ' .$ key .' /controllers/api ' )) {
311
309
$ frontController ->addControllerDirectory (
312
- BASE_PATH ." /privateModules/ " .$ key ." /controllers/api " ,
313
- " api " .$ key
310
+ BASE_PATH .' /privateModules/ ' .$ key .' /controllers/api ' ,
311
+ ' api ' .$ key
314
312
);
315
313
$ apiModules [] = $ key ;
316
314
}
317
315
}
318
316
}
319
317
320
318
// get web API controller directory for core APIs
321
- require_once BASE_PATH ." /core/ApiController.php " ;
319
+ require_once BASE_PATH .' /core/ApiController.php ' ;
322
320
$ frontController ->addControllerDirectory (BASE_PATH .'/core/controllers/api ' , 'rest ' );
323
321
// add RESTful route for web APIs
324
322
$ restRoute = new Zend_Rest_Route ($ frontController , array (), array ('rest ' ));
@@ -328,63 +326,63 @@ protected function _initRouter()
328
326
$ route = $ m ;
329
327
$ nameModule = $ m ;
330
328
$ router ->addRoute (
331
- $ nameModule ." -1 " ,
329
+ $ nameModule .' -1 ' ,
332
330
new Zend_Controller_Router_Route (
333
- "" .$ route ." /:controller/:action/* " , array ('module ' => $ nameModule )
331
+ '' .$ route .' /:controller/:action/* ' , array ('module ' => $ nameModule )
334
332
)
335
333
);
336
334
$ router ->addRoute (
337
- $ nameModule ." -2 " ,
335
+ $ nameModule .' -2 ' ,
338
336
new Zend_Controller_Router_Route (
339
- "" .$ route ." /:controller/ " ,
337
+ '' .$ route .' /:controller/ ' ,
340
338
array ('module ' => $ nameModule , 'action ' => 'index ' )
341
339
)
342
340
);
343
341
$ router ->addRoute (
344
- $ nameModule ." -3 " ,
342
+ $ nameModule .' -3 ' ,
345
343
new Zend_Controller_Router_Route (
346
- "" .$ route ." / " ,
344
+ '' .$ route .' / ' ,
347
345
array ('module ' => $ nameModule , 'controller ' => 'index ' , 'action ' => 'index ' )
348
346
)
349
347
);
350
348
351
- if (file_exists (BASE_PATH ." /modules/ " .$ route ." /AppController.php " )) {
352
- require_once BASE_PATH ." /modules/ " .$ route ." /AppController.php " ;
349
+ if (file_exists (BASE_PATH .' /modules/ ' .$ route .' /AppController.php ' )) {
350
+ require_once BASE_PATH .' /modules/ ' .$ route .' /AppController.php ' ;
353
351
}
354
- if (file_exists (BASE_PATH ." /modules/ " .$ route ." /models/AppDao.php " )) {
355
- require_once BASE_PATH ." /modules/ " .$ route ." /models/AppDao.php " ;
352
+ if (file_exists (BASE_PATH .' /modules/ ' .$ route .' /models/AppDao.php ' )) {
353
+ require_once BASE_PATH .' /modules/ ' .$ route .' /models/AppDao.php ' ;
356
354
}
357
- if (file_exists (BASE_PATH ." /modules/ " .$ route ." /models/AppModel.php " )) {
358
- require_once BASE_PATH ." /modules/ " .$ route ." /models/AppModel.php " ;
355
+ if (file_exists (BASE_PATH .' /modules/ ' .$ route .' /models/AppModel.php ' )) {
356
+ require_once BASE_PATH .' /modules/ ' .$ route .' /models/AppModel.php ' ;
359
357
}
360
- if (file_exists (BASE_PATH ." /modules/ " .$ route ." /constant/module.php " )) {
361
- require_once BASE_PATH ." /modules/ " .$ route ." /constant/module.php " ;
358
+ if (file_exists (BASE_PATH .' /modules/ ' .$ route .' /constant/module.php ' )) {
359
+ require_once BASE_PATH .' /modules/ ' .$ route .' /constant/module.php ' ;
362
360
}
363
361
364
- if (file_exists (BASE_PATH ." /privateModules/ " .$ route ." /AppController.php " )) {
365
- require_once BASE_PATH ." /privateModules/ " .$ route ." /AppController.php " ;
362
+ if (file_exists (BASE_PATH .' /privateModules/ ' .$ route .' /AppController.php ' )) {
363
+ require_once BASE_PATH .' /privateModules/ ' .$ route .' /AppController.php ' ;
366
364
}
367
- if (file_exists (BASE_PATH ." /privateModules/ " .$ route ." /models/AppDao.php " )) {
368
- require_once BASE_PATH ." /privateModules/ " .$ route ." /models/AppDao.php " ;
365
+ if (file_exists (BASE_PATH .' /privateModules/ ' .$ route .' /models/AppDao.php ' )) {
366
+ require_once BASE_PATH .' /privateModules/ ' .$ route .' /models/AppDao.php ' ;
369
367
}
370
- if (file_exists (BASE_PATH ." /privateModules/ " .$ route ." /models/AppModel.php " )) {
371
- require_once BASE_PATH ." /privateModules/ " .$ route ." /models/AppModel.php " ;
368
+ if (file_exists (BASE_PATH .' /privateModules/ ' .$ route .' /models/AppModel.php ' )) {
369
+ require_once BASE_PATH .' /privateModules/ ' .$ route .' /models/AppModel.php ' ;
372
370
}
373
- if (file_exists (BASE_PATH ." /privateModules/ " .$ route ." /constant/module.php " )) {
374
- require_once BASE_PATH ." /privateModules/ " .$ route ." /constant/module.php " ;
371
+ if (file_exists (BASE_PATH .' /privateModules/ ' .$ route .' /constant/module.php ' )) {
372
+ require_once BASE_PATH .' /privateModules/ ' .$ route .' /constant/module.php ' ;
375
373
}
376
374
377
- $ dir = BASE_PATH ." /modules/ " .$ route ." /models/base " ;
375
+ $ dir = BASE_PATH .' /modules/ ' .$ route .' /models/base ' ;
378
376
if (!is_dir ($ dir )) {
379
- $ dir = BASE_PATH ." /privateModules/ " .$ route ." /models/base " ;
377
+ $ dir = BASE_PATH .' /privateModules/ ' .$ route .' /models/base ' ;
380
378
}
381
379
382
380
if (is_dir ($ dir )) {
383
381
$ objects = scandir ($ dir );
384
382
foreach ($ objects as $ object ) {
385
- if ($ object != " . " && $ object != " .. " ) {
386
- if (filetype ($ dir ." / " .$ object ) != " dir " ) {
387
- require_once $ dir ." / " .$ object ;
383
+ if ($ object != ' . ' && $ object != ' .. ' ) {
384
+ if (filetype ($ dir .' / ' .$ object ) != ' dir ' ) {
385
+ require_once $ dir .' / ' .$ object ;
388
386
}
389
387
}
390
388
}
0 commit comments