/** * Syncronizes the tip database against the master wiki. * * @throws \Exception */ public function syncTips() { $uri = $this->container->getParameter('partkeepr.tip_of_the_day_list'); $tipsString = $this->remoteFileLoader->createLoader()->load($uri); $aPageNames = $this->extractPageNames($tipsString); $this->updateTipDatabase($aPageNames); }
public function getLatestVersion() { $data = $this->remoteFileLoader->createLoader()->load($this->versionURI); $versions = json_decode($data, true); if (!is_array($versions)) { return false; } $latestVersionEntry = $versions[0]; if (!array_key_exists("version", $latestVersionEntry)) { return false; } if (!array_key_exists("changelog", $latestVersionEntry)) { return array("version" => $latestVersionEntry["version"], "changelog" => ""); } else { return array("version" => $latestVersionEntry["version"], "changelog" => $latestVersionEntry["changelog"]); } }
/** * Returns the latest version information from partkeepr.org * * @return array|bool */ public function getLatestVersion() { $data = $this->remoteFileLoader->createLoader()->load($this->versionURI); $versions = json_decode($data, true); if (!is_array($versions)) { return false; } $latestVersionEntry = $versions[0]; if (!array_key_exists('version', $latestVersionEntry)) { return false; } if (!array_key_exists('changelog', $latestVersionEntry)) { return ['version' => $latestVersionEntry['version'], 'changelog' => '']; } else { return ['version' => $latestVersionEntry['version'], 'changelog' => $latestVersionEntry['changelog']]; } }