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
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/Version.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/Version.php b/core/Version.php
index 393f081a15..27be60d8ce 100644
--- a/core/Version.php
+++ b/core/Version.php
@@ -21,4 +21,20 @@ final class Version
* @var string
*/
const VERSION = '2.11.0-b2';
+
+ 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);
+ }
+
}