diff options
author | Urban Müller | 2020-07-27 17:26:11 +0200 |
---|---|---|
committer | Urban Müller | 2020-07-27 17:26:11 +0200 |
commit | 7f6de9bae1fbbbb452040ee26d364ff0b23645f2 (patch) | |
tree | e094d1f18820ec15181e460fd7d35669a67f1d05 /it_url.class | |
parent | 5718a4598d4af2262aa06b709c32c46e32ca4113 (diff) | |
download | itools-7f6de9bae1fbbbb452040ee26d364ff0b23645f2.tar.gz itools-7f6de9bae1fbbbb452040ee26d364ff0b23645f2.tar.bz2 itools-7f6de9bae1fbbbb452040ee26d364ff0b23645f2.zip |
make arg optional
Diffstat (limited to 'it_url.class')
-rw-r--r-- | it_url.class | 4 |
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) { |