16 define(
'PLUGIN_GALLERY_STATE_AVAILABLE', 0);
17 define(
'PLUGIN_GALLERY_STATE_INCOMPATIBLE', 0);
18 define(
'PLUGIN_GALLERY_STATE_UPGRADABLE', 1);
19 define(
'PLUGIN_GALLERY_STATE_CURRENT', 2);
20 define(
'PLUGIN_GALLERY_STATE_NEWER', 3);
39 $this->
setData(
'name', $name, $locale);
48 return $this->
getData(
'name', $locale);
56 return $this->
getData(
'homepage');
64 $this->
setData(
'homepage', $homepage);
72 return $this->
getData(
'product');
80 $this->
setData(
'product', $product);
88 return $this->
getData(
'category');
96 $this->
setData(
'category', $category);
106 $version = $this->
getData(
'version');
109 $separators = substr_count($version,
'.');
110 if ($separators<3) $version .= str_repeat(
'.0', 3-$separators);
120 $this->
setData(
'version', $version);
144 return $this->
getData(
'contactName');
152 $this->
setData(
'contactName', $contactName);
160 return $this->
getData(
'contactInstitutionName');
168 $this->
setData(
'contactInstitutionName', $contactInstitutionName);
176 return $this->
getData(
'contactEmail');
184 $this->
setData(
'contactEmail', $contactEmail);
193 return $this->
getData(
'summary', $locale);
202 $this->
setData(
'summary', $summary, $locale);
211 return $this->
getData(
'description', $locale);
220 $this->
setData(
'description', $description, $locale);
229 return $this->
getData(
'installation', $locale);
238 $this->
setData(
'installation', $installation, $locale);
247 return $this->
getData(
'releaseDescription', $locale);
256 $this->
setData(
'releaseDescription', $releaseDescription, $locale);
264 return $this->
getData(
'releaseMD5');
272 $this->
setData(
'releaseMD5', $releaseMD5);
280 return $this->
getData(
'releaseCertifications');
288 $this->
setData(
'releaseCertifications', $certifications);
296 return $this->
getData(
'releasePackage');
304 $this->
setData(
'releasePackage', $releasePackage);
356 if ($this->
getVersion()===
null)
return PLUGIN_GALLERY_STATE_INCOMPATIBLE;
357 if (!$installedVersion)
return PLUGIN_GALLERY_STATE_AVAILABLE;
358 if ($installedVersion->compare($this->getVersion(
true))>0)
return PLUGIN_GALLERY_STATE_NEWER;
359 if ($installedVersion->compare($this->getVersion(
true))<0)
return PLUGIN_GALLERY_STATE_UPGRADABLE;
362 if (!is_dir($targetPath))
return PLUGIN_GALLERY_STATE_UPGRADABLE;
364 return PLUGIN_GALLERY_STATE_CURRENT;