/**
     * Notify about the fault
     *
     * @param string $email address to be notified about the fault
     * @param Exception $e uncaught exception that caused application fault
     * @return void
     */
    protected function notify500($email, Exception $e)
    {
        //
        // TODO log this
        //
        $message = <<<EOT
Crash at {$this->request->getHttpUrl()->getHost()}:
{$e->getMessage()}

The request: {$this->request->getHttpUrl()}
Request method: {$this->request->getRequestMethod()}

{$e->getTraceAsString()}
EOT;
        mail($email, PHOEBIUS_SHORT_PRODUCT_NAME . "crash at {$this->request->getHttpUrl()->getHost()} (" . get_class($e) . ")", $message);
    }
 /**
  * Signs the form. This method may be overridden to import fields to be signed, just call Form::setHiddenValue()
  * @return Form
  */
 function sign(WebRequest $request)
 {
     Assert::isFalse($this->isSigned(), 'form already signed');
     $this->privateValues['referrer'] = (string) $request->getHttpUrl();
     $this->addControl(FormControl::hidden($this->getSignatureFieldName(), $this->exportSignature()));
     $this->signed = true;
     return $this;
 }
Exemple #3
0
 function match(WebRequest $request)
 {
     if ($this->method) {
         if ($this->method->getValue() != $request->getRequestMethod()) {
             return;
         }
     }
     $url = $request->getHttpUrl();
     $data = $this->routeData;
     if ($this->pathMatcher) {
         $pathData = $this->pathMatcher->match($url->getVirtualPath());
         if (!is_array($pathData)) {
             return;
         }
         $data = array_merge($data, $pathData);
     }
     $query = $url->getQuery();
     foreach ($this->queryStringRegs as $qsArg => $qsReg) {
         if (isset($query[$qsArg]) && preg_match($qsReg, $query[$qsArg])) {
             $data[$qsArg] = $query[$qsArg];
         } else {
             return;
         }
     }
     return $data;
 }
 function __construct(RouteData $routeData, WebRequest $webRequest)
 {
     parent::__construct('Cannot dispatch ' . $webRequest->getHttpUrl()->getVirtualPath() . ' using route data: ' . print_r($routeData, true));
 }