From 206f83941b26b16f89e695ae84b998e9cf11132a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 31 Aug 2013 21:34:29 +0200 Subject: [PATCH] move new interfaces into lib/public and OCP --- .../dependencyinjection/dicontainer.php | 2 +- lib/appframework/http/request.php | 2 +- lib/appframework/utility/simplecontainer.php | 2 +- lib/contactsmanager.php | 2 +- lib/public/appframework/iappcontainer.php | 4 ++-- lib/public/{core => }/contacts/imanager.php | 2 +- lib/public/{core => }/icontainer.php | 4 ++-- lib/public/{core => }/irequest.php | 2 +- lib/public/{core => }/iservercontainer.php | 8 ++++---- lib/server.php | 16 ++++++++++++++-- 10 files changed, 28 insertions(+), 16 deletions(-) rename lib/public/{core => }/contacts/imanager.php (99%) rename lib/public/{core => }/icontainer.php (97%) rename lib/public/{core => }/irequest.php (99%) rename lib/public/{core => }/iservercontainer.php (92%) diff --git a/lib/appframework/dependencyinjection/dicontainer.php b/lib/appframework/dependencyinjection/dicontainer.php index 43f6eee29b..2ef885d7b2 100644 --- a/lib/appframework/dependencyinjection/dicontainer.php +++ b/lib/appframework/dependencyinjection/dicontainer.php @@ -132,7 +132,7 @@ class DIContainer extends SimpleContainer implements IAppContainer{ } /** - * @return \OCP\Core\IServerContainer + * @return \OCP\IServerContainer */ function getServer() { diff --git a/lib/appframework/http/request.php b/lib/appframework/http/request.php index ab72a8db69..4f1775182a 100644 --- a/lib/appframework/http/request.php +++ b/lib/appframework/http/request.php @@ -22,7 +22,7 @@ namespace OC\AppFramework\Http; -use OCP\Core\IRequest; +use OCP\IRequest; /** * Class for accessing variables in the request. diff --git a/lib/appframework/utility/simplecontainer.php b/lib/appframework/utility/simplecontainer.php index 04b6cd727b..a51ace83a3 100644 --- a/lib/appframework/utility/simplecontainer.php +++ b/lib/appframework/utility/simplecontainer.php @@ -10,7 +10,7 @@ require_once __DIR__ . '/../../../3rdparty/Pimple/Pimple.php'; * * SimpleContainer is a simple implementation of IContainer on basis of \Pimple */ -class SimpleContainer extends \Pimple implements \OCP\Core\IContainer { +class SimpleContainer extends \Pimple implements \OCP\IContainer { /** * @param string $name name of the service to query for diff --git a/lib/contactsmanager.php b/lib/contactsmanager.php index 59c413ec03..fc6745b450 100644 --- a/lib/contactsmanager.php +++ b/lib/contactsmanager.php @@ -22,7 +22,7 @@ namespace OC { - class ContactsManager implements \OCP\Core\Contacts\IManager { + class ContactsManager implements \OCP\Contacts\IManager { /** * This function is used to search and find contacts within the users address books. diff --git a/lib/public/appframework/iappcontainer.php b/lib/public/appframework/iappcontainer.php index db909241e5..c8f6229dd9 100644 --- a/lib/public/appframework/iappcontainer.php +++ b/lib/public/appframework/iappcontainer.php @@ -23,7 +23,7 @@ namespace OCP\AppFramework; use OCP\AppFramework\IApi; -use OCP\Core\IContainer; +use OCP\IContainer; /** * Class IAppContainer @@ -39,7 +39,7 @@ interface IAppContainer extends IContainer{ function getCoreApi(); /** - * @return \OCP\Core\IServerContainer + * @return \OCP\IServerContainer */ function getServer(); } diff --git a/lib/public/core/contacts/imanager.php b/lib/public/contacts/imanager.php similarity index 99% rename from lib/public/core/contacts/imanager.php rename to lib/public/contacts/imanager.php index e8bb7bfd8e..3bfbca7be5 100644 --- a/lib/public/core/contacts/imanager.php +++ b/lib/public/contacts/imanager.php @@ -28,7 +28,7 @@ // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes -namespace OCP\Core\Contacts { +namespace OCP\Contacts { /** * This class provides access to the contacts app. Use this class exclusively if you want to access contacts. diff --git a/lib/public/core/icontainer.php b/lib/public/icontainer.php similarity index 97% rename from lib/public/core/icontainer.php rename to lib/public/icontainer.php index 88ebc6cf64..d43c1c90f1 100644 --- a/lib/public/core/icontainer.php +++ b/lib/public/icontainer.php @@ -20,14 +20,14 @@ * */ -namespace OCP\Core; +namespace OCP; /** * Class IContainer * * IContainer is the basic interface to be used for any internal dependency injection mechanism * - * @package OCP\Core + * @package OCP */ interface IContainer { diff --git a/lib/public/core/irequest.php b/lib/public/irequest.php similarity index 99% rename from lib/public/core/irequest.php rename to lib/public/irequest.php index be60978a3c..cd39855950 100644 --- a/lib/public/core/irequest.php +++ b/lib/public/irequest.php @@ -20,7 +20,7 @@ * */ -namespace OCP\Core; +namespace OCP; interface IRequest { diff --git a/lib/public/core/iservercontainer.php b/lib/public/iservercontainer.php similarity index 92% rename from lib/public/core/iservercontainer.php rename to lib/public/iservercontainer.php index 0517cc53e0..5f5b967754 100644 --- a/lib/public/core/iservercontainer.php +++ b/lib/public/iservercontainer.php @@ -20,12 +20,12 @@ * */ -namespace OCP\Core; +namespace OCP; /** * Class IServerContainer - * @package OCP\Core + * @package OCP * * This container holds all ownCloud services */ @@ -35,7 +35,7 @@ interface IServerContainer { * The contacts manager will act as a broker between consumers for contacts information and * providers which actual deliver the contact information. * - * @return \OCP\Core\Contacts\IManager + * @return \OCP\Contacts\IManager */ function getContactsManager(); @@ -44,7 +44,7 @@ interface IServerContainer { * is returned from this method. * In case the current execution was not initiated by a web request null is returned * - * @return \OCP\Core\IRequest|null + * @return \OCP\IRequest|null */ function getRequest(); diff --git a/lib/server.php b/lib/server.php index 72c82efe16..ad955bf5c6 100644 --- a/lib/server.php +++ b/lib/server.php @@ -3,7 +3,7 @@ namespace OC; use OC\AppFramework\Utility\SimpleContainer; -use OCP\Core\IServerContainer; +use OCP\IServerContainer; /** * Class Server @@ -20,9 +20,21 @@ class Server extends SimpleContainer implements IServerContainer { } /** - * @return \OCP\Core\Contacts\IManager + * @return \OCP\Contacts\IManager */ function getContactsManager() { return $this->query('ContactsManager'); } + + /** + * The current request object holding all information about the request currently being processed + * is returned from this method. + * In case the current execution was not initiated by a web request null is returned + * + * @return \OCP\IRequest|null + */ + function getRequest() + { + return $this->query('Request'); + } }