Returns the solr server major version.

@return int
547517
public function get_solr_major_version() {
        if ($this->solrmajorversion !== null) {
            return $this->solrmajorversion;
        }

        // We should really ping first the server to see if the specified indexname is valid but
        // we want to minimise solr server requests as they are expensive. system() emits a warning
        // if it can not connect to the configured index in the configured server.
        $systemdata = @$this->get_search_client()->system();
        $solrversion = $systemdata->getResponse()->offsetGet('lucene')->offsetGet('solr-spec-version');
        $this->solrmajorversion = intval(substr($solrversion, 0, strpos($solrversion, '.')));

        return $this->solrmajorversion;
    }
385120
public function getServerVersion()
    {
        if ($this->client) {
            return $this->client->getServerVersion();
        }

        $connection = new Connection($this->config);
        
        return $connection->getAttribute(\PDO::ATTR_SERVER_VERSION);
    }
1042191
public function version()
	{
		if (isset($this->data_cache['version']))
		{
			return $this->data_cache['version'];
		}

		// Not all subdrivers support the getAttribute() method
		try
		{
			return $this->data_cache['version'] = $this->conn_id->getAttribute(PDO::ATTR_SERVER_VERSION);
		}
		catch (PDOException $e)
		{
			return parent::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;
        }
    }
347042
public static function solr_options()
    {
        if (self::$merged_solr_options) {
            return self::$merged_solr_options;
        }

        $defaults = array(
            'host' => 'localhost',
            'port' => 8983,
            'path' => '/solr',
            'version' => '4'
        );

        // Build some by-version defaults
        $version = isset(self::$solr_options['version']) ? self::$solr_options['version'] : $defaults['version'];

        /** @var Module $module */
        $module = ModuleLoader::getModule('silverstripe/fulltextsearch');
        $modulePath = $module->getPath();

        if (version_compare($version, '4', '>=')) {
            $versionDefaults = [
                'service'       => Solr4Service::class,
                'extraspath'    => $modulePath . '/conf/solr/4/extras/',
                'templatespath' => $modulePath . '/conf/solr/4/templates/',
            ];
        } else {
            $versionDefaults = [
                'service'       => Solr3Service::class,
                'extraspath'    => $modulePath . '/conf/solr/3/extras/',
                'templatespath' => $modulePath . '/conf/solr/3/templates/',
            ];
        }

        return (self::$merged_solr_options = array_merge($defaults, $versionDefaults, self::$solr_options));
    }
1051860
protected function version()
    {
        $version = $this->argument('version');

        if (! $version) {
            return $this->latestVersion();
        }

        if (! ctype_digit($version)) {
            return $version;
        }

        $version = (int) $version;

        if ($version < 70) {
            return $this->legacyVersions[$version];
        }

        return trim(file_get_contents(
            sprintf($this->versionUrl, $version)
        ));
    }
151777
public function getVersion()
    {
        $code = $this->runShell('tika --version', $stdout);

        // Parse output
        if (!$code && preg_match('/Apache Tika (?<version>[\.\d]+)/', $stdout, $matches)) {
            return $matches['version'];
        }

        return 0;
    }
284863
public function getVersion()
    {
        if (isset($this->version)) {
            return (string)$this->version;
        } else {
            OsDetector::detect($this, $this->getUserAgent());

            return (string)$this->version;
        }
    }
1120862
public function getProtocolVersion()
    {
        if ($this->_protocolVersion === null) {
            $this->_protocolVersion = $this->defaultProtocolVersion();
        }
        return $this->_protocolVersion;
    }
572544
public function getSolr() {
		if (!$this->client) {
			if (!$this->solrTransport) {
				$this->solrTransport = new Apache_Solr_HttpTransport_Curl;
			}
			$this->client = new Apache_Solr_Service(self::$solr_details['host'], self::$solr_details['port'], self::$solr_details['context'], $this->solrTransport);
		}

		return $this->client;
	}
329463
public function getVersion()
    {
        $isIPv4 = filter_var($this->toNative(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);

        if (false !== $isIPv4) {
            return IPAddressVersion::IPV4();
        }

        return IPAddressVersion::IPV6();
    }
728031
private function getServerVersion()
    {
        $connection = $this->getWrappedConnection();

        // Automatic platform version detection.
        if ($connection instanceof ServerInfoAwareConnection && ! $connection->requiresQueryForServerVersion()) {
            return $connection->getServerVersion();
        }

        // Unable to detect platform version.
        return null;
    }
1103136
protected function getVersion()
    {
        static $version;
        if (!$version) {
            $version = false;
            $string = $this->execute(['--version'], false);
            if ($string && preg_match('/(^| )([0-9]+[^ ]*)/', $string, $matches)) {
                $version = $matches[2];
            }
        }

        return $version;
    }
96967
public function version()
    {
        if ( $this->versionObject === null )
            $this->versionObject = eZContentObjectVersion::fetch( $this->attribute( 'ezcontentobject_version_id' ) );

        return $this->versionObject;
    }
890916
protected function getVersion()
    {
        // Get version from tag
        $cmd = new Command('git');
        $cmd = $cmd->arg('tag')
            ->execute();
        $output = explode(PHP_EOL, trim($cmd->getOutput()));
        $currentVersion = '0.0.0';
        foreach ($output as $tag) {
            if (preg_match(SemanticVersion::REGEX, $tag)) {
                if (version_compare($currentVersion, $tag, '<')) {
                    $currentVersion = $tag;
                }
            }
        }
        return new SemanticVersion($currentVersion);
    }
1371743
public function getVersion()
    {
        return new Version(
            $this->major,
            $this->minor,
            $this->patch,
            $this->preRelease,
            $this->build
        );
    }
35510
public function 
    {

        $dmm = $this;

        usort($this->migrations, function ($a, $b) use ($dmm) {

            $av = $a->getVersion();
            $bv = $b->getVersion();

            if ($dmm->direction == 'up') {
                return version_compare($av, $bv);
            } elseif ($dmm->direction == 'down') {
                return version_compare($bv, $av);
            }
        });
    }