diff xml/getAmazonInfo.php @ 15:385ddd7c4b55 testing

use test_db.php to get mysqld_test instance
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Sun, 19 Feb 2017 16:17:53 +0000
parents c9ebf871114b
children
line wrap: on
line diff
--- a/xml/getAmazonInfo.php	Sun Feb 19 16:17:25 2017 +0000
+++ b/xml/getAmazonInfo.php	Sun Feb 19 16:17:53 2017 +0000
@@ -115,16 +115,16 @@
 	  $xml = new SimpleXMLElement($output);	
 	  $resName=$xml->getName();
 	  $code=$xml->Error->Code;
-	  file_put_contents('/var/ywww/debug/phpDebug',"Losing: $resName, $code\n",FILE_APPEND);
+	  file_put_contents('/var/test/ywww/debug/testDebug',"Losing: $resName, $code\n",FILE_APPEND);
 	  if ($code=='RequestThrottled') {
 	    usleep(200000); // Try to reduce throttling until we get a 
 	    // principled solution in place
 	  }
 	  else {
-	     file_put_contents('/var/ywww/debug/phpDebug',"parms: $go\n".
+	     file_put_contents('/var/test/ywww/debug/testDebug',"parms: $go\n".
 		   print_r($parameters,TRUE)."\n",FILE_APPEND);
 	     if ($code=="") {
-	       file_put_contents('/var/ywww/debug/phpDebug',"error elt:\n$output\n",FILE_APPEND);
+	       file_put_contents('/var/test/ywww/debug/testDebug',"error elt:\n$output\n",FILE_APPEND);
 	     }
 	  }
 	}
@@ -132,17 +132,17 @@
 	  $xml = new SimpleXMLElement($output);	
 	  set_error_handler(function () {
 	      global $output;
-	      file_put_contents('/var/ywww/debug/phpDebug',
+	      file_put_contents('/var/test/ywww/debug/testDebug',
 				"Caught one?: ".$searchparameterdata,
 				FILE_APPEND);
-	      file_put_contents('/var/ywww/debug/phpDebug',
+	      file_put_contents('/var/test/ywww/debug/testDebug',
 				print_r($output, TRUE)."\n",
 				FILE_APPEND);
 	    } );
 	  $review = $xml->Items->Item->CustomerReviews->IFrameURL;
 	  // The above is failing repeatedly -- 
 	  //PHP Notice: Trying to get property of non-object in
-	  // /var/ywww/xml/getAmazonInfo.php on line [109]
+	  // /var/test/ywww/xml/getAmazonInfo.php on line [109]
 	  // See the dumped structure at the end of this file for the
 	  // cause
 	  restore_error_handler();
@@ -262,7 +262,7 @@
 	if($errorCode != "AccountLimitExceeded")
 	{
 	  if($go == 1) {
-	    file_put_contents('/var/ywww/debug/phpDebug',"win: ".
+	    file_put_contents('/var/test/ywww/debug/testDebug',"win: ".
 			    $xml->Items->Item->ItemAttributes->Title."\n",
 			      FILE_APPEND);
 			return $output;
@@ -308,7 +308,7 @@
 				//echo "$key => $value";
 				$queryG = "CALL b_addBrowseNode($key,\"$value\")";	//add the name value pair for genre to new table	
 				//echo $queryG;
-				include "../../private/db.php";
+				include "../../../private/db_test.php";
 				$resG = mysqli_query($link, $queryG);
 				mysqli_close($link);
 				
@@ -331,7 +331,7 @@
 				$salesRank = "null";
 			
 			$title = strtr($title, '"', "'");
-			include "../../private/db.php";
+			include "../../../private/db_test.php";
 			$review1 = mysqli_real_escape_string($link,$review1);
 			$review2 = mysqli_real_escape_string($link,$review2);
 			$review3 = mysqli_real_escape_string($link,$review3);
@@ -355,7 +355,7 @@
 	else
 	{
 		//look up info from db	
-		include "../../private/db.php"; 
+		include "../../../private/db_test.php"; 
 		$query = "CALL b_getBookInfo('$searchparameterdata', $loc)";
 		//echo $query;
 		$res = mysqli_query($link, $query) or exit( mysqli_error( $link ));