diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-06-15 15:50:10 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-06-15 15:50:10 -0700 |
commit | 4d40cf62e98e7e2f103740a401a08606c73fe72d (patch) | |
tree | 0d58be5e4b969fae07be16ca08bb996b436d5699 | |
parent | d96ce71f1a35b8659bec7226f3902a052485b0f9 (diff) |
Sort files by path in _dump_var() for consistent output.
Skip . and .. (PHP 5.3 iterators seem to include those now).
-rw-r--r-- | modules/gallery/controllers/packager.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/gallery/controllers/packager.php b/modules/gallery/controllers/packager.php index 6eafd9df..0ccfe743 100644 --- a/modules/gallery/controllers/packager.php +++ b/modules/gallery/controllers/packager.php @@ -163,9 +163,11 @@ class Packager_Controller extends Controller { $paths = array(); foreach($objects as $name => $file){ - if ($file->getBasename() == "database.php") { + $path = $file->getPath(); + $basename = $file->getBasename(); + if ($basename == "database.php" || $basename == "." || $basename == "..") { continue; - } else if (basename($file->getPath()) == "logs" && $file->getBasename() != ".htaccess") { + } else if (basename($path) == "logs" && $basename != ".htaccess") { continue; } @@ -186,6 +188,7 @@ class Packager_Controller extends Controller { foreach ($paths as $path) { fwrite($fd, "!file_exists($path) && mkdir($path);\n"); } + ksort($files); foreach ($files as $file => $contents) { fwrite($fd, "file_put_contents($file, base64_decode(\"$contents\"));\n"); } |