Finds the PHP required version from Bolt version.

@return string
541420
protected function getPhpRequiredVersion()
    {
        if (!file_exists($path = $this->rootPath . '/composer.lock')) {
            return self::LEGACY_REQUIRED_PHP_VERSION;
        }

        $composerLock = json_decode(file_get_contents($path), true);
        foreach ($composerLock['packages'] as $package) {
            if ($package['name'] === 'bolt/bolt') {
                return (int) $package['version'][1] > 3 ? self::REQUIRED_PHP_VERSION : self::LEGACY_REQUIRED_PHP_VERSION;
            }
        }

        return self::LEGACY_REQUIRED_PHP_VERSION;
    }
720365
public function phpunit_compat() {

		if ( class_exists( 'PHPUnit\Runner\Version' ) ) {
			
			$tests_dir = $this->get_wp_tests_dir();

			// Back-compat for older WP versions.
			if ( file_exists( $tests_dir . '/includes/phpunit6-compat.php' ) ) {
			
				/**
				 * Compatibility with PHPUnit 6+.
				 *
				 * @since 0.3.2
				 */
				require_once $tests_dir . '/includes/phpunit6-compat.php';

			} else {
			
				/**
				 * Compatibility with PHPUnit 6+.
				 *
				 * @since 0.3.6
				 */
				require_once $tests_dir . '/includes/phpunit6/compat.php';
			}
			
			class_alias(
				'PHPUnit\Framework\Constraint\Constraint'
				, 'PHPUnit_Framework_Constraint'
			);
		}
	}
652851
public static function getTheliaSimpleVersion()
    {
        $majorVersion = self::read('thelia_major_version');
        $minorVersion = self::read('thelia_minus_version');
        $releaseVersion = self::read('thelia_release_version');

        return $majorVersion.'.'.$minorVersion.'.'.$releaseVersion;
    }
649014
public function setVersion() {
		$wp_filesystem = self::getWpFilesystem();

		// Get installed composer package data.
		$installedFile = wp_normalize_path( realpath( __DIR__ . '/../../../../' ) ) . '/composer/installed.json';

		if ( 'direct' === get_filesystem_method() ) {
			$file = $wp_filesystem->get_contents(  $installedFile );
		} else {
			$installedUrl = str_replace( ABSPATH, get_site_url() . '/', $installedFile );
			$file = wp_remote_retrieve_body( wp_remote_get( $installedUrl ) );
		}

		$installed = json_decode( $file, true );

		// Check for dep's installed version.
		$version = null;
		if ( $installed ) {
			foreach( $installed as $key => $value ) {
				if ( $value['name'] === $this->getDependency() ) {
					$version = $value['version_normalized'];
					break;
				}
			}
		}

		return $version;
	}
1290026
public function getServerVersion()
    {
        try {
            $stmt = $this->query('SELECT service_level, fixpack_num FROM TABLE (sysproc.env_get_inst_info()) as INSTANCEINFO');
            $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
            if (count($result)) {
                $matches = null;
                if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $result[0][0], $matches)) {
                    return $matches[1];
                } else {
                    return null;
                }
            }
            return null;
        } catch (PDOException $e) {
            return null;
        }
    }
1175501
public function getVersion()
    {
        $separator = $this->config->useUnicode() ? '—' : '-';

        return \sprintf('Psy Shell %s (PHP %s %s %s)', self::VERSION, PHP_VERSION, $separator, PHP_SAPI);
    }
351866
public function getInstallVersion()
    {
        Option::clearCachedOption(self::OPTION_NAME_MATOMO_INSTALL_VERSION);
        $version = Option::get(self::OPTION_NAME_MATOMO_INSTALL_VERSION);
        if (!empty($version)) {
            return $version;
        }
    }
