Upstream Patch: Enable SYSMODS to hold upstream modules
This commit is contained in:
parent
d2fc6d4d47
commit
6fb7d0035a
@ -67,16 +67,16 @@ Kohana::$config->attach(new Kohana_Config_File);
|
|||||||
* Enable modules. Modules are referenced by a relative or absolute path.
|
* Enable modules. Modules are referenced by a relative or absolute path.
|
||||||
*/
|
*/
|
||||||
Kohana::modules(array(
|
Kohana::modules(array(
|
||||||
// 'auth' => MODPATH.'auth', // Basic authentication
|
// 'auth' => SMDPATH.'auth', // Basic authentication
|
||||||
// 'cache' => MODPATH.'cache', // Caching with multiple backends
|
// 'cache' => SMDPATH.'cache', // Caching with multiple backends
|
||||||
// 'codebench' => MODPATH.'codebench', // Benchmarking tool
|
// 'codebench' => SMDPATH.'codebench', // Benchmarking tool
|
||||||
// 'database' => MODPATH.'database', // Database access
|
// 'database' => SMDPATH.'database', // Database access
|
||||||
// 'image' => MODPATH.'image', // Image manipulation
|
// 'image' => SMDPATH.'image', // Image manipulation
|
||||||
// 'orm' => MODPATH.'orm', // Object Relationship Mapping
|
// 'orm' => SMDPATH.'orm', // Object Relationship Mapping
|
||||||
// 'oauth' => MODPATH.'oauth', // OAuth authentication
|
// 'oauth' => SMDPATH.'oauth', // OAuth authentication
|
||||||
// 'pagination' => MODPATH.'pagination', // Paging of results
|
// 'pagination' => SMDPATH.'pagination', // Paging of results
|
||||||
// 'unittest' => MODPATH.'unittest', // Unit testing
|
// 'unittest' => SMDPATH.'unittest', // Unit testing
|
||||||
// 'userguide' => MODPATH.'userguide', // User guide and API documentation
|
// 'userguide' => SMDPATH.'userguide', // User guide and API documentation
|
||||||
));
|
));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -570,6 +570,13 @@ class Kohana_Core {
|
|||||||
}
|
}
|
||||||
// Add the module to include paths
|
// Add the module to include paths
|
||||||
$paths[] = realpath(MODPATH.$path).DIRECTORY_SEPARATOR;
|
$paths[] = realpath(MODPATH.$path).DIRECTORY_SEPARATOR;
|
||||||
|
|
||||||
|
// Add our system modules path
|
||||||
|
}
|
||||||
|
if (is_dir(SMDPATH.$path))
|
||||||
|
{
|
||||||
|
// Add the module to include paths
|
||||||
|
$paths[] = realpath(SMDPATH.$path).DIRECTORY_SEPARATOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1383,11 +1390,15 @@ class Kohana_Core {
|
|||||||
{
|
{
|
||||||
$file = 'SYSPATH'.DIRECTORY_SEPARATOR.substr($file, strlen(SYSPATH));
|
$file = 'SYSPATH'.DIRECTORY_SEPARATOR.substr($file, strlen(SYSPATH));
|
||||||
}
|
}
|
||||||
|
elseif (strpos($file, SMDPATH) === 0)
|
||||||
|
{
|
||||||
|
$file = 'SMDPATH'.DIRECTORY_SEPARATOR.substr($file, strlen(SMDPATH));
|
||||||
|
}
|
||||||
elseif (strpos($file, MODPATH) === 0)
|
elseif (strpos($file, MODPATH) === 0)
|
||||||
{
|
{
|
||||||
$file = 'MODPATH'.DIRECTORY_SEPARATOR.substr($file, strlen(MODPATH));
|
$file = 'MODPATH'.DIRECTORY_SEPARATOR.substr($file, strlen(MODPATH));
|
||||||
}
|
}
|
||||||
elseif (strpos($file, OVERPATH) === 0)
|
elseif (OVERPATH AND strpos($file, OVERPATH) === 0)
|
||||||
{
|
{
|
||||||
$file = 'OVERPATH/'.substr($file, strlen(OVERPATH));
|
$file = 'OVERPATH/'.substr($file, strlen(OVERPATH));
|
||||||
}
|
}
|
||||||
|
12
kh.php
12
kh.php
@ -15,6 +15,11 @@ $application = 'application';
|
|||||||
*/
|
*/
|
||||||
$modules = 'modules';
|
$modules = 'modules';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The directory in which upstream Kohana resources (modules) are located.
|
||||||
|
*/
|
||||||
|
$sysmodules = 'includes/kohana/modules';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The directory in which the Kohana resources are located. The system
|
* The directory in which the Kohana resources are located. The system
|
||||||
* directory must contain the classes/kohana.php file.
|
* directory must contain the classes/kohana.php file.
|
||||||
@ -70,6 +75,10 @@ if ( ! is_dir($application) AND is_dir(DOCROOT.$application))
|
|||||||
if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
|
if ( ! is_dir($modules) AND is_dir(DOCROOT.$modules))
|
||||||
$modules = DOCROOT.$modules;
|
$modules = DOCROOT.$modules;
|
||||||
|
|
||||||
|
// Make the system relative to the docroot
|
||||||
|
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
|
||||||
if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
|
if ( ! is_dir($system) AND is_dir(DOCROOT.$system))
|
||||||
$system = DOCROOT.$system;
|
$system = DOCROOT.$system;
|
||||||
@ -81,6 +90,7 @@ if ( ! is_dir($override) AND is_dir(DOCROOT.$override))
|
|||||||
// Define the absolute paths for configured directories
|
// Define the absolute paths for configured directories
|
||||||
define('APPPATH', realpath($application).DIRECTORY_SEPARATOR);
|
define('APPPATH', realpath($application).DIRECTORY_SEPARATOR);
|
||||||
define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR);
|
define('MODPATH', realpath($modules).DIRECTORY_SEPARATOR);
|
||||||
|
define('SMDPATH', realpath($sysmodules).DIRECTORY_SEPARATOR);
|
||||||
define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR);
|
define('SYSPATH', realpath($system).DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
if (is_dir(realpath($override)))
|
if (is_dir(realpath($override)))
|
||||||
@ -89,7 +99,7 @@ else
|
|||||||
define('OVERPATH', '');
|
define('OVERPATH', '');
|
||||||
|
|
||||||
// Clean up the configuration vars
|
// Clean up the configuration vars
|
||||||
unset($application, $modules, $system, $override);
|
unset($application, $modules, $sysmodules, $system, $override);
|
||||||
|
|
||||||
if (file_exists('install'.EXT))
|
if (file_exists('install'.EXT))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user