Upgrade to KH 3.1.3.1
This commit is contained in:
69
kh.php
69
kh.php
@@ -28,12 +28,6 @@ $sysmodules = 'includes/kohana/modules';
|
||||
*/
|
||||
$system = 'includes/kohana/system';
|
||||
|
||||
/**
|
||||
* This directory in which we can override classes that may not yet be accepted
|
||||
* upstream.
|
||||
*/
|
||||
$override = 'override';
|
||||
|
||||
/**
|
||||
* The default extension of resource files. If you change this, all resources
|
||||
* must be renamed to use the new extension.
|
||||
@@ -67,39 +61,30 @@ error_reporting(E_ALL | E_STRICT);
|
||||
// Set the full path to the docroot
|
||||
define('DOCROOT', realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR);
|
||||
|
||||
// Make the application relative to the docroot
|
||||
// Make the application relative to the docroot, for symlink'd index.php
|
||||
if ( ! is_dir($application) AND is_dir(DOCROOT.$application))
|
||||
$application = DOCROOT.$application;
|
||||
|
||||
// Make the modules relative to the docroot
|
||||
// Make the modules relative to the docroot, for symlink'd index.php
|
||||
if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
|
||||
$modules = DOCROOT.$modules;
|
||||
|
||||
// Make the system relative to the docroot
|
||||
// Make the system relative to the docroot, for symlink'd index.php
|
||||
if ( ! is_dir($sysmodules) AND is_dir(DOCROOT.$sysmodules))
|
||||
$sysmodules = DOCROOT.$sysmodules;
|
||||
|
||||
// Make the system relative to the docroot
|
||||
// Make the system relative to the docroot, for symlink'd index.php
|
||||
if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
|
||||
$system = DOCROOT.$system;
|
||||
|
||||
// Make the override relative to the docroot
|
||||
if ( ! is_dir($override) AND is_dir(DOCROOT.$override))
|
||||
$override = DOCROOT.$override;
|
||||
|
||||
// Define the absolute paths for configured directories
|
||||
define('APPPATH', realpath($application).DIRECTORY_SEPARATOR);
|
||||
define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR);
|
||||
define('SMDPATH', realpath($sysmodules).DIRECTORY_SEPARATOR);
|
||||
define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR);
|
||||
|
||||
if (is_dir(realpath($override)))
|
||||
define('OVERPATH', realpath($override).DIRECTORY_SEPARATOR);
|
||||
else
|
||||
define('OVERPATH', '');
|
||||
|
||||
// Clean up the configuration vars
|
||||
unset($application, $modules, $sysmodules, $system, $override);
|
||||
unset($application, $modules, $sysmodules, $system);
|
||||
|
||||
if (file_exists('install'.EXT))
|
||||
{
|
||||
@@ -107,32 +92,30 @@ if (file_exists('install'.EXT))
|
||||
return include 'install'.EXT;
|
||||
}
|
||||
|
||||
// Load the base, low-level functions
|
||||
require SYSPATH.'base'.EXT;
|
||||
/**
|
||||
* Define the start time of the application, used for profiling.
|
||||
*/
|
||||
if ( ! defined('KOHANA_START_TIME'))
|
||||
{
|
||||
define('KOHANA_START_TIME', microtime(TRUE));
|
||||
}
|
||||
|
||||
// Load the core Kohana class
|
||||
require SYSPATH.'classes/kohana/core'.EXT;
|
||||
|
||||
if (is_file(OVERPATH.'application/classes/kohana'.EXT))
|
||||
/**
|
||||
* Define the memory usage at the start of the application, used for profiling.
|
||||
*/
|
||||
if ( ! defined('KOHANA_START_MEMORY'))
|
||||
{
|
||||
// Override Application extends the core
|
||||
require OVERPATH.'application/classes/kohana'.EXT;
|
||||
}
|
||||
elseif (is_file(APPPATH.'classes/kohana'.EXT))
|
||||
{
|
||||
// Application extends the core
|
||||
require APPPATH.'classes/kohana'.EXT;
|
||||
}
|
||||
elseif (is_file(OVERPATH.'system/classes/kohana'.EXT))
|
||||
{
|
||||
// Override system extends the core
|
||||
require APPPATH.'system/classes/kohana'.EXT;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Load empty core extension
|
||||
require SYSPATH.'classes/kohana'.EXT;
|
||||
define('KOHANA_START_MEMORY', memory_get_usage());
|
||||
}
|
||||
|
||||
// Bootstrap the application
|
||||
require APPPATH.'bootstrap'.EXT;
|
||||
|
||||
/**
|
||||
* Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
|
||||
* If no source is specified, the URI will be automatically detected.
|
||||
*/
|
||||
echo Request::factory()
|
||||
->execute()
|
||||
->send_headers()
|
||||
->body();
|
||||
|
Reference in New Issue
Block a user