* deleted unnecessary RequestHandling classes
authorJochen Rau <j.rau@web.de>
Fri, 30 Jan 2009 08:27:23 +0000 (08:27 +0000)
committerJochen Rau <j.rau@web.de>
Fri, 30 Jan 2009 08:27:23 +0000 (08:27 +0000)
typo3/sysext/extbase/Classes/DomainObject/TX_EXTMVC_DomainObject_AbstractDomainObject.php
typo3/sysext/extbase/Classes/TX_EXTMVC_DefaultRequestHandler.php [deleted file]
typo3/sysext/extbase/Classes/TX_EXTMVC_RequestHandlerInterface.php [deleted file]
typo3/sysext/extbase/Classes/TX_EXTMVC_RequestHandlerResolver.php [deleted file]
typo3/sysext/extbase/Classes/TX_EXTMVC_RequestProcessorChainManager.php [deleted file]
typo3/sysext/extbase/Classes/TX_EXTMVC_RequestProcessorInterface.php [deleted file]
typo3/sysext/extbase/Classes/Web/TX_EXTMVC_Web_RequestHandler.php [deleted file]

index 23e1791..7d66204 100644 (file)
@@ -55,14 +55,15 @@ abstract class TX_EXTMVC_DomainObject_AbstractDomainObject {
                        t3lib_div::loadTCA($possibleTableName);
                        $tca = $GLOBALS['TCA'][$possibleTableName]['columns'];
                        foreach ($tca as $columnName => $columnConfiguration) {
-                               $this->cleanProperties[$columnName] = NULL;
                                if (array_key_exists('foreign_table', $columnConfiguration['config'])) {
                                        // TODO take IRRE into account
                                        if (array_key_exists('MM', $columnConfiguration['config'])) {
                                                $this->manyToManyProperties[] = $columnName;
                                        } else {
-                                               $this->cleanProperties[] = $columnName;
+                                               $this->oneToManyProperties[] = $columnName;
                                        }
+                               } else {
+                                       $this->cleanProperties[$columnName] = NULL;
                                }
                                
                        }
@@ -77,7 +78,7 @@ abstract class TX_EXTMVC_DomainObject_AbstractDomainObject {
                        if (property_exists($this, $propertyName)) {
                                $this->$propertyName = $value;
                        } else {
-                               // throw new TX_EXTMVC_Persistence_Exception_UnknownProperty('The property "' . $propertyName . '" does not exist in this object.', 1233270476);
+                               throw new TX_EXTMVC_Persistence_Exception_UnknownProperty('The property "' . $propertyName . '" doesn\'t exist in this object.', 1233270476);
                        }
                }
        }
