Merge from trunk 2787:
- Move upgrade.tpl to admin template. - Deactivate all active plugins during upgrade.php. - Update Editarea for LocalFiles Editor to version 0.7.2.3 (bonEcho compatibility) git-svn-id: http://piwigo.org/svn/branches/2.0@2788 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
39eb742c25
commit
8d9d904c67
4 changed files with 23 additions and 18 deletions
File diff suppressed because one or more lines are too long
|
@ -30,22 +30,9 @@
|
|||
function eval_syntax($code)
|
||||
{
|
||||
$code = str_replace(array('<?php', '?>'), '', $code);
|
||||
if (function_exists('token_get_all'))
|
||||
if (!@eval('return true;' . $code))
|
||||
{
|
||||
$b = 0;
|
||||
foreach (token_get_all($code) as $token)
|
||||
{
|
||||
if ('{' == $token) ++$b;
|
||||
else if ('}' == $token) --$b;
|
||||
}
|
||||
if ($b) return false;
|
||||
else
|
||||
{
|
||||
ob_start();
|
||||
$eval = eval('if(0){' . $code . '}');
|
||||
ob_end_clean();
|
||||
if ($eval === false) return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return '<?php' . $code . '?>';
|
||||
}
|
||||
|
|
20
upgrade.php
20
upgrade.php
|
@ -151,7 +151,7 @@ function print_time($message)
|
|||
// | template initialization |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
$template = new Template(PHPWG_ROOT_PATH.'template/yoga');
|
||||
$template = new Template(PHPWG_ROOT_PATH.'admin/template/goto');
|
||||
$template->set_filenames(array('upgrade'=>'upgrade.tpl'));
|
||||
$template->assign('RELEASE', PHPWG_VERSION);
|
||||
|
||||
|
@ -234,6 +234,24 @@ else
|
|||
$conf['die_on_sql_error'] = false;
|
||||
include($upgrade_file);
|
||||
|
||||
// Plugins deactivation
|
||||
if (in_array(PREFIX_TABLE.'plugins', $tables))
|
||||
{
|
||||
$query = '
|
||||
UPDATE '.PREFIX_TABLE.'plugins SET state="inactive" WHERE state="active"
|
||||
;';
|
||||
mysql_query($query);
|
||||
|
||||
if (mysql_affected_rows() > 0)
|
||||
{
|
||||
array_push(
|
||||
$page['infos'],
|
||||
'As a precaution, all activated plugins have been deactivated.
|
||||
You must check for plugins upgrade before reactiving them.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Create empty local files to avoid log errors
|
||||
create_empty_local_files();
|
||||
|
||||
|
|
Loading…
Reference in a new issue