Skip to content
Snippets Groups Projects
Commit 203761ad authored by Rasmus Fuhse's avatar Rasmus Fuhse
Browse files

re #33 : add studipMaxVersion right to manifest

parent 0f496d55
No related branches found
No related tags found
No related merge requests found
...@@ -121,7 +121,9 @@ class MarketRelease extends SimpleORMap { ...@@ -121,7 +121,9 @@ class MarketRelease extends SimpleORMap {
$this['studip_max_version'] = $manifest['studipMaxVersion']; $this['studip_max_version'] = $manifest['studipMaxVersion'];
if (!$this['studip_max_version']) { if (!$this['studip_max_version']) {
$versions = PluginMarket::getStudipReleases(); $versions = PluginMarket::getStudipReleases();
$this['studip_max_version'] = array_pop($versions).".99"; $manifest['studipMaxVersion']
= $this['studip_max_version']
= array_pop($versions).".99";
} }
$this['version'] = $manifest['version']; $this['version'] = $manifest['version'];
if ($this['repository_overwrites_descriptionfrom']) { if ($this['repository_overwrites_descriptionfrom']) {
...@@ -139,6 +141,7 @@ class MarketRelease extends SimpleORMap { ...@@ -139,6 +141,7 @@ class MarketRelease extends SimpleORMap {
} }
} }
$this->store(); $this->store();
file_put_contents($dir."/plugin.manifest", $this->createManifest($manifest));
$hash = md5(uniqid()); $hash = md5(uniqid());
$plugin_raw = $GLOBALS['TMP_PATH']."/plugin_$hash.zip"; $plugin_raw = $GLOBALS['TMP_PATH']."/plugin_$hash.zip";
create_zip_from_directory($dir, $plugin_raw); create_zip_from_directory($dir, $plugin_raw);
...@@ -158,4 +161,12 @@ class MarketRelease extends SimpleORMap { ...@@ -158,4 +161,12 @@ class MarketRelease extends SimpleORMap {
&& ( !$this->studip_max_version || version_compare($version, $this->studip_max_version) <= 0 ); && ( !$this->studip_max_version || version_compare($version, $this->studip_max_version) <= 0 );
} }
protected function createManifest($manifest) {
$arr = array();
foreach ($manifest as $index => $value) {
$arr[] = $index."=".$value;
}
return implode("\n", $arr);
}
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment