source/Core/Utils.php
public function setSearchEngine($blIsSe = null, $sClient = null)
    {
        if (isset($blIsSe)) {
            $this->_blIsSe = $blIsSe;

            return;
        }
        startProfile("isSearchEngine");

        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $blIsSe = false;

        if (!($myConfig->getConfigParam('iDebug') && $this->isAdmin())) {
            $aRobots = $myConfig->getConfigParam('aRobots');
            $aRobots = is_array($aRobots) ? $aRobots : [];

            $aRobotsExcept = $myConfig->getConfigParam('aRobotsExcept');
            $aRobotsExcept = is_array($aRobotsExcept) ? $aRobotsExcept : [];

            $sClient = $sClient ? $sClient : strtolower(getenv('HTTP_USER_AGENT'));
            $blIsSe = false;
            $aRobots = array_merge($aRobots, $aRobotsExcept);
            foreach ($aRobots as $sRobot) {
                if (strpos($sClient, $sRobot) !== false) {
                    $blIsSe = true;
                    break;
                }
            }
        }

        $this->_blIsSe = $blIsSe;

        stopProfile("isSearchEngine");
    }
public function setSearchEngine($blIsSe = null, $sClient = null)
    {
        if (isset($blIsSe)) {
            $this->_blIsSe = $blIsSe;

            return;
        }
        startProfile("isSearchEngine");

        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        $blIsSe = false;

        if (!($myConfig->getConfigParam('iDebug') && $this->isAdmin())) {
            $aRobots = $myConfig->getConfigParam('aRobots');
            $aRobots = is_array($aRobots) ? $aRobots : [];

            $aRobotsExcept = $myConfig->getConfigParam('aRobotsExcept');
            $aRobotsExcept = is_array($aRobotsExcept) ? $aRobotsExcept : [];

            $sClient = $sClient ? $sClient : strtolower(getenv('HTTP_USER_AGENT'));
            $blIsSe = false;
            $aRobots = array_merge($aRobots, $aRobotsExcept);
            foreach ($aRobots as $sRobot) {
                if (strpos($sClient, $sRobot) !== false) {
                    $blIsSe = true;
                    break;
                }
            }
        }

        $this->_blIsSe = $blIsSe;

        stopProfile("isSearchEngine");
    }
public function setSearchEngine ( $ blIsSe = null , $ sClient = null ) { if ( isset ( $ blIsSe ) ) { $ this -> _blIsSe = $ blIsSe ; return ; } startProfile ( "isSearchEngine" ) ; $ myConfig = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) ; $ blIsSe = false ; if ( ! ( $ myConfig -> getConfigParam ( 'iDebug' ) && $ this -> isAdmin ( ) ) ) { $ aRobots = $ myConfig -> getConfigParam ( 'aRobots' ) ; $ aRobots = is_array ( $ aRobots ) ? $ aRobots : [ ] ; $ aRobotsExcept = $ myConfig -> getConfigParam ( 'aRobotsExcept' ) ; $ aRobotsExcept = is_array ( $ aRobotsExcept ) ? $ aRobotsExcept : [ ] ; $ sClient = $ sClient ? $ sClient : strtolower ( getenv ( 'HTTP_USER_AGENT' ) ) ; $ blIsSe = false ; $ aRobots = array_merge ( $ aRobots , $ aRobotsExcept ) ; foreach ( $ aRobots as $ sRobot ) { if ( strpos ( $ sClient , $ sRobot ) !== false ) { $ blIsSe = true ; break ; } } } $ this -> _blIsSe = $ blIsSe ; stopProfile ( "isSearchEngine" ) ; }
Sets if current web client is Search Engine.

@param bool   $blIsSe  sets if Search Engine is on
@param string $sClient user browser agent

@return null
Sets if current web client is Search Engine .