Commit 0573c268 authored by Evan Prodromou's avatar Evan Prodromou

Merge branch '1.0.x' into testing

parents 9f6adb3f dcbf2f68
......@@ -71,18 +71,25 @@ function mail_backend()
*/
function mail_send($recipients, $headers, $body)
{
try {
// XXX: use Mail_Queue... maybe
$backend = mail_backend();
if (!isset($headers['Content-Type'])) {
$headers['Content-Type'] = 'text/plain; charset=UTF-8';
}
assert($backend); // throws an error if it's bad
$sent = $backend->send($recipients, $headers, $body);
if (PEAR::isError($sent)) {
common_log(LOG_ERR, 'Email error: ' . $sent->getMessage());
return true;
} catch (PEAR_Exception $e) {
common_log(
LOG_ERR,
"Unable to send email - '{$e->getMessage()}'. "
. 'Is your mail subsystem set up correctly?'
);
return false;
}
return true;
}
/**
......
......@@ -58,6 +58,7 @@ class URLMapper
protected $statics = array();
protected $variables = array();
protected $reverse = array();
protected $allpaths = array();
function connect($path, $args, $paramPatterns=array())
{
......@@ -65,6 +66,8 @@ class URLMapper
throw new Exception(sprintf("Can't connect %s; path has no action.", $path));
}
$allpaths[] = $path;
$action = $args[self::ACTION];
$paramNames = $this->getParamNames($path);
......@@ -223,6 +226,11 @@ class URLMapper
return $format;
}
public function getPaths()
{
return $this->allpaths;
}
}
class PatternReplacer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment