AppFramework(Controller|HTTP|HTTP-Responses|Middleware), IContainer API fixes

remotes/origin/stable6
Morris Jobke 13 years ago
parent 248eed16a6
commit bc8cc9142e
  1. 7
      lib/public/appframework/controller.php
  2. 8
      lib/public/appframework/http.php
  3. 11
      lib/public/appframework/http/jsonresponse.php
  4. 4
      lib/public/appframework/http/response.php
  5. 26
      lib/public/appframework/http/templateresponse.php
  6. 4
      lib/public/appframework/middleware.php
  7. 2
      lib/public/icontainer.php

@ -20,6 +20,10 @@
*
*/
/**
* Public interface of ownCloud for apps to use.
* AppFramework\Controller class
*/
namespace OCP\AppFramework;
@ -34,16 +38,19 @@ use OCP\IRequest;
abstract class Controller {
/**
* app container for dependency injection
* @var \OCP\AppFramework\IAppContainer
*/
protected $app;
/**
* current request
* @var \OCP\IRequest
*/
protected $request;
/**
* constructor of the controller
* @param IAppContainer $app interface to the app
* @param IRequest $request an instance of the request
*/

@ -20,10 +20,16 @@
*
*/
/**
* Public interface of ownCloud for apps to use.
* AppFramework\HTTP class
*/
namespace OCP\AppFramework;
/**
* Base class which contains constants for HTTP status codes
*/
class Http {
const STATUS_CONTINUE = 100;

@ -20,6 +20,10 @@
*
*/
/**
* Public interface of ownCloud for apps to use.
* AppFramework\HTTP\JSONResponse class
*/
namespace OCP\AppFramework\Http;
@ -30,10 +34,15 @@ use OCP\AppFramework\Http;
*/
class JSONResponse extends Response {
/**
* response data
* @var array|object
*/
protected $data;
/**
* constructor of JSONResponse
* @param array|object $data the object or array that should be transformed
* @param int $statusCode the Http status code, defaults to 200
*/
@ -55,7 +64,7 @@ class JSONResponse extends Response {
/**
* Sets values in the data json array
* @param array|object $params an array or object which will be transformed
* @param array|object $data an array or object which will be transformed
* to JSON
*/
public function setData($data){

@ -20,6 +20,10 @@
*
*/
/**
* Public interface of ownCloud for apps to use.
* AppFramework\HTTP\Response class
*/
namespace OCP\AppFramework\Http;

@ -20,6 +20,10 @@
*
*/
/**
* Public interface of ownCloud for apps to use.
* AppFramework\HTTP\TemplateResponse class
*/
namespace OCP\AppFramework\Http;
@ -29,14 +33,34 @@ namespace OCP\AppFramework\Http;
*/
class TemplateResponse extends Response {
/**
* name of the template
* @var string
*/
protected $templateName;
/**
* parameters
* @var array
*/
protected $params;
/**
* rendering type (admin, user, blank)
* @var string
*/
protected $renderAs;
/**
* app name
* @var string
*/
protected $appName;
/**
* @param string $templateName the name of the template
* constructor of TemplateResponse
* @param string $appName the name of the app to load the template from
* @param string $templateName the name of the template
*/
public function __construct($appName, $templateName) {
$this->templateName = $templateName;

@ -20,6 +20,10 @@
*
*/
/**
* Public interface of ownCloud for apps to use.
* AppFramework\Middleware class
*/
namespace OCP\AppFramework;

@ -64,7 +64,7 @@ interface IContainer {
* In case the parameter is false the service will be recreated on every call.
*
* @param string $name
* @param callable $closure
* @param \Closure $closure
* @param bool $shared
* @return void
*/

Loading…
Cancel
Save