Add NAMESPACE support (not activated, but just needed to add the namespace on top of file)
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4630 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
10
lockfile.php
10
lockfile.php
@@ -18,7 +18,7 @@ class lockfile
|
||||
if (!is_dir (dirname ($this->storagelock)))
|
||||
@mkdir (dirname ($this->storagelock));
|
||||
if (!is_dir (dirname ($this->storagelock)))
|
||||
throw new Exception ("Can't create '".dirname ($this->storagelock).
|
||||
throw new \Exception ("Can't create '".dirname ($this->storagelock).
|
||||
"' directory for lockfile",
|
||||
500);
|
||||
$lockid = uniqid() . '_' . md5 (mt_rand());
|
||||
@@ -39,7 +39,7 @@ class lockfile
|
||||
usleep (100000);
|
||||
clearstatcache (TRUE, $this->storagelock);
|
||||
if (microtime (TRUE) > $startTime + 10)
|
||||
throw new Exception ("Can't have the authorization lock RW in 10s",
|
||||
throw new \Exception ("Can't have the authorization lock RW in 10s",
|
||||
500);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class lockfile
|
||||
{
|
||||
usleep (100000);
|
||||
if (microtime (TRUE) > $startTime + 10)
|
||||
throw new Exception ("Can't have the authorization lock RO in 10s",
|
||||
throw new \Exception ("Can't have the authorization lock RO in 10s",
|
||||
500);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class lockfile
|
||||
if (!is_dir (dirname ($this->storagelock)))
|
||||
@mkdir (dirname ($this->storagelock));
|
||||
if (!is_dir (dirname ($this->storagelock)))
|
||||
throw new Exception ("Can't create '".dirname ($this->storagelock)."'",
|
||||
throw new \Exception ("Can't create '".dirname ($this->storagelock)."'",
|
||||
500);
|
||||
$lockid = uniqid() . '_' . md5 (mt_rand());
|
||||
// Stale lock : 60s old min
|
||||
@@ -89,7 +89,7 @@ class lockfile
|
||||
usleep (100000);
|
||||
clearstatcache (TRUE, $this->storagelock);
|
||||
if (microtime (TRUE) > $startTime + 10)
|
||||
throw new Exception ("Can't have the authorization lock in 10s", 500);
|
||||
throw new \Exception ("Can't have the authorization lock in 10s", 500);
|
||||
}
|
||||
|
||||
touch ($this->storagelock."-".$lockid);
|
||||
|
||||
Reference in New Issue
Block a user