Browse Source

Fix log testcurl

Mathieu Moulin 3 years ago
parent
commit
5b332dc06c
2 changed files with 6 additions and 2 deletions
  1. 5 1
      web/testcurl.php
  2. 1 1
      web/testcurl_dest.php

+ 5 - 1
web/testcurl.php

@@ -1,9 +1,12 @@
 <?php
 
-$url = 'https://calicote-sync.dev.iprospective.fr/test.php';
+require_once '../config/config.inc.php';
+
+$url = SYNC_URL.'testcurl_dest.php';
 $SYNC_AGENT = 'Dolibarr API Test';
 $timeout = '30';
 $post = $_POST;
+echo '<p>'.$url.'</p>';
 
 $ch = curl_init($url); // initialize curl with given url
 //curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]); // set  useragent
@@ -18,3 +21,4 @@ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
 $raw_data = curl_exec($ch);
 echo $raw_data; //die();
 
+echo '<p>END</p>';

+ 1 - 1
web/testcurl_dest.php

@@ -4,7 +4,7 @@ $id = uniqid();
 
 for($i=0;$i<=60;$i++) {
 	$str = date('Y-m-d H:i:s').' - '.$id.' - '.$i;
-	file_put_contents('test_curl_timeout.txt', $str."\r\n", FILE_APPEND);
+	file_put_contents('../var/log/test_curl_timeout.txt', $str."\r\n", FILE_APPEND);
 	echo '<p>'.$str.'</p>';
 	sleep(1);
 }