Ejemplo n.º 1
0
Archivo: P2Util.php Proyecto: poppen/p2
 /**
  * @access  public
  * @return  integer|false
  */
 function getSamba24TimeCache($host, $bbs)
 {
     $cacheTime = 60 * 60 * 24 * 3;
     $sambaFile = P2Util::getSamba24CacheFile($host, $bbs);
     if (file_exists($sambaFile) && filemtime($sambaFile) > time() - $cacheTime) {
         if (false === ($cont = file_get_contents($sambaFile))) {
             return false;
         }
         return (int) $cont;
     }
     if (false !== ($r = P2Util::getSamba24Time($host, $bbs))) {
         file_put_contents($sambaFile, $r, LOCK_EX);
     }
     return $r;
 }