aboutsummaryrefslogtreecommitdiffstats
path: root/upgrade.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-01-17 18:48:13 +0000
committerplegall <plg@piwigo.org>2011-01-17 18:48:13 +0000
commit8ccd3a203d407f549cd8697a5fa66181e90d9871 (patch)
tree5d0e203c02905f157316683aa0bc75126fb5f171 /upgrade.php
parent91fc33dc8eea8bfd38f36f34c1abaa389b7e92e5 (diff)
feature 2112 added: ability to set an additional local directory
$conf['local_dir_site'] in local/config/multisite.inc.php git-svn-id: http://piwigo.org/svn/trunk@8722 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'upgrade.php')
-rw-r--r--upgrade.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/upgrade.php b/upgrade.php
index eb2d57646..1bfe3d44a 100644
--- a/upgrade.php
+++ b/upgrade.php
@@ -24,7 +24,17 @@
define('PHPWG_ROOT_PATH', './');
// load config file
-$config_file = PHPWG_ROOT_PATH.'local/config/database.inc.php';
+if (is_file(PHPWG_ROOT_PATH .'local/config/multisite.inc.php'))
+{
+ include(PHPWG_ROOT_PATH .'local/config/multisite.inc.php');
+ define('PWG_LOCAL_DIR', $conf['local_dir_site']);
+}
+else
+{
+ define('PWG_LOCAL_DIR', 'local/');
+}
+
+$config_file = PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'config/database.inc.php';
$config_file_contents = @file_get_contents($config_file);
if ($config_file_contents === false)
{
@@ -36,9 +46,13 @@ if ($php_end_tag === false)
die('Cannot find php end tag in '.$config_file);
}
-include(PHPWG_ROOT_PATH.'local/config/database.inc.php');
+include($config_file);
include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
@include(PHPWG_ROOT_PATH. 'local/config/config.inc.php');
+if (isset($conf['local_dir_site']))
+{
+ @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php');
+}
// $conf is not used for users tables - define cannot be re-defined
define('USERS_TABLE', $prefixeTable.'users');
@@ -308,7 +322,7 @@ if ((isset($_POST['submit']) or isset($_GET['now']))
$page['infos'],
sprintf(
l10n('In <i>%s</i>, before <b>?></b>, insert:'),
- 'local/config/database.inc.php'
+ PWG_LOCAL_DIR.'config/database.inc.php'
)
.'<p><textarea rows="4" cols="40">'
.implode("\r\n" , $mysql_changes).'</textarea></p>'