Skip to content

Commit

Permalink
merge r11508 from branch 2.2 to trunk
Browse files Browse the repository at this point in the history
bug 2363 fixed: upgrade 94 should not fail when write access is missing on
_data/plugins. When this situation occurs, we don't save the 2.1 user upload
configuration and we continue the upgrade.



git-svn-id: http://piwigo.org/svn/trunk@11509 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Jun 25, 2011
1 parent 554a536 commit fa9b4f8
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions install/db/94-database.php
Expand Up @@ -61,12 +61,28 @@

// save configuration for a future use by the Community plugin
$backup_filepath = $conf['local_data_dir'].'/plugins/core_user_upload_to_community.php';
mkgetdir(dirname($backup_filepath));
$save_conf = true;
if (is_dir(dirname($backup_filepath)))
{
if (!is_writable(dirname($backup_filepath)))
{
$save_conf = false;
}
}
elseif (!is_writable($conf['local_data_dir']))
{
$save_conf = false;
}

file_put_contents(
$backup_filepath,
'<?php $user_upload_conf = \''.serialize($user_upload_conf).'\'; ?>'
);
if ($save_conf)
{
mkgetdir(dirname($backup_filepath));

file_put_contents(
$backup_filepath,
'<?php $user_upload_conf = \''.serialize($user_upload_conf).'\'; ?>'
);
}

//
// remove all what is related to user upload in the database
Expand Down

0 comments on commit fa9b4f8

Please sign in to comment.