Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1.         $dir = $this->getParameter('session.save_path');
  2.         $files = scandir($dir);
  3.         $minutes = 1;
  4.         $delay = time() - $minutes * 60;
  5.         $online = 0;
  6.         foreach ($files as $file) {
  7.             if ($file != '.' and $file != '..' and filesize($dir.'/'.$file) != 0) {
  8.                 $updateStamp = filemtime($dir.'/'.$file);
  9.                 if ($updateStamp > $delay) {
  10.                     $online++;
  11.                     //echo date("H:i:s d.m.y", $updateStamp)."<br>";
  12.                 }
  13.             }
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement