Check if contao/cor-bundle >= 4.5.0

@return boolean
490056
protected function isContao45()
	{
	    $packages = \System::getContainer()->getParameter('kernel.packages');
	    $coreVersion = $packages['contao/core-bundle']; //a.b.c
	    if ( version_compare($coreVersion, '4.5.0', '>=') )
	    {
	        ModuleVisitorLog::writeLog( __METHOD__ , __LINE__ , ': True' );
	        return true;
	    }
	    ModuleVisitorLog::writeLog( __METHOD__ , __LINE__ , ': False' );
	    return false;
	}
953963
public function isAppReadyToInstall() {
		$checkPHPversion = $this->checkPhpVersion();
		if ($checkPHPversion === false) {
			return false;
		}

		$checkPHPextensions = $this->checkPhpExtensions(true);
		if ($checkPHPextensions === false) {
			return false;
		}

		return true;
	}
270672
public function bundleExists($bundle)
    {
        $kernelBundles = $this->getConfigurationPool()->getContainer()->getParameter('kernel.bundles');
        if (array_key_exists($bundle, $kernelBundles)) {
            return true;
        }
        if (in_array($bundle, $kernelBundles)) {
            return true;
        }

        return false;
    }
778005
public function compatibility()
    {
        if (strpos($this->app->version(), '5.1.') !== false && strpos($this->app->version(), '(LTS)') !== false) {
            return 'LTS';
        }

        return 'Edge';
    }
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;
    }
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;
    }
1156532
protected function checkPlatformCustom()
    {
        foreach ($this->_customPlatformDetection as $platformName => $customPlatform) {
            $platformNameToLookFor = $customPlatform['platformNameToLookFor'];
            $isMobile = $customPlatform['isMobile'];
            if ($this->containString($this->_agent, $platformNameToLookFor)) {
                $this->setPlatform($platformName);
                if ($isMobile) {
                    $this->setMobile(true);
                }
                return true;
            }
        }

        return false;
    }
194938
private function is_premium_version_installed() {
            $premium_plugin_basename = $this->premium_plugin_basename();
            $premium_plugin          = get_plugins( '/' . dirname( $premium_plugin_basename ) );

            return ! empty( $premium_plugin );
        }
202177
public function canUpdate()
    {
        return $this->canModify() && (
            $this->canInstall() || (
                ! empty( $this->installedVersion ) && (
                    ( ( $this->availableVersion == 'dev-master' ||
                        $this->installedVersion == 'dev-master' ) &&
                      $this->installedReference != $this->availableReference ) ||
                    version_compare(
                        $this->availableVersion,
                        $this->installedVersion,
                        '>'
                    )
                )
            )
        );
    }
1232872
protected function checkPlatformVersion() 
    {
        // based on browscap.ini
        if ($this->_platform == self::PLATFORM_WINDOWS) 
        {
	        /*if( stripos($this->_agent, 'windows NT 7.1') !== false ) {
			    $this->_platform = self::PLATFORM_WINDOWS_7;
		    }
	        else*/
            if( stripos($this->_agent, 'windows NT 10.0') !== false ) 
            {
                $this->_platformVersion = self::PLATFORM_WINDOWS_10;
            }
            elseif( stripos($this->_agent, 'windows NT 6.3') !== false ) 
            {
                $this->_platformVersion = self::PLATFORM_WINDOWS_81;
                if( stripos($this->_agent, 'arm') !== false )
                {
                    $this->_platformVersion = self::PLATFORM_WINDOWS_RT;
                }
            }
            elseif( stripos($this->_agent, 'windows NT 6.2') !== false ) 
            {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_8;
			    if( stripos($this->_agent, 'arm') !== false ) 
			    {
			        $this->_platformVersion = self::PLATFORM_WINDOWS_RT;
			    }
		    }
		    elseif( stripos($this->_agent, 'windows NT 6.1') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_7;
		    }
		    elseif( stripos($this->_agent, 'windows NT 6.0') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_VISTA;
		    }
		    elseif( stripos($this->_agent, 'windows NT 5.2') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_2003;
		    }
		    elseif( stripos($this->_agent, 'windows NT 5.1') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_XP;
		    }
		    elseif( stripos($this->_agent, 'windows XP') !== false ) {
		        $this->_platformVersion = self::PLATFORM_WINDOWS_XP;
		    }
		    elseif( stripos($this->_agent, 'windows NT 5.0') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_2000;
		    }
		    elseif( stripos($this->_agent, 'windows NT 4.0') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_NT;
		    }
		    elseif( stripos($this->_agent, 'windows Me') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_ME;
		    }
		    elseif( stripos($this->_agent, 'windows 98') !== false ) {
			    $this->_platformVersion = self::PLATFORM_WINDOWS_98;
		    }
		    elseif( stripos($this->_agent, 'windows 95') !== false ) {
		        $this->_platformVersion = self::PLATFORM_WINDOWS_95;
		    }
        }

        if ($this->_platform == self::PLATFORM_WINDOWS_PHONE)
        {
            if ( stripos($this->_agent, 'Windows Phone OS') !== false )
            {
                $aresult = explode(' ',stristr($this->_agent,'Windows Phone OS'));
                $this->_platformVersion = self::PLATFORM_WINDOWS_PHONE .' '. str_replace(array('(',')',';'),'',$aresult[3]);
            }
            elseif ( stripos($this->_agent, 'Windows Phone') !== false )
            {
                $aresult = explode(' ',stristr($this->_agent,'Windows Phone'));
                $this->_platformVersion = self::PLATFORM_WINDOWS_PHONE .' '. str_replace(array('(',')',';'),'',$aresult[2]);
            }
        }
        
        if ($this->_platform == self::PLATFORM_APPLE)
        {
            if ( stripos($this->_agent, 'Mac OS X') !== false ) 
            {
                $this->_platformVersion = self::PLATFORM_MACOSX;
            }
            if ( stripos($this->_agent, 'iPad') !== false 
              || stripos($this->_agent, 'iPod') !== false
              || stripos($this->_agent, 'iPhone') !== false) 
            {
                $this->_platformVersion = self::PLATFORM_IOSX;
            }
        }
	    elseif( stripos($this->_agent, 'Warp 4') !== false ) {
		    $this->_platformVersion = self::PLATFORM_WARP4;
	    }
    }
