src/rss/Crss.php
private function checkValidity()
    {

        if (!is_writable($this->rssFile)) {
            $this->valid = false;
            return;
        }

        $stmt = $this->db->prepare('SELECT CREATED FROM ' . $this->table . ' ORDER BY CREATED DESC LIMIT 1');
        $stmt->execute();
        $res = $stmt->fetchAll();

        if (count($res) == 0) {
            $this->valid = false;
            return;
        }

        $latestInput = strtotime($res[0]->CREATED);

        $rssCreated = filemtime($this->rssFile);

        if ($latestInput > $rssCreated) {
            $this->valid = false;
        } else {
            $this->valid = true;
        }
    }
private function checkValidity()
    {

        if (!is_writable($this->rssFile)) {
            $this->valid = false;
            return;
        }

        $stmt = $this->db->prepare('SELECT CREATED FROM ' . $this->table . ' ORDER BY CREATED DESC LIMIT 1');
        $stmt->execute();
        $res = $stmt->fetchAll();

        if (count($res) == 0) {
            $this->valid = false;
            return;
        }

        $latestInput = strtotime($res[0]->CREATED);

        $rssCreated = filemtime($this->rssFile);

        if ($latestInput > $rssCreated) {
            $this->valid = false;
        } else {
            $this->valid = true;
        }
    }
private function checkValidity ( ) { if ( ! is_writable ( $ this -> rssFile ) ) { $ this -> valid = false ; return ; } $ stmt = $ this -> db -> prepare ( 'SELECT CREATED FROM ' . $ this -> table . ' ORDER BY CREATED DESC LIMIT 1' ) ; $ stmt -> execute ( ) ; $ res = $ stmt -> fetchAll ( ) ; if ( count ( $ res ) == 0 ) { $ this -> valid = false ; return ; } $ latestInput = strtotime ( $ res [ 0 ] -> CREATED ) ; $ rssCreated = filemtime ( $ this -> rssFile ) ; if ( $ latestInput > $ rssCreated ) { $ this -> valid = false ; } else { $ this -> valid = true ; } }
Compares RSS file created timestamp and database timestamp to judge if new RSS file is needed

Sets internal variable $this->valid to true/false depending if new file needs to be generate
@return void
Compares RSS file created timestamp and database timestamp to judge if new RSS file is needed