private function getLastMod($dirPath)
  {
    $dirInfo = new \SplFileInfo($dirPath);
    $lastMod = $dirInfo->getMTime();

    // Check files and subdirectories
    $iter = new \FilesystemIterator($dirPath);
    foreach ($iter as $fileInfo) {

      if ($fileInfo->isDir()) {
        $mtime = self::getLastMod($fileInfo->getPathname());
      }
      else {
        $mtime = $fileInfo->getMTime();
      }

      if ($mtime > $lastMod) {
        $lastMod = $mtime;
      }
    }

    return $lastMod;
  }
private function getLastMod($dirPath)
  {
    $dirInfo = new \SplFileInfo($dirPath);
    $lastMod = $dirInfo->getMTime();

    // Check files and subdirectories
    $iter = new \FilesystemIterator($dirPath);
    foreach ($iter as $fileInfo) {

      if ($fileInfo->isDir()) {
        $mtime = self::getLastMod($fileInfo->getPathname());
      }
      else {
        $mtime = $fileInfo->getMTime();
      }

      if ($mtime > $lastMod) {
        $lastMod = $mtime;
      }
    }

    return $lastMod;
  }
private function getLastMod ( $ dirPath ) { $ dirInfo = new \ SplFileInfo ( $ dirPath ) ; $ lastMod = $ dirInfo -> getMTime ( ) ; // Check files and subdirectories $ iter = new \ FilesystemIterator ( $ dirPath ) ; foreach ( $ iter as $ fileInfo ) { if ( $ fileInfo -> isDir ( ) ) { $ mtime = self :: getLastMod ( $ fileInfo -> getPathname ( ) ) ; } else { $ mtime = $ fileInfo -> getMTime ( ) ; } if ( $ mtime > $ lastMod ) { $ lastMod = $ mtime ; } } return $ lastMod ; }
Returns the last modification time for all files and directories inside
the given directory.

@param $dirPath (String)
@param $cacheTime (String)
@return (int) The unix timestamp for the last modification
Returns the last modification time for all files and directories inside the given directory .