Check the iumio Framework version
@return string If iumio Framework version is compatible
420847
final public static function checkFrameworkBuildVersion()
    {
        $f = json_decode(file_get_contents(__DIR__."/../../elements/config_files/core/framework.config.json"));

        if (!property_exists($f, 'installation')) {
            return (json_encode(array("code" => 500, "results" => "NOK", "fv" => "unknow",
                "msg" => "Property [installation] is undefined in framework.config.json file")));
        }

        if ($f->installation != null) {
            return (json_encode(array("code" => 500, "results" => "NOK", "fv" => "unknow",
                "msg" => "Cannot use iumio installer because you have already one app installed.")));
        }

        $v = $f->edition_version;
        $build = $f->edition_build;
        $e = $f->edition_fullname;
        $st = $f->edition_stage;

        if ($build >= self::$framework_build_accept) {
            $_SESSION['version'] = trim($v);
            return (json_encode(array("code" => 200, "results" => "OK", "fv" => trim($v), "edition" => $e,
                'stage' => $st)));
        } else {
            return (json_encode(array("code" => 500, "results" => "NOK", "fv" => trim($v),
                "msg" => "The version of iumio Framework is incompatible with iumio installer.
                 You must have at least version " . self::$framework_version_accept .
                    " of iumio Framework on your web server.")));
        }
    }
364427
protected function checkBrowserSafari()
    {
        if (stripos($this->_agent, 'Safari') !== false
            && stripos($this->_agent, 'iPhone') === false
            && stripos($this->_agent, 'iPod') === false
        ) {

            $aresult = explode('/', stristr($this->_agent, 'Version'));
            if (isset($aresult[1])) {
                $aversion = explode(' ', $aresult[1]);
                $this->setVersion($aversion[0]);
            } else {
                $this->setVersion(self::VERSION_UNKNOWN);
            }
            $this->setBrowser(self::BROWSER_SAFARI);
            return true;
        }
        return false;
    }
1331269
protected function defaultVersion()
    {
        $packageInfo = Json::decode(file_get_contents(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'composer.json'));
        $extensionName = $packageInfo['name'];
        if (isset(Yii::$app->extensions[$extensionName])) {
            return Yii::$app->extensions[$extensionName]['version'];
        }
        return parent::defaultVersion();
    }
919101
protected function isVersioned()
    {
        /** @var Versioned|DataObject $owner */
        $owner = $this->owner;
        return class_exists(Versioned::class)
            && $owner->hasExtension(Versioned::class)
            && $owner->hasStages();
    }
670377
protected function isMariaDb1027()
    {
        if (!isset($this->mariaDb1027)) {
            $version = $this->_conn->fetchColumn("select version()");

            $this->mariaDb1027 = false;
            if (preg_match('/mariadb/i', $version) && version_compare($version, '10.2.7') >= 0) {
                $this->mariaDb1027 = true;
            }
        }

        return $this->mariaDb1027;
    }
586486
protected function validateVersion()
    {
        $data = $this->configuration;

        $matches = [];
        if (!isset($data['version']) or ! preg_match('/^([0-9]).*$/i', $data['version'], $matches)) {
            array_push($this->messages, ['error', trans('Unable to read php version. It is recommended to contact with your provider.')]);
            return $this;
        }
        if (!isset($matches[1])) {
            array_push($this->messages, ['error', trans('Unable to read php primary version. It is recommended to contact with your provider.')]);
        }
        if ((int) $matches[1] < 7) {
            array_push($this->messages, ['warning', sprintf('Current PHP Version (%s) does not match the minimum system requirements. It is recommended to use PHP Version 7.', $data['version'])]);
        }

        if (!preg_match('/^([0-9]).([0-9]).([0-9])$/', $data['version'])) {
            array_push($this->messages, ['warning', sprintf('Current PHP Version (%s) is not stable. Use only stable releases.', $data['version'])]);
        }
        return $this;
    }
