Enhance [master] provide $app_path during upgrade (#2573)
if a application is installed via a symlink PHP will resolve the symlink for __DIR__ and __FILE__ making it impossible for an application to work out it's relative path withing the fusion system. By providing $app_path during upgrade routines an application will beable to provide the correct link for menu items (e.g. /opt/languages/index.php) instead of having to hard code it where it could change depending on how the application was installed
This commit is contained in:
@@ -240,6 +240,8 @@ if (!class_exists('domains')) {
|
|||||||
$db = $this->db;
|
$db = $this->db;
|
||||||
$x=0;
|
$x=0;
|
||||||
foreach ($config_list as &$config_path) {
|
foreach ($config_list as &$config_path) {
|
||||||
|
$app_path = dirname($config_path);
|
||||||
|
$app_path = preg_replace('/\A.*(\/.*\/.*)\z/', '$1', $app_path);
|
||||||
include($config_path);
|
include($config_path);
|
||||||
$x++;
|
$x++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ if (!class_exists('menu')) {
|
|||||||
$config_list = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_menu.php");
|
$config_list = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_menu.php");
|
||||||
$x = 0;
|
$x = 0;
|
||||||
foreach ($config_list as &$config_path) {
|
foreach ($config_list as &$config_path) {
|
||||||
|
$app_path = dirname($config_path);
|
||||||
|
$app_path = preg_replace('/\A.*(\/.*\/.*)\z/', '$1', $app_path);
|
||||||
$y = 0;
|
$y = 0;
|
||||||
try {
|
try {
|
||||||
//echo "[".$x ."] ".$config_path."\n";
|
//echo "[".$x ."] ".$config_path."\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user