14use UnexpectedValueException;
 
   36        if ($request->
getMethod() === 
'OPTIONS') {
 
   44                case 'application/json':
 
   49                case 'application/xml':
 
   57                    throw new UnexpectedValueException(
'Cannot render unknown content type ' . 
$contentType);
 
   61        $body = 
new Body(fopen(
'php://temp', 
'r+'));
 
   63        $allow = implode(
', ', $methods);
 
   68                ->withHeader(
'Allow', $allow)
 
   80        $allow = implode(
', ', $methods);
 
   82        return 'Allowed methods: ' . $allow;
 
   93        $allow = implode(
', ', $methods);
 
   95        return '{"message":"Method not allowed. Must be one of: ' . $allow . 
'"}';
 
  106        $allow = implode(
', ', $methods);
 
  108        return "<root><message>Method not allowed. Must be one of: $allow</message></root>";
 
  119        $allow = implode(
', ', $methods);
 
  123        <title>
Method not allowed</title>
 
  128                font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;
 
  139        <h1>
Method not allowed</h1>
 
  140        <p>
Method not allowed. Must be one of: <strong>$allow</strong></p>
 
An exception for terminatinating execution or to throw for unit testing.
Abstract Slim application handler.
determineContentType(ServerRequestInterface $request)
Determine which content type we know about is wanted using Accept header.
Default Slim application not allowed handler.
renderXmlNotAllowedMessage($methods)
Render XML not allowed message.
renderHtmlNotAllowedMessage($methods)
Render HTML not allowed message.
renderJsonNotAllowedMessage($methods)
Render JSON not allowed message.
__invoke(ServerRequestInterface $request, ResponseInterface $response, array $methods)
Invoke error handler.
renderPlainOptionsMessage($methods)
Render PLAIN message for OPTIONS response.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output
getMethod()
Retrieves the HTTP method of the request.
Representation of an outgoing, server-side response.
Representation of an incoming, server-side HTTP request.
if( $path[strlen( $path) - 1]==='/') if(is_dir($path)) if(!file_exists( $path)) if(preg_match('#\.php$#D', $path)) $contentType
Slim Framework (https://slimframework.com)