diff --git a/src/Pluf/HTTP/Response/NotAvailable.php b/src/Pluf/HTTP/Response/NotAvailable.php new file mode 100644 index 0000000..c0a479f --- /dev/null +++ b/src/Pluf/HTTP/Response/NotAvailable.php @@ -0,0 +1,44 @@ + $request->query)); + $tmpl = new Pluf_Template('503.html'); + $content = $tmpl->render($context); + $mimetype = null; + } catch (Exception $e) { + $mimetype = 'text/plain'; + $content = sprintf('The requested URL %s is not available at the moment.'."\n" + .'Please try again later.'."\n\n".'503 - Service Unavailable', + Pluf_esc($request->query)); + } + parent::__construct($content, $mimetype); + $this->status_code = 503; + $this->headers['Retry-After'] = 300; // retry after 5 minutes + } +}