IP : 18.218.42.121Hostname : host45.registrar-servers.comKernel : Linux host45.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64Disable Function : None :) OS : Linux
PATH:
/
home/
../
var/
softaculous/
impress/
../
wolf/
../
mt/
../
ruko/
../
piwigo/
mod_upgrade.php/
/
<?php // +-----------------------------------------------------------------------+ // | This file is part of Piwigo. | // | | // | For copyright and license information, please view the COPYING.txt | // | file that was distributed with this source code. | // +-----------------------------------------------------------------------+
// right after the overwrite of previous version files by the unzip in the administration, // PHP engine might still have old files in cache. We do not want to use the cache and // force reload of all application files. Thus we disable opcache. if (function_exists('ini_set')) { @ini_set('opcache.enable', 0); }
$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) { die('Cannot load '.$config_file); } $php_end_tag = strrpos($config_file_contents, '?'.'>'); if ($php_end_tag === false) { die('Cannot find php end tag in '.$config_file); }
include($config_file);
// $conf is not used for users tables - define cannot be re-defined define('USERS_TABLE', $prefixeTable.'users'); include_once(PHPWG_ROOT_PATH.'include/constants.php'); define('PREFIX_TABLE', $prefixeTable); define('UPGRADES_PATH', PHPWG_ROOT_PATH.'install/db');
// +-----------------------------------------------------------------------+ // | playing zone | // +-----------------------------------------------------------------------+
$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' => l10n('Need help ? Ask your question on <a href="%s">Piwigo message board</a>.', PHPWG_URL.'/forum'), ) );
// +-----------------------------------------------------------------------+ // | Remote sites are not compatible with Piwigo 2.4+ | // +-----------------------------------------------------------------------+
$has_remote_site = false;
$query = 'SELECT galleries_url FROM '.SITES_TABLE.';'; $result = pwg_query($query); while ($row = pwg_db_fetch_assoc($result)) { if (url_is_remote($row['galleries_url'])) { $has_remote_site = true; } }
if ($has_remote_site) { include_once(PHPWG_ROOT_PATH.'admin/include/updates.class.php'); include_once(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php');
// find the current release if (!in_array('param', $columns_of[PREFIX_TABLE.'config'])) { // we're in branch 1.3, important upgrade, isn't it? if (in_array(PREFIX_TABLE.'user_category', $tables)) { $current_release = '1.3.1'; } else { $current_release = '1.3.0'; } } else if (!in_array(PREFIX_TABLE.'user_cache', $tables)) { $current_release = '1.4.0'; } else if (!in_array(PREFIX_TABLE.'tags', $tables)) { $current_release = '1.5.0'; } else if ( !in_array(PREFIX_TABLE.'plugins', $tables) ) { if (!in_array('auto_login_key', $columns_of[PREFIX_TABLE.'user_infos'])) { $current_release = '1.6.0'; } else { $current_release = '1.6.2'; } } else if (!in_array('md5sum', $columns_of[PREFIX_TABLE.'images'])) { $current_release = '1.7.0'; } else if (!in_array(PREFIX_TABLE.'themes', $tables)) { $current_release = '2.0.0'; } else if (!in_array('added_by', $columns_of[PREFIX_TABLE.'images'])) { $current_release = '2.1.0'; } else if (!in_array('rating_score', $columns_of[PREFIX_TABLE.'images'])) { $current_release = '2.2.0'; } 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 if (!in_array('nb_available_tags', $columns_of[PREFIX_TABLE.'user_cache'])) { $current_release = '2.5.0'; } else if (!in_array('activation_key_expire', $columns_of[PREFIX_TABLE.'user_infos'])) { $current_release = '2.6.0'; } else if (!in_array('auth_key_id', $columns_of[PREFIX_TABLE.'history'])) { $current_release = '2.7.0'; } else if (!in_array('history_id_to', $columns_of[PREFIX_TABLE.'history_summary'])) { $current_release = '2.8.0'; } else if (!in_array(PREFIX_TABLE.'activity', $tables)) { $current_release = '2.9.0'; } else { // retrieve already applied upgrades $query = ' SELECT id FROM '.PREFIX_TABLE.'upgrade ;'; $applied_upgrades = array_from_query($query, 'id');
if (!in_array(159, $applied_upgrades)) { $current_release = '2.10.0'; } else if (!in_array(162, $applied_upgrades)) { $current_release = '11.0.0'; } else if (!in_array(164, $applied_upgrades)) { $current_release = '12.0.0'; } else if (!in_array(170, $applied_upgrades)) { $current_release = '13.0.0'; } else if (!in_array(174, $applied_upgrades)) { $current_release = '14.0.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(); } }
// check php version if (version_compare(PHP_VERSION, REQUIRED_PHP_VERSION, '<')) { // include(PHPWG_ROOT_PATH.'install/php5_apache_configuration.php'); // to remove, with all its related content $page['errors'][] = l10n('PHP version %s required (you are running on PHP %s)', REQUIRED_PHP_VERSION, PHP_VERSION); }
check_upgrade_access_rights();
if ((isset($_POST['submit']) or isset($_GET['now'])) and check_upgrade()) { $upgrade_file = PHPWG_ROOT_PATH.'install/upgrade_'.$current_release.'.php'; if (is_file($upgrade_file)) { // reset SQL counters $page['queries_time'] = 0; $page['count_queries'] = 0;
// if the webmaster has a session, let's give a link to discover new features if (!empty($_SESSION['pwg_uid'])) { $version_ = str_replace('.', '_', get_branch_from_version(PHPWG_VERSION).'.0');
if (file_exists(PHPWG_PLUGINS_PATH .'TakeATour/tours/'.$version_.'/config.inc.php')) { $query = ' REPLACE INTO '.PLUGINS_TABLE.' (id, state) VALUES (\'TakeATour\', \'active\') ;'; pwg_query($query);
// we need the secret key for get_pwg_token() load_conf_from_db();
$template->assign( array( 'button_label' => l10n('Discover what\'s new in Piwigo %s', get_branch_from_version(PHPWG_VERSION)), 'button_link' => 'admin.php?submited_tour_path=tours/'.$version_.'&pwg_token='.get_pwg_token(), ) ); } }
// Delete cache data include(PHPWG_ROOT_PATH . 'include/cache.class.php');
// invalidate_user_cache will purge persistent_cache so it needs to be instantiated first $persistent_cache = new PersistentFileCache();
// Restore $page['infos'] in order to hide informations messages from functions calles // errors messages are not hide $page['infos'] = $page['infos_sav'];