199480
public function checkPhpVersion() {
		$phpVesion = $this->_modelConfigInstaller->getPhpVersionConfig();
		if (empty($phpVesion)) {
			return null;
		}

		$result = true;
		foreach ($phpVesion as $phpVesionItem) {
			if (!is_array($phpVesionItem)) {
				continue;
			}

			$phpVesionItem += ['', null];
			list($version, $operator) = $phpVesionItem;
			if (empty($operator)) {
				$operator = '==';
			}

			$checkResult = false;
			if (!empty($version)) {
				$checkResult = version_compare(PHP_VERSION, $version, $operator);
			}
			if (!$checkResult) {
				$result = false;
			}
		}

		return $result;
	}
539207
public static function getCurrentVersion()
    {
        $aVersions = (array)self::_getConfig()->getConfigParam('aModuleVersions');

        $aPossibleModuleNames = array(
            'jagAmazonPayment4Oxid',
            'bestitAmazonPay4Oxid'
        );

        foreach ($aPossibleModuleNames as $sPossibleModuleName) {
            if (isset($aVersions[$sPossibleModuleName]) === true) {
                return $aVersions[$sPossibleModuleName];
            } elseif (isset($aVersions[strtolower($sPossibleModuleName)]) === true) {
                return $aVersions[strtolower($sPossibleModuleName)];
            }
        }

        return null;
    }
1013620
public function version()
    {
        $this->sendCommand('version');
        $res = fgets($this->conn, 4096);
        $this->checkForError($res);

        return trim($res);
    }
950598
protected function checkPlatformVersion()
    {
        $result = '';
        switch ($this->getPlatform()) {
            case self::PLATFORM_WINDOWS:
                if (preg_match('/Windows NT\s*(\d+(?:\.\d+)*)/i', $this->_agent, $foundVersion)) {
                    $result = 'NT ' . $foundVersion[1];
                } else {
                    //https://support.microsoft.com/en-us/kb/158238

                    if ($this->containString($this->_agent, array('Windows XP', 'WinXP', 'Win XP'))) {
                        $result = '5.1';
                    } else if ($this->containString($this->_agent, 'Windows 2000', 'Win 2000', 'Win2000')) {
                        $result = '5.0';
                    } else if ($this->containString($this->_agent, array('Win 9x 4.90', 'Windows ME', 'WinME', 'Win ME'))) {
                        $result = '4.90.3000'; //Windows Me version range from 4.90.3000 to 4.90.3000A
                    } else if ($this->containString($this->_agent, array('Windows 98', 'Win98', 'Win 98'))) {
                        $result = '4.10'; //Windows 98 version range from 4.10.1998 to 4.10.2222B
                    } else if ($this->containString($this->_agent, array('Windows 95', 'Win95', 'Win 95'))) {
                        $result = '4.00'; //Windows 95 version range from 4.00.950 to 4.03.1214
                    } else if (($foundAt = stripos($this->_agent, 'Windows 3')) !== false) {
                        $result = '3';
                        if (preg_match('/\d+(?:\.\d+)*/', substr($this->_agent, $foundAt + strlen('Windows 3')), $foundVersion)) {
                            $result .= '.' . $foundVersion[0];
                        }
                    } else if ($this->containString($this->_agent, 'Win16')) {
                        $result = '3.1';
                    }
                }
                break;

            case self::PLATFORM_MACINTOSH:
                if (preg_match('/Mac OS X\s*(\d+(?:_\d+)+)/i', $this->_agent, $foundVersion)) {
                    $result = str_replace('_', '.', $this->cleanVersion($foundVersion[1]));
                } else if ($this->containString($this->_agent, 'Mac OS X')) {
                    $result = '10';
                }
                break;

            case self::PLATFORM_ANDROID:
                if (preg_match('/Android\s+([^\s;$]+)/i', $this->_agent, $foundVersion)) {
                    $result = $this->cleanVersion($foundVersion[1]);
                }
                break;

            case self::PLATFORM_IOS:
                if (preg_match('/(?:CPU OS|iPhone OS|iOS)[\s_]*([\d_]+)/i', $this->_agent, $foundVersion)) {
                    $result = str_replace('_', '.', $this->cleanVersion($foundVersion[1]));
                }
                break;
        }

        if (trim($result) == '') {
            $result = self::PLATFORM_VERSION_UNKNOWN;
        }
        $this->setPlatformVersion($result);
    }
