aboutsummaryrefslogtreecommitdiffstats
path: root/upgrade.php
diff options
context:
space:
mode:
Diffstat (limited to 'upgrade.php')
-rw-r--r--upgrade.php41
1 files changed, 22 insertions, 19 deletions
diff --git a/upgrade.php b/upgrade.php
index 14a73ac8b..7c707bd7c 100644
--- a/upgrade.php
+++ b/upgrade.php
@@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2013 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2008-2014 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
@@ -73,7 +73,7 @@ SHOW TABLES
{
if (preg_match('/^'.PREFIX_TABLE.'/', $row[0]))
{
- array_push($tables, $row[0]);
+ $tables[] = $row[0];
}
}
@@ -100,7 +100,7 @@ DESC '.$table.'
while ($row = pwg_db_fetch_row($result))
{
- array_push($columns_of[$table], $row[0]);
+ $columns_of[$table][] = $row[0];
}
}
@@ -195,6 +195,9 @@ else if ('tr_TR' == $language) {
else if ('da_DK' == $language) {
define('PHPWG_DOMAIN', 'da.piwigo.org');
}
+else if ('pt_BR' == $language) {
+ define('PHPWG_DOMAIN', 'br.piwigo.org');
+}
else {
define('PHPWG_DOMAIN', 'piwigo.org');
}
@@ -231,7 +234,7 @@ $template = new Template(PHPWG_ROOT_PATH.'admin/themes', 'clear');
$template->set_filenames(array('upgrade'=>'upgrade.tpl'));
$template->assign(array(
'RELEASE' => PHPWG_VERSION,
- 'L_UPGRADE_HELP' => sprintf(l10n('Need help ? Ask your question on <a href="%s">Piwigo message board</a>.'), PHPWG_URL.'/forum'),
+ 'L_UPGRADE_HELP' => l10n('Need help ? Ask your question on <a href="%s">Piwigo message board</a>.', PHPWG_URL.'/forum'),
)
);
@@ -332,6 +335,10 @@ else if (!in_array('rotation', $columns_of[PREFIX_TABLE.'images']))
{
$current_release = '2.3.0';
}
+else if (!in_array('website_url', $columns_of[PREFIX_TABLE.'comments']))
+{
+ $current_release = '2.4.0';
+}
else
{
// retrieve already applied upgrades
@@ -341,15 +348,16 @@ SELECT id
;';
$applied_upgrades = array_from_query($query, 'id');
- if (!in_array(134, $applied_upgrades))
+ if (!in_array(139, $applied_upgrades))
{
- $current_release = '2.4.0';
+ $current_release = '2.5.0';
}
else
{
// confirm that the database is in the same version as source code files
conf_update_param('piwigo_db_version', get_branch_from_version(PHPWG_VERSION));
-
+
+ header('Content-Type: text/html; charset='.get_pwg_charset());
echo 'No upgrade required, the database structure is up to date';
echo '<br><a href="index.php">← back to gallery</a>';
exit();
@@ -386,15 +394,12 @@ if ((isset($_POST['submit']) or isset($_GET['now']))
if (!@file_put_contents($config_file, $config_file_contents))
{
- array_push(
- $page['infos'],
- sprintf(
- l10n('In <i>%s</i>, before <b>?></b>, insert:'),
- PWG_LOCAL_DIR.'config/database.inc.php'
- )
- .'<p><textarea rows="4" cols="40">'
- .implode("\r\n" , $mysql_changes).'</textarea></p>'
- );
+ $page['infos'][] = l10n(
+ 'In <i>%s</i>, before <b>?></b>, insert:',
+ PWG_LOCAL_DIR.'config/database.inc.php'
+ )
+ .'<p><textarea rows="4" cols="40">'
+ .implode("\r\n" , $mysql_changes).'</textarea></p>';
}
}
@@ -427,9 +432,7 @@ if ((isset($_POST['submit']) or isset($_GET['now']))
)
);
- array_push($page['infos'],
- l10n('Perform a maintenance check in [Administration>Tools>Maintenance] if you encounter any problem.')
- );
+ $page['infos'][] = l10n('Perform a maintenance check in [Administration>Tools>Maintenance] if you encounter any problem.');
// Save $page['infos'] in order to restore after maintenance actions
$page['infos_sav'] = $page['infos'];