<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Regarding PUT: PHP does not support it officially and the solutions
are a bit hacky so I chose to not implement them.<br>
The global variables are passed to the Request class:<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="https://github.com/owncloud/apps/blob/master/appframework/dependencyinjection/dicontainer.php#L61">https://github.com/owncloud/apps/blob/master/appframework/dependencyinjection/dicontainer.php#L61</a><br>
<br>
and accessed in the controller<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="https://github.com/owncloud/apps/blob/master/appframework/controller/controller.php#L77">https://github.com/owncloud/apps/blob/master/appframework/controller/controller.php#L77</a><br>
<br>
I'll add more globals like $_SERVER for the next release, not sure
about PUT and DELETE though. If there is a clean, bugfree and
working solution, we could include it ;)<br>
<br>
The addHeader method is correct for now because I forgot to
provide/didnt think of a NotFoundResponse :) there could also be a
403 response named ForbiddenResponse. Easy to implement and
unittest, im looking forward to a potential PR ;)<br>
<br>
You can catch the exception from the mapper with a try catch block
when you use a find() method. renderJSON also supports an error
response by passing an error message, see
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="http://doc.owncloud.org/server/5.0/developer_manual/app/appframework/api/controller_controller.html">http://doc.owncloud.org/server/5.0/developer_manual/app/appframework/api/controller_controller.html</a><br>
<br>
<blockquote
cite="mid:CAF5F7KEiu5v48YHjK3_wOTa_NnOZyK-b4xX6VVZeAmMdZ4Fbnw@mail.gmail.com"
type="cite">
<pre wrap="">
I have updated the app according the suggestions. Got couple more
questions regarding the app framework:
* Is there anyway to obtain PUT request data like I do with POST?
* Currently, I am using addHeader method to status code of responses.
It looks a little bit hacky, not sure whether this is the right thing
to do.
* Seems that when there is a exception thrown in the mapper object,
the controller cannot catch it? I want to return json containing error
code to client side when there is an exception.
Thanks, for input and help from all of you :)
_______________________________________________
Owncloud mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Owncloud@kde.org">Owncloud@kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/owncloud">https://mail.kde.org/mailman/listinfo/owncloud</a>
</pre>
</blockquote>
<br>
</body>
</html>