36 if ($request->
getMethod() ===
'OPTIONS') {
44 case 'application/json':
49 case 'application/xml':
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>
getMethod()
Retrieves the HTTP method of the request.
Representation of an incoming, server-side HTTP request.
renderXmlNotAllowedMessage($methods)
Render XML not allowed message.
withStatus($code, $reasonPhrase='')
Return an instance with the specified status code and, optionally, reason phrase. ...
renderPlainOptionsMessage($methods)
Render PLAIN message for OPTIONS response.
determineContentType(ServerRequestInterface $request)
Determine which content type we know about is wanted using Accept header.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
renderHtmlNotAllowedMessage($methods)
Render HTML not allowed message.
__invoke(ServerRequestInterface $request, ResponseInterface $response, array $methods)
Invoke error handler.
Representation of an outgoing, server-side response.
Create styles array
The data for the language used.
renderJsonNotAllowedMessage($methods)
Render JSON not allowed message.
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)
Default Slim application not allowed handler.
Abstract Slim application handler.
Set page orientation and size