view dlog.php @ 53:dd93cb4b77ad

more debugging (too much for production), fallback to DB if getBookDetails is knocked back by Amazon
author Charlie Root
date Thu, 06 Jun 2019 16:37:20 -0400
parents dbc006408d2b
children 7f90ac957713
line wrap: on
line source

<?php
if (isset($_SERVER['DOCUMENT_ROOT'])) {
  $logfile=$_SERVER['DOCUMENT_ROOT']."/debug/debug.log";
}
 else {
   $logfile="/tmp/php_debug.log";
 }

function dl($s) {
  global $logfile;
  file_put_contents($logfile,$s,FILE_APPEND);
}