797864
public function checkPhpVersion()
    {
        $requirementFits = null;

        $minimalRequiredVersion = '7.0.0';
        $minimalRecommendedVersion = '7.0.0';
        $maximalRecommendedVersion = '7.1.9999';

        $installedPhpVersion = $this->getPhpVersion();

        if (version_compare($installedPhpVersion, $minimalRequiredVersion, '<')) {
            $requirementFits = static::MODULE_STATUS_BLOCKS_SETUP;
        }

        if (is_null($requirementFits) &&
            version_compare($installedPhpVersion, $minimalRecommendedVersion, '>=')
            && version_compare($installedPhpVersion, $maximalRecommendedVersion, '<=')) {
            $requirementFits = static::MODULE_STATUS_OK;
        }

        if (is_null($requirementFits)) {
            $requirementFits = static::MODULE_STATUS_FITS_MINIMUM_REQUIREMENTS;
        }

        return $requirementFits;
    }
1025599
protected function _readGarpVersion() {
        $versionInCaseOfError = 'v0.0.0';
        $lockFilePath = APPLICATION_PATH . '/../composer.lock';
        if (!file_exists($lockFilePath)) {
            return $versionInCaseOfError;
        }
        $lockFile = json_decode(file_get_contents($lockFilePath), true);
        $packages = $lockFile['packages'];

        return array_reduce(
            $packages,
            function ($prevVersion, $package) {
                // Found Garp? Return its version
                if ($package['name'] === 'grrr-amsterdam/garp3') {
                    return $package['version'];
                }
                // Otherwise return whatever version we previously got
                return $prevVersion;
            },
            // Initial value
            $versionInCaseOfError
        );
    }
1055142
public static function getVersion()
	{
		$match = array();
		$content = @file_get_contents( dirname( __DIR__ ) . DIRECTORY_SEPARATOR . 'ext_emconf.php' );

		if( preg_match( "/'version' => '([^']+)'/", $content, $match ) === 1 ) {
			return $match[1];
		}

		return '';
	}
558413
public function versionCompare($frameworkVersion, $compareVersion, $operator = null)
    {
        // Lumen (5.5.2) (Laravel Components 5.5.*)
        $lumenPattern = '/Lumen \((\d\.\d\.[\d|\*])\)( \(Laravel Components (\d\.\d\.[\d|\*])\))?/';

        if (preg_match($lumenPattern, $frameworkVersion, $matches)) {
            $frameworkVersion = isset($matches[3]) ? $matches[3] : $matches[1]; // Prefer Laravel Components version.
        }

        return version_compare($frameworkVersion, $compareVersion, $operator);
    }
421413
protected static function checkVersion()
    {
        if (self::$checked === true) {
            return true;
        }

        $process = new \SystemProcess\SystemProcess('bzr');
        $process->nonZeroExitCodeException = true;
        $process->argument('--version')->execute();

        if (!preg_match('/\Bazaar \(bzr\) ([0-9.]*)/', $process->stdoutOutput, $match)) {
            throw new \RuntimeException('Could not determine Bazaar version.');
        }

        if (version_compare($match[1], '1.1', '<')) {
            throw new \RuntimeException('Bazaar is required in a minimum version of 1.1.');
        }

        $process = new \SystemProcess\SystemProcess('bzr');
        $process->nonZeroExitCodeException = true;
        $process->argument('plugins')->execute();

        if (strpos($process->stdoutOutput, 'xmloutput') === false) {
            throw new \RuntimeException('Missing required bazaar pluging "xmloutput".');
        }

        return self::$checked = true;
    }
619981
public function version()
	{
		if (isset($this->data_cache['version']))
		{
			return $this->data_cache['version'];
		}

		if (($service = ibase_service_attach($this->hostname, $this->username, $this->password)))
		{
			$this->data_cache['version'] = ibase_server_info($service, IBASE_SVC_SERVER_VERSION);

			// Don't keep the service open
			ibase_service_detach($service);
			return $this->data_cache['version'];
		}

		return FALSE;
	}
356579
public function version() {
        $app = $this->app;
        if (defined(get_class($app).'::VERSION')) {
            return intval($app::VERSION);
        }

        if (is_callable([$app, 'version'])) {
            preg_match('/(\((\d+\.\d+\.\d+)\))/', $app->version(), $v);
            if (isset($v[2])) {
                return -intval($v[2]);
            }
        }

        return null;
    }