Bob\FileTask::isNeeded PHP Метод

isNeeded() публичный Метод

# Returns TRUE if the task must be run, or FALSE otherwise.
public isNeeded ( )
    function isNeeded()
    {
        return !file_exists($this->name) or $this->getTimestamp() > @filemtime($this->name);
    }

Usage Example

Пример #1
0
 function testIsNotNeededWhenTargetNewerThanPrerequisites()
 {
     $t = new FileTask($this->getFixturesDir() . '/out.txt', new Application());
     $t->enhance(array($this->getFixturesDir() . '/in1.txt', $this->getFixturesDir() . '/in2.txt'));
     touch($this->getFixturesDir() . '/in1.txt', strtotime('-1 minute'));
     touch($this->getFixturesDir() . '/in2.txt', strtotime('-1 minute'));
     touch($this->getFixturesDir() . '/out.txt');
     $this->assertFalse($t->isNeeded());
 }