1
0
mirror of synced 2024-11-21 20:46:04 +03:00
tiu-client/run.php
2015-09-07 18:09:12 +03:00

22 lines
579 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
require(__DIR__ . "/classes/ApiHelper.php");
require(__DIR__ . "/config/config.php");
if (! file_exists(__DIR__ . "/logs"))
mkdir(__DIR__ . "/logs");
if (file_exists(__DIR__ . "/logs/cookie.txt"))
unlink(__DIR__ . "/logs/cookie.txt");
$lockFile = __DIR__ . "/run.lock";
if (file_exists($lockFile)) {
if ((int)file_get_contents($lockFile) > time()) {
echo "script is busy";
exit();
}
}
file_put_contents("run.lock", strtotime('+5 minutes'));
$apiHelper = new ApiHelper($сonfig);
if ($apiHelper->processXMLOrders())
unlink($lockFile);