Add test with lowest PHPUnit version to Travis matrix
[kohana.git] / index.php
blob6c352aa3968cccaafad9ace366d88a8e26756c4c
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 * @link http://kohanaframework.org/guide/about.install#application
8 */
9 $application = 'application';
11 /**
12 * The directory in which your modules are located.
14 * @link 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 * @link 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 * @link 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 * @link http://www.php.net/manual/errorfunc.configuration#ini.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 * @link 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))
61 $application = DOCROOT.$application;
63 // Make the modules relative to the docroot, for symlink'd index.php
64 if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
65 $modules = DOCROOT.$modules;
67 // Make the system relative to the docroot, for symlink'd index.php
68 if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
69 $system = DOCROOT.$system;
71 // Define the absolute paths for configured directories
72 define('APPPATH', realpath($application).DIRECTORY_SEPARATOR);
73 define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR);
74 define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR);
76 // Clean up the configuration vars
77 unset($application, $modules, $system);
79 if (file_exists('install'.EXT))
81 // Load the installation check
82 return include 'install'.EXT;
85 /**
86 * Define the start time of the application, used for profiling.
88 if ( ! defined('KOHANA_START_TIME'))
90 define('KOHANA_START_TIME', microtime(TRUE));
93 /**
94 * Define the memory usage at the start of the application, used for profiling.
96 if ( ! defined('KOHANA_START_MEMORY'))
98 define('KOHANA_START_MEMORY', memory_get_usage());
101 // Bootstrap the application
102 require APPPATH.'bootstrap'.EXT;
104 if (PHP_SAPI == 'cli') // Try and load minion
106 class_exists('Minion_Task') OR die('Please enable the Minion module for CLI support.');
107 set_exception_handler(array('Minion_Exception', 'handler'));
109 Minion_Task::factory(Minion_CLI::options())->execute();
111 else
114 * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
115 * If no source is specified, the URI will be automatically detected.
117 echo Request::factory(TRUE, array(), FALSE)
118 ->execute()
119 ->send_headers(TRUE)
120 ->body();