Zwiększenie poziomu raportowania błędów w product.php oraz poprawa formatowania kodu w cron.php
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
error_reporting( E_ALL ^ E_NOTICE ^ E_STRICT ^ E_WARNING ^ E_DEPRECATED );
|
||||
$ROOT_DIR = $_SERVER['DOCUMENT_ROOT'];
|
||||
|
||||
require_once $ROOT_DIR . '/config.php';
|
||||
|
||||
12
cron.php
12
cron.php
@@ -83,7 +83,8 @@ function parseOrlenAddress( $input )
|
||||
}
|
||||
}
|
||||
|
||||
function getImageUrlById($id) {
|
||||
function getImageUrlById ($id )
|
||||
{
|
||||
$apiUrl = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['SERVER_NAME'] . '/api/v1/product.php';
|
||||
|
||||
$ch = curl_init();
|
||||
@@ -91,13 +92,14 @@ function getImageUrlById($id) {
|
||||
curl_setopt($ch, CURLOPT_URL, $apiUrl . '?id=' . urlencode($id));
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
||||
'Content-Type: application/json',
|
||||
'Content-Type: application/json',
|
||||
));
|
||||
|
||||
$response = curl_exec($ch);
|
||||
if ($response === false) {
|
||||
curl_close($ch);
|
||||
return null;
|
||||
if ( $response === false )
|
||||
{
|
||||
curl_close($ch);
|
||||
return null;
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
Reference in New Issue
Block a user