166217
public function isVersionCheck()
    {
        if ($_SERVER['REQUEST_METHOD'] != 'POST') {
            $this->_logger->log('Invalid request method', Icepay_Api_Logger::ERROR);
            return false;
        }

        if ($this->data->status != "VCHECK")
            return false;

        return true;
    }
261826
protected function getChromeVersionOnIos()
    {
        $aresult = explode('/', stristr($this->_agent, 'CriOS'));
        if (isset($aresult[1])) {
            $aversion = explode(' ', $aresult[1]);
            $this->setVersion($aversion[0]);
            $this->setBrowser(self::BROWSER_CHROME);
            return true;
        }
        return false;
    }
417292
private function checkTusVersion() {
        $tusVersion = $this->getRequest()->getHeader('Tus-Resumable');
        if ($tusVersion instanceof \Zend\Http\Header\HeaderInterface) {
            return $tusVersion->getFieldValue() === self::TUS_VERSION;
        }
        return false;
    }
314682
public function check()
    {
        $pass = true;
        foreach ($this->_rules as $rule) {
            if ($rule->lhs() instanceof BasePackage) {
                $package = $rule->lhs();
            } else {
                $package = PackageFactory::create((string)$rule->lhs());
            }

            if (!$package->versionMatch($rule->rhs())) {
                $this->_fail($rule);
                $pass = false;
            } else {
                $this->_pass($rule);
            }
        }

        $this->_checked = true;

        return $pass;
    }
1122230
public boolean isConfluenceVersion4() {
        ConfluenceVersion confluenceVersion = getConfluenceVersion();
        return confluenceVersion.compareTo(ConfluenceVersion.V40X) >= 0 && confluenceVersion.compareTo(ConfluenceVersion.V50X) < 0;
    }
364811
public boolean isConfluenceVersion3() {
        ConfluenceVersion confluenceVersion = getConfluenceVersion();
        return confluenceVersion.compareTo(ConfluenceVersion.V30X) >= 0 && confluenceVersion.compareTo(ConfluenceVersion.V40X) < 0;
    }
137340
public function checkBE()
	{
	    if ($this->isContao45()) 
	    {
	        if ($this->_BackendUser)
	        {
                ModuleVisitorLog::writeLog( __METHOD__ , __LINE__ , ': True' );
                return true;
	        }
	        ModuleVisitorLog::writeLog( __METHOD__ , __LINE__ , ': False' );
	        return false;
	    }
		//Contao <4.5.0
	    $strCookie = 'BE_USER_AUTH';
		$hash = sha1(session_id() . (!\Config::get('privacyAnonymizeIp') ? \Environment::get('ip') : '') . $strCookie);
		if (\Input::cookie($strCookie) == $hash)
		{
			// Try to find the session
			$objSession = \SessionModel::findByHashAndName($hash, $strCookie);
			// Validate the session ID and timeout
			if ($objSession !== null && $objSession->sessionID == session_id() && (\Config::get('privacyAnonymizeIp') || $objSession->ip == \Environment::get('ip')) && ($objSession->tstamp + $GLOBALS['TL_CONFIG']['sessionTimeout']) > time())
			{
			    ModuleVisitorLog::writeLog( __METHOD__ , __LINE__ , ': True' );
				return true;
			}
		}
		ModuleVisitorLog::writeLog( __METHOD__ , __LINE__ , ': False' );
		return false;
	}