diff --git a/.gitignore b/.gitignore index 492fe9e..fe5fff8 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ public/photos/big/*.jpg public/photos/big/*.jpeg public/photos/big/*.png public/photos/big/*.gif + +logs/*.log \ No newline at end of file diff --git a/ground/app.php b/ground/app.php index 8bbddf3..9fa910d 100644 --- a/ground/app.php +++ b/ground/app.php @@ -205,4 +205,17 @@ class App ); } + public static function log($logName, $value) + { + $fileName = App::getBasedir() . + 'logs/' . + $logName . '.log'; + + return file_put_contents( + $fileName, date('d-m-Y H:i:s') . " - " . + print_r($value, true) . + "\n-------------------\n", FILE_APPEND + ); + } + } diff --git a/ground/controllers/JsonController.php b/ground/controllers/JsonController.php index 1238e2e..18730b0 100644 --- a/ground/controllers/JsonController.php +++ b/ground/controllers/JsonController.php @@ -351,7 +351,7 @@ class JsonController extends Controller curl_setopt($ch, CURLOPT_TIMEOUT, 3); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $out = null; - $out = curl_exec($ch); // выполняем запрос curl - обращаемся к сервера php.su + $out = curl_exec($ch); if (!empty($out)) { $obj = simplexml_load_string($out); diff --git a/logs/.gitKeep b/logs/.gitKeep new file mode 100644 index 0000000..e69de29