Updating comment for symlinkd index.php behavior
[kohana.git] / index.php
blob0e68331352a60b48ee17b91dd5261c4e4df745cc
1 <?php
3 /**
4 * The directory in which your application specific resources are located.
5 * The application directory must contain the bootstrap.php file.
7 * @see http://kohanaframework.org/guide/about.install#application
8 */
9 $application = 'application';
11 /**
12 * The directory in which your modules are located.
14 * @see http://kohanaframework.org/guide/about.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://kohanaframework.org/guide/about.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://kohanaframework.org/guide/about.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 * When using a legacy application with PHP >= 5.3, it is recommended to disable
45 * deprecated notices. Disable with: E_ALL & ~E_DEPRECATED
47 error_reporting(E_ALL | E_STRICT);
49 /**
50 * End of standard configuration! Changing any of the code below should only be
51 * attempted by those with a working knowledge of Kohana internals.
53 * @see http://kohanaframework.org/guide/using.configuration
56 // Set the full path to the docroot
57 define('DOCROOT', realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR);
59 // Make the application relative to the docroot, for symlink'd index.php
60 if ( ! is_dir($application) AND is_dir(DOCROOT.$application))
62 $application = DOCROOT.$application;
65 // Make the modules relative to the docroot, for symlink'd index.php
66 if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
68 $modules = DOCROOT.$modules;
71 // Make the system relative to the docroot, for symlink'd index.php
72 if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
74 $system = DOCROOT.$system;
77 // Define the absolute paths for configured directories
78 define('APPPATH', realpath($application).DIRECTORY_SEPARATOR);
79 define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR);
80 define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR);
82 // Clean up the configuration vars
83 unset($application, $modules, $system);
85 if (file_exists('install'.EXT))
87 // Load the installation check
88 return include 'install'.EXT;
91 // Load the base, low-level functions
92 require SYSPATH.'base'.EXT;
94 // Load the core Kohana class
95 require SYSPATH.'classes/kohana/core'.EXT;
97 if (is_file(APPPATH.'classes/kohana'.EXT))
99 // Application extends the core
100 require APPPATH.'classes/kohana'.EXT;
102 else
104 // Load empty core extension
105 require SYSPATH.'classes/kohana'.EXT;
108 // Bootstrap the application
109 require APPPATH.'bootstrap'.EXT;