Page MenuHomeDevCentral

D164.id392.diff
No OneTemporary

D164.id392.diff

diff --git a/app/Phabricator/ProjectsMap.php b/app/Phabricator/ProjectsMap.php
--- a/app/Phabricator/ProjectsMap.php
+++ b/app/Phabricator/ProjectsMap.php
@@ -126,7 +126,7 @@
}
/**
- * Gets a new ProjectsMap instance and queries Phabricator API to fill it.
+ * Gets a new ProjectsMap instance and queries Phabricator API to fill it
*
* @param string $phabricatorURL The Phabricator URL (e.g. http://secure.phabricator.com)
* @return ProjectsMap
@@ -141,7 +141,10 @@
/// API
///
- public function fetchFromAPI () {
+ /**
+ * Fetches the projects' map from the Phabricator API
+ */
+ private function fetchFromAPI () {
$reply = PhabricatorAPI::forInstance($this->instance)->call(
'project.query',
[ 'limit' => self::LIMIT ]
@@ -175,14 +178,27 @@
return class_basename(get_class($this)) . '-' . md5($this->instance);
}
- public function isCached () {
+ /**
+ * Determines if the instance is cached
+ *
+ * @return bool true if cached; otherwise, false.
+ */
+ private function isCached () {
return Cache::has($this->getCacheKey());
}
+ /**
+ * Saves data to cache
+ */
public function saveToCache () {
Cache::forever($this->getCacheKey(), $this->map);
}
+ /**
+ * Loads data from cache
+ *
+ * Populates 'map' and 'source' properties
+ */
public function loadFromCache () {
$this->map = Cache::get($this->getCacheKey());
$this->source = 'cache';

File Metadata

Mime Type
text/plain
Expires
Fri, May 2, 15:26 (3 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2625161
Default Alt Text
D164.id392.diff (1 KB)

Event Timeline