123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <?php
- $application = 'application';
- $modules = 'modules';
- $system = 'system';
- define('EXT', '.php');
- define('DOCROOT', realpath(__DIR__.'/../../').DIRECTORY_SEPARATOR);
- error_reporting(E_ALL & ~E_DEPRECATED);
- if ( ! is_dir($application) AND is_dir(DOCROOT.$application))
- {
- $application = DOCROOT.$application;
- }
- if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
- {
- $modules = DOCROOT.$modules;
- }
- if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
- {
- $system = DOCROOT.$system;
- }
- define('APPPATH', realpath($application).DIRECTORY_SEPARATOR);
- define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR);
- define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR);
- unset($application, $modules, $system);
- if ( ! defined('KOHANA_START_TIME'))
- {
- define('KOHANA_START_TIME', microtime(TRUE));
- }
- if ( ! defined('KOHANA_START_MEMORY'))
- {
- define('KOHANA_START_MEMORY', memory_get_usage());
- }
- require APPPATH.'bootstrap'.EXT;
- if (($ob_len = ob_get_length()) !== FALSE)
- {
-
- if ($ob_len > 0)
- {
- ob_end_flush();
- }
- else
- {
- ob_end_clean();
- }
- }
- $modules_iterator = new DirectoryIterator(MODPATH);
- $modules = [];
- foreach ($modules_iterator as $module)
- {
- if ($module->isDir() AND ! $module->isDot())
- {
- $modules[$module->getFilename()] = MODPATH.$module->getFilename();
- }
- }
- Kohana::modules($modules);
- unset($modules_iterator, $modules, $module);
|