*/
class Pman_Core_Mailer {
- var $debug = 2;
+ var $debug = 0;
var $page = false; /* usually a html_flexyframework_page */
var $contents = false; /* object or array */
var $template = false; /* string */
if (!empty($ff->Core_Mailer['debug'])) {
$this->debug = $ff->Core_Mailer['debug'];
}
-
+ $this->log("URL MAP");
+ $this->log($this->urlmap);
}
return $email;
}
- $this->log( htmlspecialchars(print_r($email,true)));
+ //$this->log( htmlspecialchars(print_r($email,true)));
///$recipents = array($this->email);
$mailOptions = PEAR::getStaticProperty('Mail','options');
$this->log( "FETCH : $url\n");
- }
+
if ($url[0] == '/') {
$ff = HTML_FlexyFramework::get();
$file = $ff->rootDir . $url;
$a = new HTTP_Request($this->mapurl($url));
$a->sendRequest();
$data = $a->getResponseBody();
- $this->log("got file of size " . strlen($data);)
+
+ $this->log("got file of size " . strlen($data));
+ $this->log("save contentid " . md5($url));
+
file_put_contents($cache .'.data', $data);
return $ret;
}
}
+ $this->log("mapurl no change - $in");
return $in;
function log($val)
{
- if (!$debug < 1) {
+ if (!$this->debug) {
return;
}
- if ($debug < 2) {
+ if ($this->debug < 2) {
echo '<PRE>' . $val. "\n";
+ return;
}
$fh = fopen('/tmp/core_mailer.log', 'a');
fwrite($fh, date('Y-m-d H:i:s -') . json_encode($val) . "\n");