src/CSS/UpdateListener.php
protected function isOutOfDate($source, $destination, array $includes = null)
    {
        $includes = (array) $includes;
        $extensions = $this->compiler->getExtensions();
        
        if (!file_exists($destination)) {
            return true;
        }
        
        if (is_file($source) && is_file($destination)) {
            $sourceFiles = array(new \SplFileInfo($source));
            $destinationFiles = array(new \SplFileInfo($destination));
        } else {
            $sourceFiles = $this->scanDirectory($source, $extensions);
            $destinationFiles = $this->scanDirectory($destination, array('css'));
        }
        
        $youngest = time();
        foreach ($sourceFiles as $key => $file) {
            if (array_key_exists($key, $destinationFiles)) {
                if ($file->getMTime() > $destinationFiles[$key]->getMTime()) {
                    return true;
                }
                if ($file->getMTime() < $youngest) {
                    $youngest = $file->getMTime();
                }
            } else {
                return true;
            }
        }
        
//         $oldest = time();
//         foreach ($destinationFiles as $file) {
//             $modified = $file->getMTime(); 
//             if ($modified < $oldest) {
//                 $oldest = $modified;
//             }
//         }
        
        foreach ($includes as $include) {
            $includeFiles = $this->scanDirectory($include, $extensions);
            foreach ($includeFiles as $file) {
                if ($file->getMTime() > $youngest) {
                    return true;
                }
            }
        }
        
        return false;
    }
protected function isOutOfDate($source, $destination, array $includes = null)
    {
        $includes = (array) $includes;
        $extensions = $this->compiler->getExtensions();
        
        if (!file_exists($destination)) {
            return true;
        }
        
        if (is_file($source) && is_file($destination)) {
            $sourceFiles = array(new \SplFileInfo($source));
            $destinationFiles = array(new \SplFileInfo($destination));
        } else {
            $sourceFiles = $this->scanDirectory($source, $extensions);
            $destinationFiles = $this->scanDirectory($destination, array('css'));
        }
        
        $youngest = time();
        foreach ($sourceFiles as $key => $file) {
            if (array_key_exists($key, $destinationFiles)) {
                if ($file->getMTime() > $destinationFiles[$key]->getMTime()) {
                    return true;
                }
                if ($file->getMTime() < $youngest) {
                    $youngest = $file->getMTime();
                }
            } else {
                return true;
            }
        }
        
//         $oldest = time();
//         foreach ($destinationFiles as $file) {
//             $modified = $file->getMTime(); 
//             if ($modified < $oldest) {
//                 $oldest = $modified;
//             }
//         }
        
        foreach ($includes as $include) {
            $includeFiles = $this->scanDirectory($include, $extensions);
            foreach ($includeFiles as $file) {
                if ($file->getMTime() > $youngest) {
                    return true;
                }
            }
        }
        
        return false;
    }
protected function isOutOfDate ( $ source , $ destination , array $ includes = null ) { $ includes = ( array ) $ includes ; $ extensions = $ this -> compiler -> getExtensions ( ) ; if ( ! file_exists ( $ destination ) ) { return true ; } if ( is_file ( $ source ) && is_file ( $ destination ) ) { $ sourceFiles = array ( new \ SplFileInfo ( $ source ) ) ; $ destinationFiles = array ( new \ SplFileInfo ( $ destination ) ) ; } else { $ sourceFiles = $ this -> scanDirectory ( $ source , $ extensions ) ; $ destinationFiles = $ this -> scanDirectory ( $ destination , array ( 'css' ) ) ; } $ youngest = time ( ) ; foreach ( $ sourceFiles as $ key => $ file ) { if ( array_key_exists ( $ key , $ destinationFiles ) ) { if ( $ file -> getMTime ( ) > $ destinationFiles [ $ key ] -> getMTime ( ) ) { return true ; } if ( $ file -> getMTime ( ) < $ youngest ) { $ youngest = $ file -> getMTime ( ) ; } } else { return true ; } } //         $oldest = time(); //         foreach ($destinationFiles as $file) { //             $modified = $file->getMTime();  //             if ($modified < $oldest) { //                 $oldest = $modified; //             } //         } foreach ( $ includes as $ include ) { $ includeFiles = $ this -> scanDirectory ( $ include , $ extensions ) ; foreach ( $ includeFiles as $ file ) { if ( $ file -> getMTime ( ) > $ youngest ) { return true ; } } } return false ; }
Test is destination file or folder is out of date from the source.

@param string $source
@param string $destination
@return boolean
Test is destination file or folder is out of date from the source .