Browse files

I've removed attributes.php from the uploads directory, as this file …

…is automatically created/updated by the software, and so should not be under version control (it always gets marked as changed, which is incorrect and confusing, and may end up causing the changes to be committed to the repo accidentally). We also don't want any of the files that the application generates in this directory (the uploads themselves) to be accidentally committed to the repository, so I've added a .gitignore file to ignore everything except itself. Now that this is present, we no longer need empty.txt, which was originally added to make sure that Git created the directory (as there is no way to create truly empty directories in Git).

I've added a check to FilesController::repair() so that it works correctly when the file is not there, however the code which is used for all normal usage is nicely encapsulated in the FileRepository_Backend_FileSystem class, which already handles things correctly if the file is missing, so that was the only place that needed updating.

The only other reference to attributes.php is in tools/db2fs.php, but this is referring to a local version of the file in that directory, and so is unaffected by this change.
  • Loading branch information...
1 parent fbd062f commit 2ed1a3ebc9c41d5d5e89fe9b2f6bd7a931177a99 @MarkMaldaba MarkMaldaba committed Nov 13, 2012
@@ -1056,8 +1056,13 @@ function detach_from_object() {
* @return null
function repair() {
+ $attributesFile = ROOT . '/upload/attributes.php';
+ if (is_file($attributesFile)) {
+ $attributes = include $attributesFile;
+ } else {
+ $attributes = array();
+ }
- $attributes = include ROOT . '/upload/attributes.php';
foreach ($attributes as $k => $v) {
$files = ProjectFiles::findAll(array(
@@ -0,0 +1,5 @@
+# Ignore everything in this directory...
+# ...except this file
@@ -1,6 +0,0 @@
-return array (
No changes.

0 comments on commit 2ed1a3e

Please sign in to comment.