2008-12-05 03:37:18 +02:00
|
|
|
<?php
|
2009-04-10 01:24:51 +03:00
|
|
|
|
2008-12-09 08:17:28 +02:00
|
|
|
/**
|
|
|
|
* The directory in which your application specific resources are located.
|
2010-04-11 18:22:48 +03:00
|
|
|
* The application directory must contain the bootstrap.php file.
|
2008-12-15 00:16:00 +02:00
|
|
|
*
|
2010-05-21 00:56:46 +03:00
|
|
|
* @see http://kohanaframework.org/guide/about.install#application
|
2008-12-09 08:17:28 +02:00
|
|
|
*/
|
2008-12-05 03:37:18 +02:00
|
|
|
$application = 'application';
|
|
|
|
|
2008-12-09 08:17:28 +02:00
|
|
|
/**
|
2008-12-15 00:16:00 +02:00
|
|
|
* The directory in which your modules are located.
|
|
|
|
*
|
2010-05-21 00:56:46 +03:00
|
|
|
* @see http://kohanaframework.org/guide/about.install#modules
|
2008-12-09 08:17:28 +02:00
|
|
|
*/
|
2008-12-05 03:37:18 +02:00
|
|
|
$modules = 'modules';
|
|
|
|
|
2008-12-09 08:17:28 +02:00
|
|
|
/**
|
2008-12-15 00:16:00 +02:00
|
|
|
* The directory in which the Kohana resources are located. The system
|
|
|
|
* directory must contain the classes/kohana.php file.
|
|
|
|
*
|
2010-05-21 00:56:46 +03:00
|
|
|
* @see http://kohanaframework.org/guide/about.install#system
|
2008-12-09 08:17:28 +02:00
|
|
|
*/
|
2008-12-15 00:16:00 +02:00
|
|
|
$system = 'system';
|
2008-12-05 03:37:18 +02:00
|
|
|
|
2008-12-09 08:17:28 +02:00
|
|
|
/**
|
|
|
|
* The default extension of resource files. If you change this, all resources
|
|
|
|
* must be renamed to use the new extension.
|
2008-12-15 00:16:00 +02:00
|
|
|
*
|
2010-05-21 00:56:46 +03:00
|
|
|
* @see http://kohanaframework.org/guide/about.install#ext
|
2008-12-09 08:17:28 +02:00
|
|
|
*/
|
2008-12-05 03:37:18 +02:00
|
|
|
define('EXT', '.php');
|
|
|
|
|
2009-05-21 20:43:09 +03:00
|
|
|
/**
|
|
|
|
* Set the PHP error reporting level. If you set this in php.ini, you remove this.
|
|
|
|
* @see http://php.net/error_reporting
|
|
|
|
*
|
|
|
|
* When developing your application, it is highly recommended to enable notices
|
|
|
|
* and strict warnings. Enable them by using: E_ALL | E_STRICT
|
|
|
|
*
|
|
|
|
* In a production environment, it is safe to ignore notices and strict warnings.
|
|
|
|
* Disable them by using: E_ALL ^ E_NOTICE
|
2010-05-21 00:56:46 +03:00
|
|
|
*
|
2009-11-21 09:51:17 +02:00
|
|
|
* When using a legacy application with PHP >= 5.3, it is recommended to disable
|
|
|
|
* deprecated notices. Disable with: E_ALL & ~E_DEPRECATED
|
2009-05-21 20:43:09 +03:00
|
|
|
*/
|
|
|
|
error_reporting(E_ALL | E_STRICT);
|
|
|
|
|
2008-12-15 00:16:00 +02:00
|
|
|
/**
|
|
|
|
* End of standard configuration! Changing any of the code below should only be
|
|
|
|
* attempted by those with a working knowledge of Kohana internals.
|
|
|
|
*
|
2010-05-21 00:56:46 +03:00
|
|
|
* @see http://kohanaframework.org/guide/using.configuration
|
2008-12-15 00:16:00 +02:00
|
|
|
*/
|
2008-12-09 08:17:28 +02:00
|
|
|
|
2009-02-24 09:13:09 +02:00
|
|
|
// Set the full path to the docroot
|
|
|
|
define('DOCROOT', realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR);
|
|
|
|
|
|
|
|
// Make the application relative to the docroot
|
|
|
|
if ( ! is_dir($application) AND is_dir(DOCROOT.$application))
|
|
|
|
$application = DOCROOT.$application;
|
|
|
|
|
|
|
|
// Make the modules relative to the docroot
|
|
|
|
if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
|
|
|
|
$modules = DOCROOT.$modules;
|
|
|
|
|
|
|
|
// Make the system relative to the docroot
|
|
|
|
if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
|
2009-03-02 02:39:24 +02:00
|
|
|
$system = DOCROOT.$system;
|
2008-12-09 08:17:28 +02:00
|
|
|
|
|
|
|
// Define the absolute paths for configured directories
|
2009-02-24 09:13:09 +02:00
|
|
|
define('APPPATH', realpath($application).DIRECTORY_SEPARATOR);
|
|
|
|
define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR);
|
|
|
|
define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR);
|
2008-12-05 03:37:18 +02:00
|
|
|
|
2008-12-09 08:17:28 +02:00
|
|
|
// Clean up the configuration vars
|
2008-12-05 03:37:18 +02:00
|
|
|
unset($application, $modules, $system);
|
|
|
|
|
|
|
|
if (file_exists('install'.EXT))
|
|
|
|
{
|
2008-12-09 08:17:28 +02:00
|
|
|
// Load the installation check
|
2008-12-12 07:43:18 +02:00
|
|
|
return include 'install'.EXT;
|
2008-12-05 03:37:18 +02:00
|
|
|
}
|
2008-12-12 07:43:18 +02:00
|
|
|
|
2010-10-27 02:58:38 +03:00
|
|
|
if ( ! defined('KOHANA_START_TIME'))
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Define the start time of the application, used for profiling.
|
|
|
|
*/
|
|
|
|
define('KOHANA_START_TIME', microtime(TRUE));
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! defined('KOHANA_START_MEMORY'))
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Define the memory usage at the start of the application, used for profiling.
|
|
|
|
*/
|
|
|
|
define('KOHANA_START_MEMORY', memory_get_usage());
|
|
|
|
}
|
2009-05-20 22:13:02 +03:00
|
|
|
|
2009-08-06 18:04:58 +03:00
|
|
|
// Load the core Kohana class
|
2009-08-01 20:43:08 +03:00
|
|
|
require SYSPATH.'classes/kohana/core'.EXT;
|
|
|
|
|
|
|
|
if (is_file(APPPATH.'classes/kohana'.EXT))
|
|
|
|
{
|
2009-08-06 18:04:58 +03:00
|
|
|
// Application extends the core
|
2009-08-01 20:43:08 +03:00
|
|
|
require APPPATH.'classes/kohana'.EXT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-08-06 18:04:58 +03:00
|
|
|
// Load empty core extension
|
2009-08-01 20:43:08 +03:00
|
|
|
require SYSPATH.'classes/kohana'.EXT;
|
|
|
|
}
|
2009-05-02 00:28:53 +03:00
|
|
|
|
2009-02-24 09:13:09 +02:00
|
|
|
// Bootstrap the application
|
2009-03-02 02:06:44 +02:00
|
|
|
require APPPATH.'bootstrap'.EXT;
|