22 function __construct($major, $minor, $revision, $build, $dateInstalled, $current,
23 $productType, $product, $productClassName, $lazyLoad, $sitewide) {
25 parent::__construct();
51 if (is_object($version)) {
52 return $this->
compare($version->getVersionString());
67 static function fromString($versionString, $productType =
null, $product =
null, $productClass =
'', $lazyLoad = 0, $sitewide = 1) {
68 $versionArray = explode(
'.', $versionString);
70 if(!$product && !$productType) {
73 $productType =
'core';
77 (isset($versionArray[0]) ? (
int) $versionArray[0] : 0),
78 (isset($versionArray[1]) ? (
int) $versionArray[1] : 0),
79 (isset($versionArray[2]) ? (
int) $versionArray[2] : 0),
80 (isset($versionArray[3]) ? (
int) $versionArray[3] : 0),
102 return $this->
getData(
'major');
110 $this->
setData(
'major', $major);
118 return $this->
getData(
'minor');
126 $this->
setData(
'minor', $minor);
134 return $this->
getData(
'revision');
142 $this->
setData(
'revision', $revision);
150 return $this->
getData(
'build');
158 $this->
setData(
'build', $build);
166 return $this->
getData(
'dateInstalled');
174 $this->
setData(
'dateInstalled', $dateInstalled);
182 return $this->
getData(
'current');
190 $this->
setData(
'current', $current);
198 return $this->
getData(
'productType');
206 $this->
setData(
'productType', $productType);
214 return $this->
getData(
'product');
222 $this->
setData(
'product', $product);
230 return $this->
getData(
'productClassName');
238 $this->
setData(
'productClassName', $productClassName);
246 return $this->
getData(
'lazyLoad');
254 $this->
setData(
'lazyLoad', $lazyLoad);
262 return $this->
getData(
'sitewide');
270 $this->
setData(
'sitewide', $sitewide);
280 if (!$numeric && $this->
getProduct() ==
'omp' && preg_match(
'/^0\.9\.9\./', $numericVersion))
return (
'1.0 Beta');
281 if (!$numeric && $this->
getProduct() ==
'ojs2' && preg_match(
'/^2\.9\.0\./', $numericVersion))
return (
'3.0 Alpha 1');
282 if (!$numeric && $this->
getProduct() ==
'ojs2' && preg_match(
'/^2\.9\.9\.0/', $numericVersion))
return (
'3.0 Beta 1');
283 if (!$numeric && $this->
getProduct() ==
'ops' && preg_match(
'/^3\.2\.0\.0/', $numericVersion))
return (
'3.2.0 Beta');
285 return $numericVersion;