diff --git a/typo3/sysext/extbase/Classes/TX_EXTMVC_DefaultRequestHandler.php b/typo3/sysext/extbase/Classes/TX_EXTMVC_DefaultRequestHandler.php
deleted file mode 100644 (file)
index 1dfe3db..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @version $Id:$
- */
-
-/**
- * A Special Case of a Request Handler: This default handler is used, if no other request
- * handler was found which could handle the request.
- *
- * @version $Id:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class DefaultRequestHandler implements TX_EXTMVC_RequestHandlerInterface {
-
-       /**
-        * Handles the request
-        *
-        * @return void
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function handleRequest() {
-               echo ('FLOW3: This is the default request handler - no other suitable request handler could be determined.');
-       }
-
-       /**
-        * This request handler can handle any request, as it is the default request handler.
-        *
-        * @return boolean TRUE
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function canHandleRequest() {
-               return TRUE;
-       }
-
-       /**
-        * Returns the priority - how eager the handler is to actually handle the
-        * request.
-        *
-        * @return integer The priority of the request handler. Always "0" = fallback.
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function getPriority() {
-               return 0;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/TX_EXTMVC_RequestHandlerInterface.php b/typo3/sysext/extbase/Classes/TX_EXTMVC_RequestHandlerInterface.php
deleted file mode 100644 (file)
index 542205f..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * The interface for a request handler
- *
- * @version $Id:$
- * @author Robert Lemke <robert@typo3.org>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-interface RequestHandlerInterface {
-
-       /**
-        * Handles a raw request and sends the respsonse.
-        *
-        * @return void
-        */
-       public function handleRequest();
-
-       /**
-        * Checks if the request handler can handle the current request.
-        *
-        * @return boolean TRUE if it can handle the request, otherwise FALSE
-        */
-       public function canHandleRequest();
-
-       /**
-        * Returns the priority - how eager the handler is to actually handle the
-        * request. An integer > 0 means "I want to handle this request" where
-        * "100" is default. "0" means "I am a fallback solution".
-        *
-        * If the handler cannot handle the request, a LogicException should be
-        * thrown.
-        *
-        * @return integer The priority of the request handler
-        */
-       public function getPriority();
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/TX_EXTMVC_RequestHandlerResolver.php b/typo3/sysext/extbase/Classes/TX_EXTMVC_RequestHandlerResolver.php
deleted file mode 100644 (file)
index 474e4d0..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Analyzes the raw request and delivers a request handler which can handle it.
- *
- * @version $Id:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class RequestHandlerResolver {
-
-       /**
-        * @var F3_FLOW3_ObjectManagerInterface Reference to the object manager
-        */
-       protected $objectManager;
-
-       /**
-        * The FLOW3 settings
-        * @var array
-        */
-       protected $configuration;
-
-       /**
-        * Constructs the Request Handler Resolver
-        *
-        * @param array $settings The FLOW3 settings
-        * @param F3_FLOW3_ObjectManagerInterface $objectManager A reference to the object manager
-        * @return void
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function __construct(array $settings, F3_FLOW3_Object_ManagerInterface $objectManager) {
-               $this->settings = $settings;
-               $this->objectManager = $objectManager;
-       }
-
-       /**
-        * Analyzes the raw request and tries to find a request handler which can handle
-        * it. If none is found, an exception is thrown.
-        *
-        * @return TX_EXTMVC_RequestHandler A request handler
-        * @throws TX_EXTMVC_Exception
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function resolveRequestHandler() {
-               $availableRequestHandlerClassNames = $this->settings['mvc']['availableRequestHandlers'];
-
-               $suitableRequestHandlers = array();
-               foreach ($availableRequestHandlerClassNames as $requestHandlerClassName) {
-                       $requestHandler = $this->objectManager->getObject($requestHandlerClassName);
-                       if ($requestHandler->canHandleRequest()) {
-                               $priority = $requestHandler->getPriority();
-                               if (isset($suitableRequestHandlers[$priority])) throw new LogicException('More than one request handler with the same priority can handle the request, but only one handler may be active at a time!', 1176475350);
-                               $suitableRequestHandlers[$priority] = $requestHandler;
-                       }
-               }
-               if (count($suitableRequestHandlers) == 0) throw new TX_EXTMVC_Exception('No suitable request handler found.', 1205414233);
-               ksort($suitableRequestHandlers);
-               return array_pop($suitableRequestHandlers);
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/TX_EXTMVC_RequestProcessorChainManager.php b/typo3/sysext/extbase/Classes/TX_EXTMVC_RequestProcessorChainManager.php
deleted file mode 100644 (file)
index 7a9bb04..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * A Manager for the Request Processor Chain. This chain is used to post-process
- * the Request object prior to handing it over to the Request Dispatcher.
- *
- * @version $Id:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class RequestProcessorChainManager {
-
-       /**
-        * @var array Supported request types
-        */
-       protected $supportedRequestTypes = array('TX_EXTMVC_Request', 'TX_EXTMVC_Web_Request', 'TX_EXTMVC_CLI_Request');
-
-       /**
-        * @var array Registered request processors, grouped by request type
-        */
-       protected $requestProcessors = array();
-
-       /**
-        * Processes the given request object by invoking the processors
-        * of the processor chain.
-        *
-        * @param TX_EXTMVC_Request $request The request object - changes are applied directly to this object by the processors.
-        * @return void
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function processRequest(TX_EXTMVC_Request $request) {
-               $requestTypes = array_keys($this->requestProcessors);
-               foreach ($requestTypes as $requestType) {
-                       if ($request instanceof $requestType) {
-                               foreach ($this->requestProcessors[$requestType] as $requestProcessor) {
-                                       $requestProcessor->processRequest($request);
-                               }
-                       }
-               }
-       }
-
-       /**
-        * Registers a Request Processor for the specified request type.
-        *
-        * @param TX_EXTMVC_RequestProcessorInterface $requestProcessor: The request processor
-        * @param string $requestType: Type (class- or interface name) of the request this processor is interested in
-        * @return void
-        * @throws TX_EXTMVC_Exception_InvalidRequestType if the request type is not supported.
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function registerRequestProcessor(TX_EXTMVC_RequestProcessorInterface $requestProcessor, $requestType) {
-               if (!in_array($requestType, $this->supportedRequestTypes, TRUE)) throw new TX_EXTMVC_Exception_InvalidRequestType('"' . $requestType . '" is not a valid request type - or at least it\'s not supported by the Request Processor Chain.', 1187260972);
-               $this->requestProcessors[$requestType][] = $requestProcessor;
-       }
-
-       /**
-        * Unregisters the given Request Processor. If a request type is specified,
-        * the Processor will only be removed from that chain accordingly.
-        *
-        * Triggers no_ error if the request processor did not exist.
-        *
-        * @param TX_EXTMVC_RequestProcessorInterface $requestProcessor The request processor
-        * @param string $requestType Type (class- or interface name) of the request this processor is interested in
-        * @return void
-        * @throws TX_EXTMVC_Exception_InvalidRequestType if the request type is not supported.
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function unregisterRequestProcessor(TX_EXTMVC_RequestProcessorInterface $requestProcessor, $requestType = NULL) {
-               if ($requestType !== NULL) {
-                       if (!in_array($requestType, $this->supportedRequestTypes, TRUE)) throw new TX_EXTMVC_Exception_InvalidRequestType('"' . $requestType . '" is not a valid request type - or at least it\'s not supported by the Request Processor Chain.', 1187261072);
-                       foreach ($this->requestProcessors[$requestType] as $index => $existingRequestProcessor) {
-                               if ($existingRequestProcessor === $requestProcessor) {
-                                       unset($this->requestProcessors[$requestType][$index]);
-                               }
-                       }
-               } else {
-                       foreach ($this->requestProcessors as $requestType => $requestProcessorsForThisType) {
-                               foreach ($requestProcessorsForThisType as $index => $existingRequestProcessor) {
-                                       if ($existingRequestProcessor === $requestProcessor) {
-                                               unset($this->requestProcessors[$requestType][$index]);
-                                       }
-                               }
-                       }
-               }
-       }
-
-       /**
-        * Returns an array of all registered request processors, grouped by request type.
-        *
-        * @return array An array of request types of request processor objects
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function getRegisteredRequestProcessors() {
-               return $this->requestProcessors;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/TX_EXTMVC_RequestProcessorInterface.php b/typo3/sysext/extbase/Classes/TX_EXTMVC_RequestProcessorInterface.php
deleted file mode 100644 (file)
index 3dae656..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * Contract for a Request Processor. Objects of this kind are registered
- * via the Request Processor Chain Manager.
- *
- * @version $Id:$
- * @author Robert Lemke <robert@typo3.org>
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-interface RequestProcessorInterface {
-
-       /**
-        * Processes the given request (ie. analyzes and modifies if necessary).
-        *
-        * @param TX_EXTMVC_Request $request The request
-        * @return void
-        */
-       public function processRequest(TX_EXTMVC_Request $request);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Web/TX_EXTMVC_Web_RequestHandler.php b/typo3/sysext/extbase/Classes/Web/TX_EXTMVC_Web_RequestHandler.php
deleted file mode 100755 (executable)
index 3968fc3..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * A request handler which can handle web requests.
- *
- * @version $Id:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class RequestHandler implements TX_EXTMVC_RequestHandlerInterface {
-
-       /**
-        * @var F3_FLOW3_Object_FactoryInterface Reference to the object factory
-        */
-       protected $objectFactory;
-
-       /**
-        * @var F3_FLOW3_Utility_Environment Reference to the environment utility object
-        */
-       protected $utilityEnvironment;
-
-       /**
-        * @var TX_EXTMVC_Dispatcher
-        */
-       protected $dispatcher;
-
-       /**
-        * @var TX_EXTMVC_Web_RequestBuilder
-        */
-       protected $requestBuilder;
-
-       /**
-        * @var TX_EXTMVC_RequestProcessorChainManager
-        */
-       protected $requestProcessorChainManager;
-
-       /**
-        * Constructs the Web Request Handler
-        *
-        * @param F3_FLOW3_Object_FactoryInterface $objectFactory A reference to the object factory
-        * @param F3_FLOW3_Utility_Environment $utilityEnvironment A reference to the environment
-        * @param TX_EXTMVC_Dispatcher $dispatcher The request dispatcher
-        * @param TX_EXTMVC_Web_RequestBuilder $requestBuilder The request builder
-        * @param TX_EXTMVC_RequestProcessorChainManager A reference to the request processor chain manager
-        * @return void
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function __construct(
-                       F3_FLOW3_Object_FactoryInterface $objectFactory,
-                       F3_FLOW3_Utility_Environment $utilityEnvironment,
-                       TX_EXTMVC_Dispatcher $dispatcher,
-                       TX_EXTMVC_Web_RequestBuilder $requestBuilder,
-                       TX_EXTMVC_RequestProcessorChainManager $requestProcessorChainManager) {
-               $this->objectFactory = $objectFactory;
-               $this->utilityEnvironment = $utilityEnvironment;
-               $this->dispatcher = $dispatcher;
-               $this->requestBuilder = $requestBuilder;
-               $this->requestProcessorChainManager = $requestProcessorChainManager;
-       }
-
-       /**
-        * Handles the web request. The response will automatically be sent to the client.
-        *
-        * @return void
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function handleRequest() {
-               $request = $this->requestBuilder->build();
-               $this->requestProcessorChainManager->processRequest($request);
-               $response = t3lib_div::makeInstance('TX_EXTMVC_Web_Response');
-               $this->dispatcher->dispatch($request, $response);
-               $response->send();
-       }
-
-       /**
-        * This request handler can handle any web request.
-        *
-        * @return boolean If the request is a web request, TRUE otherwise FALSE
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function canHandleRequest() {
-               switch ($this->utilityEnvironment->getRequestMethod()) {
-                       case F3_FLOW3_Utility_Environment::REQUEST_METHOD_GET :
-                       case F3_FLOW3_Utility_Environment::REQUEST_METHOD_POST :
-                       case F3_FLOW3_Utility_Environment::REQUEST_METHOD_PUT :
-                       case F3_FLOW3_Utility_Environment::REQUEST_METHOD_DELETE :
-                       case F3_FLOW3_Utility_Environment::REQUEST_METHOD_OPTIONS :
-                       case F3_FLOW3_Utility_Environment::REQUEST_METHOD_HEAD :
-                               return TRUE;
-               }
-               return FALSE;
-       }
-
-       /**
-        * Returns the priority - how eager the handler is to actually handle the
-        * request.
-        *
-        * @return integer The priority of the request handler.
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function getPriority() {
-               return 100;
-       }
-}
-?>
\ No newline at end of file