summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2020-07-27 17:26:11 +0200
committerUrban Müller2020-07-27 17:26:11 +0200
commit7f6de9bae1fbbbb452040ee26d364ff0b23645f2 (patch)
treee094d1f18820ec15181e460fd7d35669a67f1d05
parent5718a4598d4af2262aa06b709c32c46e32ca4113 (diff)
downloaditools-7f6de9bae1fbbbb452040ee26d364ff0b23645f2.tar.gz
itools-7f6de9bae1fbbbb452040ee26d364ff0b23645f2.tar.bz2
itools-7f6de9bae1fbbbb452040ee26d364ff0b23645f2.zip
make arg optional
-rw-r--r--it_url.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/it_url.class b/it_url.class
index f9cafc7..f48c7f9 100644
--- a/it_url.class
+++ b/it_url.class
@@ -681,7 +681,7 @@ static function _expired($path, $maxage)
* @param $path File to lock
* @return Lock handle if successfully locked file
*/
-static function _lock($path, $p)
+static function _lock($path, $p = [])
{
$force = EDC('nocache') || (($mtime = @filemtime("$path.lock")) && (time() - $mtime > 30)); # expire forgotten locks
return ($p['lock'] ?? true) ? @it::fopen("$path.lock", $force ? "w" : "x") : true;
@@ -692,7 +692,7 @@ static function _lock($path, $p)
* @param $path File to unlock
* @param $lock Handle to lock acquird by _lock
*/
-static function _unlock($path, $lock, $p)
+static function _unlock($path, $lock, $p = [])
{
if ($p['lock'] ?? true)
{