time()) { echo "script is busy"; exit(); } } file_put_contents($lockFile, strtotime('+5 minutes')); if (file_exists(__DIR__ . "/logs/sync.log")) { $config['date_from'] = file_get_contents(__DIR__ . "/logs/sync.log"); } $apiHelper = new ApiHelper($сonfig); if ($apiHelper->processXMLOrders()) { unlink($lockFile); file_put_contents(__DIR__ . "/logs/sync.log", $startTime); }