Tracking submodules
[kohana.git] / index.php
blobbb4343a6050836ea84d65323fbc4e6b26e879114
1 <?php
3 /**
4 * The directory in which your application specific resources are located.
5 * The application directory must contain the config/kohana.php file.
7 * @see http://docs.kohanaphp.com/install#application
8 */
9 $application = 'application';
11 /**
12 * The directory in which your modules are located.
14 * @see http://docs.kohanaphp.com/install#modules
16 $modules = 'modules';
18 /**
19 * The directory in which the Kohana resources are located. The system
20 * directory must contain the classes/kohana.php file.
22 * @see http://docs.kohanaphp.com/install#system
24 $system = 'system';
26 /**
27 * The default extension of resource files. If you change this, all resources
28 * must be renamed to use the new extension.
30 * @see http://docs.kohanaphp.com/install#ext
32 define('EXT', '.php');
34 /**
35 * Set the PHP error reporting level. If you set this in php.ini, you remove this.
36 * @see http://php.net/error_reporting
38 * When developing your application, it is highly recommended to enable notices
39 * and strict warnings. Enable them by using: E_ALL | E_STRICT
41 * In a production environment, it is safe to ignore notices and strict warnings.
42 * Disable them by using: E_ALL ^ E_NOTICE
44 error_reporting(E_ALL | E_STRICT);
46 /**
47 * End of standard configuration! Changing any of the code below should only be
48 * attempted by those with a working knowledge of Kohana internals.
50 * @see http://docs.kohanaphp.com/bootstrap
53 // Set the full path to the docroot
54 define('DOCROOT', realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR);
56 // Make the application relative to the docroot
57 if ( ! is_dir($application) AND is_dir(DOCROOT.$application))
58 $application = DOCROOT.$application;
60 // Make the modules relative to the docroot
61 if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
62 $modules = DOCROOT.$modules;
64 // Make the system relative to the docroot
65 if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
66 $system = DOCROOT.$system;
68 // Define the absolute paths for configured directories
69 define('APPPATH', realpath($application).DIRECTORY_SEPARATOR);
70 define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR);
71 define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR);
73 // Clean up the configuration vars
74 unset($application, $modules, $system);
76 if (file_exists('install'.EXT))
78 // Load the installation check
79 return include 'install'.EXT;
82 // Define the start time of the application
83 define('KOHANA_START_TIME', microtime(TRUE));
85 // Define the memory usage at the start of the application
86 define('KOHANA_START_MEMORY', memory_get_usage());
88 // Load the base, low-level functions
89 require SYSPATH.'base'.EXT;
91 // Load the core Kohana class
92 require SYSPATH.'classes/kohana/core'.EXT;
94 if (is_file(APPPATH.'classes/kohana'.EXT))
96 // Application extends the core
97 require APPPATH.'classes/kohana'.EXT;
99 else
101 // Load empty core extension
102 require SYSPATH.'classes/kohana'.EXT;
105 // Bootstrap the application
106 require APPPATH.'bootstrap'.EXT;