828087
protected function validate_version_php() {

        if (!isset($this->assertions['plugintype'])) {
            throw new coding_exception('Required plugin type must be set before calling this');
        }

        if (!isset($this->assertions['moodleversion'])) {
            throw new coding_exception('Required Moodle version must be set before calling this');
        }

        $fullpath = $this->extractdir.'/'.$this->rootdir.'/version.php';

        if (!file_exists($fullpath)) {
            // This is tolerated for themes only.
            if ($this->assertions['plugintype'] === 'theme') {
                $this->add_message(self::DEBUG, 'missingversionphp');
                return true;
            } else {
                $this->add_message(self::ERROR, 'missingversionphp');
                return false;
            }
        }

        $this->versionphp = array();
        $info = $this->parse_version_php($fullpath);

        if (isset($info['module->version'])) {
            $this->add_message(self::ERROR, 'versionphpsyntax', '$module');
            return false;
        }

        if (isset($info['plugin->version'])) {
            $this->versionphp['version'] = $info['plugin->version'];
            $this->add_message(self::INFO, 'pluginversion', $this->versionphp['version']);
        } else {
            $this->add_message(self::ERROR, 'missingversion');
            return false;
        }

        if (isset($info['plugin->requires'])) {
            $this->versionphp['requires'] = $info['plugin->requires'];
            if ($this->versionphp['requires'] > $this->assertions['moodleversion']) {
                $this->add_message(self::ERROR, 'requiresmoodle', $this->versionphp['requires']);
                return false;
            }
            $this->add_message(self::INFO, 'requiresmoodle', $this->versionphp['requires']);
        }

        if (!isset($info['plugin->component'])) {
            $this->add_message(self::ERROR, 'missingcomponent');
            return false;
        }

        $this->versionphp['component'] = $info['plugin->component'];
        list($reqtype, $reqname) = core_component::normalize_component($this->versionphp['component']);
        if ($reqtype !== $this->assertions['plugintype']) {
            $this->add_message(self::ERROR, 'componentmismatchtype', array(
                'expected' => $this->assertions['plugintype'],
                'found' => $reqtype));
            return false;
        }
        if ($reqname !== $this->rootdir) {
            $this->add_message(self::ERROR, 'componentmismatchname', $reqname);
            return false;
        }
        $this->add_message(self::INFO, 'componentmatch', $this->versionphp['component']);

        if (isset($info['plugin->maturity'])) {
            $this->versionphp['maturity'] = $info['plugin->maturity'];
            if ($this->versionphp['maturity'] === 'MATURITY_STABLE') {
                $this->add_message(self::INFO, 'maturity', $this->versionphp['maturity']);
            } else {
                $this->add_message(self::WARNING, 'maturity', $this->versionphp['maturity']);
            }
        }

        if (isset($info['plugin->release'])) {
            $this->versionphp['release'] = $info['plugin->release'];
            $this->add_message(self::INFO, 'release', $this->versionphp['release']);
        }

        return true;
    }
1016627
public function getClientVersion()
    {
        $this->_connect();

        $version  = $this->_connection->server_version;
        $major    = (int)($version / 10000);
        $minor    = (int)($version % 10000 / 100);
        $revision = (int)($version % 100);

        return $major . '.' . $minor . '.' . $revision;
    }
584476
public function getVersion()
    {
        if ($package = $this->getComposerInstall()) {
            if ($package->version === 'dev-master') {
                return 'dev-master (' . substr($package->source->reference, 0, 8) . ')';
            }
            return 'v' . $package->version;
        }
        return 'v' . self::$VERSION;
    }
704596
protected function getCurrentVersion()
    {
        $version = $this->getBinary()->run('--version');
        $version = str_replace('v', null, $version);

        return $version;
    }
78937
protected function find()
    {
        if (!File::exists($this->workingPath . '/composer.phar'))
        {
            return 'composer';
        }

        $binary = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));

        if (defined('HHVM_VERSION'))
        {
            $binary .= ' --php';
        }

        return "{$binary} composer.phar";
    }
1089690
public function getNextTailVersion()
    {
        if (count($this->stabilityVersion) && $this->stabilityVersion[0] != 'stable') {
            return implode('.', $this->version);
        }
        $v = $this->version;
        $last = count($v) - 1;
        if ($v[$last] !== '*') {
            ++$v[$last];
        }

        return implode('.', $v);
    }
961132
public function update()
    {
        /** @var \Bolt\Filesystem\Handler\JsonFile $jsonFile */
        $jsonFile = $this->app['filesystem']->get('extensions://composer.json', new JsonFile());

        if (!$jsonFile->exists()) {
            try {
                $this->init('extensions://composer.json');
            } catch (IOException $e) {
                $this->messages[] = Trans::__('page.extend.error-composer-json-not-readable');

                $this->app['extend.writeable'] = false;
                $this->app['extend.online'] = false;

                return null;
            }
        }

        $json = $jsonOrig = $jsonFile->parse();

        // Workaround Bolt 2.0 installs with "require": []
        if (isset($json['require']) && empty($json['require'])) {
            unset($json['require']);
        }

        $json = $this->setJsonDefaults($json);

        // Write out the file, but only if it's actually changed, and if it's writable.
        if ($json != $jsonOrig) {
            try {
                $jsonFile->dump($json);
            } catch (IOException $e) {
                $this->messages[] = Trans::__('page.extend.error-composer-json-not-writable');
            }
        }

        return $json;
    }
904514
public function getVersionString() {
        if (!isset($this->versionString)) {
            if (!$this->isConnected())
                $this->connect();
            $this->versionString = $this->sqlite->version()['versionString'];
        }
        return $this->versionString;
    }
1104407
protected function getPhpRequiredVersion()
    {
        if (!file_exists($path = __DIR__.'/../composer.lock')) {
            return false;
        }

        $composerLock = json_decode(file_get_contents($path), true);
        foreach ($composerLock['packages'] as $package) {
            $name = $package['name'];
            if ('symfony/symfony' !== $name && 'symfony/http-kernel' !== $name) {
                continue;
            }

            return (int) $package['version'][1] > 2 ? self::REQUIRED_PHP_VERSION : self::LEGACY_REQUIRED_PHP_VERSION;
        }

        return false;
    }
1100905
public function getBuckramVersion() {
		$fullpath = realpath( $this->sass->pathToGlobals() . 'buckram.scss' );
		if ( is_file( $fullpath ) ) {
			return get_file_data(
				$fullpath,
				[
					'version' => 'Version',
				]
			)['version'];
		}
		return false; // No version available.
	}