1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-12-11 17:00:00 +01:00
MadelineProto/tests/lock_setup.php

18 lines
288 B
PHP
Raw Normal View History

2023-11-30 19:49:22 +01:00
<?php declare(strict_types=1);
2023-11-30 19:30:29 +01:00
2023-11-30 19:35:35 +01:00
$lock = fopen('woodpecker.lock', 'c+');
2023-11-30 19:30:29 +01:00
flock($lock, LOCK_EX);
if (fread($lock, 1) !== "1") {
exec("tests/setup.sh", $o, $res);
fwrite($lock, "1");
} else {
$o = [];
$res = 0;
}
flock($lock, LOCK_UN);
echo implode("\n", $o);
2023-11-30 19:49:22 +01:00
exit($res);