/**
  * Returns all versions of a plugin from its version file.
  */
 protected function getFileVersions($code)
 {
     if ($this->fileVersions !== null && array_key_exists($code, $this->fileVersions)) {
         return $this->fileVersions[$code];
     }
     $versionFile = $this->getVersionFile($code);
     $versionInfo = Yaml::parseFile($versionFile);
     if ($versionInfo) {
         uksort($versionInfo, function ($a, $b) {
             return version_compare($a, $b);
         });
     }
     return $this->fileVersions[$code] = $versionInfo;
 }
Beispiel #2
0
 /**
  * Reads the theme.yaml file and returns the theme configuration values.
  * @return array Returns the parsed configuration file values.
  */
 public function getConfig()
 {
     if ($this->configCache !== null) {
         return $this->configCache;
     }
     $path = $this->getPath() . '/theme.yaml';
     if (!File::exists($path)) {
         return $this->configCache = [];
     }
     return $this->configCache = Yaml::parseFile($path);
 }