[Owncloud] Introducing device tracking feature to ownCloud was: ideas for GSoC 2013

Bernhard Posselt nukeawhale at gmail.com
Wed Mar 13 23:05:33 UTC 2013


Regarding PUT: PHP does not support it officially and the solutions are 
a bit hacky so I chose to not implement them.
The global variables are passed to the Request class:

https://github.com/owncloud/apps/blob/master/appframework/dependencyinjection/dicontainer.php#L61

and accessed in the controller

https://github.com/owncloud/apps/blob/master/appframework/controller/controller.php#L77

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 ;)

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 ;)

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 
http://doc.owncloud.org/server/5.0/developer_manual/app/appframework/api/controller_controller.html

> 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
> Owncloud at kde.org
> https://mail.kde.org/mailman/listinfo/owncloud

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/owncloud/attachments/20130314/eef2fb74/attachment.html>


More information about the Owncloud mailing list