aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-06-25 19:51:49 +0000
committerplegall <plg@piwigo.org>2011-06-25 19:51:49 +0000
commit5f3c1f85fe8da3c1a60562ddda73956caa2c45ba (patch)
treeba06bf244f8c5f19a414b3b088a46d3d133dc92f
parent3aefdd05a5b7cdd70f0d18a0bf9ff3444b1a62ba (diff)
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/branches/2.2@11508 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--install/db/94-database.php26
1 files changed, 21 insertions, 5 deletions
diff --git a/install/db/94-database.php b/install/db/94-database.php
index 3c58343da..1121e22f4 100644
--- a/install/db/94-database.php
+++ b/install/db/94-database.php
@@ -61,12 +61,28 @@ while ($row = pwg_db_fetch_assoc($result)) {
// 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