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:
parent
914d26b145
commit
32a6f76ed0
|
|
@ -240,6 +240,8 @@ if (!class_exists('domains')) {
|
|||
$db = $this->db;
|
||||
$x=0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
$app_path = dirname($config_path);
|
||||
$app_path = preg_replace('/\A.*(\/.*\/.*)\z/', '$1', $app_path);
|
||||
include($config_path);
|
||||
$x++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ if (!class_exists('menu')) {
|
|||
$config_list = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_menu.php");
|
||||
$x = 0;
|
||||
foreach ($config_list as &$config_path) {
|
||||
$app_path = dirname($config_path);
|
||||
$app_path = preg_replace('/\A.*(\/.*\/.*)\z/', '$1', $app_path);
|
||||
$y = 0;
|
||||
try {
|
||||
//echo "[".$x ."] ".$config_path."\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue