Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/Version.php')
-rw-r--r--core/Version.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/Version.php b/core/Version.php
index 179d6fd541..eab5ff373f 100644
--- a/core/Version.php
+++ b/core/Version.php
@@ -21,4 +21,20 @@ final class Version
* @var string
*/
const VERSION = '2.11.0-b3';
+
+ public function isStableVersion($version)
+ {
+ return (bool) preg_match('/^(\d+)\.(\d+)\.(\d+)$/', $version);
+ }
+
+ public function isVersionNumber($version)
+ {
+ return $this->isStableVersion($version) || $this->isNonStableVersion($version);
+ }
+
+ private function isNonStableVersion($version)
+ {
+ return (bool) preg_match('/^(\d+)\.(\d+)\.(\d+)-.{1,4}(\d+)$/', $version);
+ }
+
}