Krinkle has submitted this change and it was merged.

Change subject: gitignore: Ignore cache/*.json
......................................................................


gitignore: Ignore cache/*.json

These shouldn't cause a local git clone to have local changes.

Change-Id: I05cb8ac7bf4a418b79cdb28385ac7d1f77247fb5
---
M .gitignore
A README.md
M app.php
R cache/.gitignore
4 files changed, 9 insertions(+), 3 deletions(-)

Approvals:
  Krinkle: Verified; Looks good to me, approved



diff --git a/.gitignore b/.gitignore
index 7579f74..4210414 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 vendor
 composer.lock
+cache/*.json
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..3634543
--- /dev/null
+++ b/README.md
@@ -0,0 +1,6 @@
+# Global user contributions
+
+## Set up
+
+* `chmod 775 cache/`
+* `ln -s path/to/guc public_html`
diff --git a/app.php b/app.php
index 3ccbdab..ed0f8d7 100644
--- a/app.php
+++ b/app.php
@@ -200,9 +200,8 @@
 
         // Initialize cache
         if (!is_array($cache)) {
-            $rawCache = file_get_contents(settings::getSetting('cacheFile'));
-            if ($rawCache) {
-                $cache = json_decode($rawCache, true);
+            if (is_readable(settings::getSetting('cacheFile'))) {
+                $cache = 
json_decode(file_get_contents(settings::getSetting('cacheFile')), true);
             } else {
                 $cache = array();
             }
diff --git a/cache/namespaces.json b/cache/.gitignore
similarity index 100%
rename from cache/namespaces.json
rename to cache/.gitignore

-- 
To view, visit https://gerrit.wikimedia.org/r/174904
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I05cb8ac7bf4a418b79cdb28385ac7d1f77247fb5
Gerrit-PatchSet: 6
Gerrit-Project: labs/tools/guc
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Luxo <luxo...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to