src/Resources/contao/classes/Referrer/ProviderCommunication.php
public function loadProviderFiles()
    {
        //debug $this->logMessage('ProviderCommunication::loadProviderFile: START','botdetection_debug');
        $lastWeek = time() - (7 * 24 * 60 * 60);

        if (false === $this->allowUrlOpen) 
        {
            $this->logMessage('ProviderCommunication::loadProviderFiles allowUrlOpen = false!', 'botdetection_debug');

            return false;
        }

        foreach($this->referrerProvider as $source => $url) 
        {
            if (false === file_exists($this->cachePath .'/'. strtolower($source) . '.txt') || 
                 $lastWeek > filemtime($this->cachePath .'/'. strtolower($source) . '.txt') 
               )
            {
                //debug $this->logMessage('ProviderCommunication::loadProviderFile: '.$source,'botdetection_debug');
                $fileProvider = fopen($this->cachePath .'/'. strtolower($source) . '.txt', 'wb+');
                fwrite($fileProvider, file_get_contents($url));
                fclose($fileProvider);
            }
        }
        //debug $this->logMessage('ProviderCommunication::loadProviderFile: END','botdetection_debug');
        return true;
    }
public function loadProviderFiles()
    {
        //debug $this->logMessage('ProviderCommunication::loadProviderFile: START','botdetection_debug');
        $lastWeek = time() - (7 * 24 * 60 * 60);

        if (false === $this->allowUrlOpen) 
        {
            $this->logMessage('ProviderCommunication::loadProviderFiles allowUrlOpen = false!', 'botdetection_debug');

            return false;
        }

        foreach($this->referrerProvider as $source => $url) 
        {
            if (false === file_exists($this->cachePath .'/'. strtolower($source) . '.txt') || 
                 $lastWeek > filemtime($this->cachePath .'/'. strtolower($source) . '.txt') 
               )
            {
                //debug $this->logMessage('ProviderCommunication::loadProviderFile: '.$source,'botdetection_debug');
                $fileProvider = fopen($this->cachePath .'/'. strtolower($source) . '.txt', 'wb+');
                fwrite($fileProvider, file_get_contents($url));
                fclose($fileProvider);
            }
        }
        //debug $this->logMessage('ProviderCommunication::loadProviderFile: END','botdetection_debug');
        return true;
    }
public function loadProviderFiles ( ) { //debug $this->logMessage('ProviderCommunication::loadProviderFile: START','botdetection_debug'); $ lastWeek = time ( ) - ( 7 * 24 * 60 * 60 ) ; if ( false === $ this -> allowUrlOpen ) { $ this -> logMessage ( 'ProviderCommunication::loadProviderFiles allowUrlOpen = false!' , 'botdetection_debug' ) ; return false ; } foreach ( $ this -> referrerProvider as $ source => $ url ) { if ( false === file_exists ( $ this -> cachePath . '/' . strtolower ( $ source ) . '.txt' ) || $ lastWeek > filemtime ( $ this -> cachePath . '/' . strtolower ( $ source ) . '.txt' ) ) { //debug $this->logMessage('ProviderCommunication::loadProviderFile: '.$source,'botdetection_debug'); $ fileProvider = fopen ( $ this -> cachePath . '/' . strtolower ( $ source ) . '.txt' , 'wb+' ) ; fwrite ( $ fileProvider , file_get_contents ( $ url ) ) ; fclose ( $ fileProvider ) ; } } //debug $this->logMessage('ProviderCommunication::loadProviderFile: END','botdetection_debug'); return true ; }
Load Referrer Provider Files if
- provider files to old
Load Referrer Provider Files if - provider files to old