private function shouldPurgeData($settings, $lastRanOption, $setting)
    {
        // Log deletion may not run until it is once rescheduled (initial run). This is the
        // only way to guarantee the calculated next scheduled deletion time.
        $initialDelete = Option::get(self::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL);
        if (empty($initialDelete)) {
            Option::set(self::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL, 1);
            return false;
        }

        // Make sure, log purging is allowed to run now
        $lastDelete = Option::get($lastRanOption);
        $deleteIntervalDays = $settings[$setting];
        $deleteIntervalSeconds = $this->getDeleteIntervalInSeconds($deleteIntervalDays);

        if ($lastDelete === false ||
            $lastDelete === '' ||
            ((int)$lastDelete + $deleteIntervalSeconds) <= time()
        ) {
            return true;
        } else // not time to run data purge
        {
            return false;
        }
    }
private function shouldPurgeData($settings, $lastRanOption, $setting)
    {
        // Log deletion may not run until it is once rescheduled (initial run). This is the
        // only way to guarantee the calculated next scheduled deletion time.
        $initialDelete = Option::get(self::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL);
        if (empty($initialDelete)) {
            Option::set(self::OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL, 1);
            return false;
        }

        // Make sure, log purging is allowed to run now
        $lastDelete = Option::get($lastRanOption);
        $deleteIntervalDays = $settings[$setting];
        $deleteIntervalSeconds = $this->getDeleteIntervalInSeconds($deleteIntervalDays);

        if ($lastDelete === false ||
            $lastDelete === '' ||
            ((int)$lastDelete + $deleteIntervalSeconds) <= time()
        ) {
            return true;
        } else // not time to run data purge
        {
            return false;
        }
    }
private function shouldPurgeData ( $ settings , $ lastRanOption , $ setting ) { // Log deletion may not run until it is once rescheduled (initial run). This is the // only way to guarantee the calculated next scheduled deletion time. $ initialDelete = Option :: get ( self :: OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL ) ; if ( empty ( $ initialDelete ) ) { Option :: set ( self :: OPTION_LAST_DELETE_PIWIK_LOGS_INITIAL , 1 ) ; return false ; } // Make sure, log purging is allowed to run now $ lastDelete = Option :: get ( $ lastRanOption ) ; $ deleteIntervalDays = $ settings [ $ setting ] ; $ deleteIntervalSeconds = $ this -> getDeleteIntervalInSeconds ( $ deleteIntervalDays ) ; if ( $ lastDelete === false || $ lastDelete === '' || ( ( int ) $ lastDelete + $ deleteIntervalSeconds ) <= time ( ) ) { return true ; } else // not time to run data purge { return false ; } }
Returns true if one of the purge data tasks should run now, false if it shouldn't.
Returns true if one of the purge data tasks should run now false if it shouldn t .