scratch
/quickload/includes/functions.php |
@@ -3,7 +3,8 @@ |
########################################################################### |
## Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 ## |
########################################################################### |
function atomized_put_contents($file, $data) { |
function atomized_put_contents($file, $data) |
{ |
$fp = fopen($file, "w+"); |
if (flock($fp, LOCK_EX)) { |
fwrite($fp, $data); |
@@ -15,7 +16,8 @@ |
########################################################################### |
## Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 ## |
########################################################################### |
function atomized_get_contents($file) { |
function atomized_get_contents($file) |
{ |
$fp = fopen($file, "r+"); |
$ct = ''; |
if (flock($fp, LOCK_SH)) { |
@@ -27,21 +29,3 @@ |
fclose($fp); |
return $ct; |
} |
|
########################################################################### |
## Copyright (C) Wizardry and Steamworks 2015 - License: GNU GPLv3 ## |
########################################################################### |
function wasKeyValueGet($key, $data) { |
return array_reduce( |
explode( |
"&", |
$data |
), |
function($o, $p) { |
$x = explode("=", $p); |
return array_shift($x) != $o ? $o : array_shift($x); |
}, |
$key |
); |
} |
|