diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-30 21:16:47 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-30 21:16:47 -0800 |
commit | cb92e58d40bfa866c07b10fe189bd653074a9917 (patch) | |
tree | 54fa7a67629b45794528da05fc3b1ba506674e5c /modules | |
parent | c2a7a6a4e7b492c649462c1bb4e60c033819803e (diff) |
Update install.sql -- gallery version jumps from 23 to 25 due to a mistake
in the version 24 upgrade code.
Update packager to serialize files so that we can serialize the new
.htaccess files
Update init_var.php to include the newly serialized .htaccess files.
Fixes ticket #587.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gallery/controllers/packager.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/gallery/controllers/packager.php b/modules/gallery/controllers/packager.php index cb64f1bf..66626483 100644 --- a/modules/gallery/controllers/packager.php +++ b/modules/gallery/controllers/packager.php @@ -164,7 +164,7 @@ class Packager_Controller extends Controller { foreach($objects as $name => $file){ if ($file->getBasename() == "database.php") { continue; - } else if (basename($file->getPath()) == "logs") { + } else if (basename($file->getPath()) == "logs" && $file->getBasename() != ".htaccess") { continue; } @@ -172,8 +172,8 @@ class Packager_Controller extends Controller { $paths[] = "VARPATH . \"" . substr($name, strlen(VARPATH)) . "\""; } else { // @todo: serialize non-directories - print "IGNORING FILE: $name\n"; - return; + $files["VARPATH . \"" . substr($name, strlen(VARPATH)) . "\""] = + base64_encode(file_get_contents($name)); } } // Sort the paths so that the var file is stable @@ -185,6 +185,9 @@ class Packager_Controller extends Controller { foreach ($paths as $path) { fwrite($fd, "!file_exists($path) && mkdir($path);\n"); } + foreach ($files as $file => $contents) { + fwrite($fd, "file_put_contents($file, base64_decode(\"$contents\"));\n"); + } fclose($fd); } }
\ No newline at end of file |