Exemplo n.º 1
0
 /**
  * Checks if file locked
  * 
  * @param string $process_name file name
  * @return boolean 
  */
 public static function isLocked($process_name = 'process_message')
 {
     $pidfile = ProcessPid::getDir() . DIRECTORY_SEPARATOR . $process_name . '.lock';
     $running_pid = 0;
     if (file_exists($pidfile)) {
         $size = @filesize($pidfile);
         $running_pid = @file_get_contents($pidfile);
         if ($size > 0 && $running_pid == false) {
             return true;
         }
     }
     return false;
 }