* All class files are renamed to a short version (according to FLOW3 and after a discussion on the snowboard tour; class names remain long)
* Next step: Renaming EXTMVC -> ExtBase
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A general purpose configuration container.
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Configuration_Container implements Countable, Iterator, ArrayAccess {
+
+ /**
+ * @var array Configuration options and their values
+ */
+ protected $options = array();
+
+ /**
+ * @var boolean Whether this container is locked against write access or open
+ */
+ protected $locked = FALSE;
+
+ /**
+ * @var integer The current Iterator index
+ */
+ protected $iteratorIndex = 0;
+
+ /**
+ * @var integer The current number of options
+ */
+ protected $iteratorCount = 0;
+
+ /**
+ * Constructs the configuration container
+ *
+ * @param array $fromArray If specified, the configuration container will be intially built from the given array structure and values
+ */
+ public function __construct($fromArray = NULL) {
+ if (is_array($fromArray)) {
+ $this->setFromArray($fromArray);
+ }
+ }
+
+ /**
+ * Sets the content of this configuration container by parsing the given array.
+ *
+ * @param array $fromArray Array structure (and values) which are supposed to be converted into container properties and sub containers
+ * @return void
+ */
+ public function setFromArray(array $fromArray) {
+ foreach ($fromArray as $key => $value) {
+ if (is_array($value)) {
+ $subContainer = new self($value);
+ $this->offsetSet($key, $subContainer);
+ } else {
+ $this->offsetSet($key, $value);
+ }
+ }
+ }
+
+ /**
+ * Returns this configuration container (and possible sub containers) as an array
+ *
+ * @return array This container converted to an array
+ */
+ public function getAsArray() {
+ $optionsArray = array();
+ foreach ($this->options as $key => $value) {
+ $optionsArray[$key] = ($value instanceof TX_EXTMVC_Configuration_Container) ? $value->getAsArray() : $value;
+ }
+ return $optionsArray;
+ }
+
+ /**
+ * Returns the this container as a TypoScript array (with the dot "." as a suffix for keys)
+ *
+ * @param mixed $options A plain value or a F3_FLOW3_Configuration_Container
+ * @return array This container converted to a TypoScript array
+ */
+ public function getAsTsArray() {
+ $optionsArray = array();
+ foreach ($this->options as $key => $value) {
+ if ($value instanceof F3_GimmeFive_Configuration_Container) {
+ $key = $key . '.';
+ $optionsArray[$key] = $this->getAsTsArray();
+ } else {
+ $optionsArray[$key] = $value;
+ }
+ }
+ return $optionsArray;
+ }
+
+ /**
+ * Locks this configuration container agains write access.
+ *
+ * @return void
+ */
+ public function lock() {
+ $this->locked = TRUE;
+ foreach ($this->options as $option) {
+ if ($option instanceof TX_EXTMVC_Configuration_Container) {
+ $option->lock();
+ }
+ }
+ }
+
+ /**
+ * If this container is locked against write access.
+ *
+ * @return boolean TRUE if the container is locked
+ */
+ public function isLocked() {
+ return $this->locked;
+ }
+
+ /**
+ * Merges this container with another configuration container
+ *
+ * @param TX_EXTMVC_Configuration_Container $otherConfiguration The other configuration container
+ * @return TX_EXTMVC_Configuration_Container This container
+ */
+ public function mergeWith(TX_EXTMVC_Configuration_Container $otherConfiguration) {
+ foreach ($otherConfiguration as $optionName => $newOptionValue) {
+ if ($newOptionValue instanceof TX_EXTMVC_Configuration_Container && array_key_exists($optionName, $this->options)) {
+ $existingOptionValue = $this->__get($optionName);
+ if ($existingOptionValue instanceof TX_EXTMVC_Configuration_Container) {
+ $newOptionValue = $existingOptionValue->mergeWith($newOptionValue);
+ }
+ }
+ $this->__set($optionName, $newOptionValue);
+ }
+ return $this;
+ }
+
+ /**
+ * Returns the number of configuration options
+ *
+ * @return integer Option count
+ */
+ public function count() {
+ return $this->iteratorCount;
+ }
+
+ /**
+ * Returns the current configuration option
+ *
+ * @return mixed The current option's value
+ */
+ public function current() {
+ return current($this->options);
+ }
+
+ /**
+ * Returns the key of the current configuration option
+ *
+ * @return string The current configuration option's key
+ */
+ public function key() {
+ return key($this->options);
+ }
+
+ /**
+ * Returns the next configuration option
+ *
+ * @return mixed Value of the next configuration option
+ */
+ public function next() {
+ $this->iteratorIndex ++;
+ return next($this->options);
+ }
+
+ /**
+ * Rewinds the iterator index
+ *
+ * @return void
+ */
+ public function rewind() {
+ $this->iteratorIndex = 0;
+ reset ($this->options);
+ }
+
+ /**
+ * Checks if the current index is valid
+ *
+ * @return boolean If the current index is valid
+ */
+ public function valid() {
+ return $this->iteratorIndex < $this->iteratorCount;
+ }
+
+ /**
+ * Offset check for the ArrayAccess interface
+ *
+ * @param mixed $optionName
+ * @return boolean TRUE if the offset exists otherwise FALSE
+ */
+ public function offsetExists($optionName) {
+ return array_key_exists($optionName, $this->options);
+ }
+
+ /**
+ * Getter for the ArrayAccess interface
+ *
+ * @param mixed $optionName Name of the option to retrieve
+ * @return mixed The value
+ */
+ public function offsetGet($optionName) {
+ return $this->__get($optionName);
+ }
+
+ /**
+ * Setter for the ArrayAccess interface
+ *
+ * @param mixed $optionName Name of the option to set
+ * @param mixed $optionValue New value for the option
+ * @return void
+ */
+ public function offsetSet($optionName, $optionValue) {
+ $this->__set($optionName, $optionValue);
+ }
+
+ /**
+ * Unsetter for the ArrayAccess interface
+ *
+ * @param mixed $optionName Name of the option to unset
+ * @return void
+ */
+ public function offsetUnset($optionName) {
+ $this->__unset($optionName);
+ }
+
+ /**
+ * Magic getter method for configuration options. If an option does not exist,
+ * it will be created automatically - if this container is not locked.
+ *
+ * @param string $optionName Name of the configuration option to retrieve
+ * @return mixed The option value
+ */
+ public function __get($optionName) {
+ if (!array_key_exists($optionName, $this->options)) {
+ if ($this->locked) throw new TX_EXTMVC_Configuration_Exception_NoSuchOption('An option "' . $optionName . '" does not exist in this configuration container.', 1216385011);
+ $this->__set($optionName, new self());
+ }
+ return $this->options[$optionName];
+ }
+
+ /**
+ * Magic setter method for configuration options.
+ *
+ * @param string $optionName Name of the configuration option to set
+ * @param mixed $optionValue The option value
+ * @return void
+ * @throws TX_EXTMVC_Configuration_Exception_ContainerIsLocked if the container is locked
+ */
+ public function __set($optionName, $optionValue) {
+ if ($this->locked && !array_key_exists($optionName, $this->options)) throw new TX_EXTMVC_Configuration_Exception_ContainerIsLocked('You tried to create a new configuration option "' . $optionName . '" but the configuration container is already locked. Maybe a spelling mistake?', 1206023011);
+ $this->options[$optionName] = $optionValue;
+ $this->iteratorCount = count($this->options);
+ }
+
+ /**
+ * Magic isset method for configuration options.
+ *
+ * @param string $optionName Name of the configuration option to check
+ * @return boolean TRUE if the option is set, otherwise FALSE
+ */
+ public function __isset($optionName) {
+ return array_key_exists($optionName, $this->options);
+ }
+
+ /**
+ * Magic unsetter method for configuration options.
+ *
+ * @param string $optionName Name of the configuration option to unset
+ * @return void
+ * @throws TX_EXTMVC_Configuration_Exception_ContainerIsLocked if the container is locked
+ */
+ public function __unset($optionName) {
+ if ($this->locked) throw new TX_EXTMVC_Configuration_Exception_ContainerIsLocked('You tried to unset the configuration option "' . $optionName . '" but the configuration container is locked.', 1206023012);
+ unset($this->options[$optionName]);
+ $this->iteratorCount = count($this->options);
+ }
+
+ /**
+ * Magic method to allow setting of configuration options via dummy setters in the format "set[OptionName]([optionValue])".
+ *
+ * @param string $methodName Name of the called setter method.
+ * @param array $arguments Method arguments, passed to the configuration option.
+ * @return TX_EXTMVC_Configuration_Container This configuration container object
+ * @throws TX_EXTMVC_Configuration_Exception if $methodName does not start with "set" or number of arguments are empty
+ */
+ public function __call($methodName, $arguments) {
+ if (substr($methodName, 0, 3) != 'set') {
+ throw new TX_EXTMVC_Configuration_Exception('Method "' . $methodName . '" does not exist.', 1213444319);
+ }
+ if (count($arguments) != 1) {
+ throw new TX_EXTMVC_Configuration_Exception('You have to pass exactly one argument to a configuration option setter.', 1213444809);
+ }
+ $optionName = lcfirst(substr($methodName, 3));
+ $this->__set($optionName, $arguments[0]);
+
+ return $this;
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * @version $Id:$
+ */
+
+/**
+ * A generic Configuration Exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Configuration_Exception extends F3_FLOW3_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * @version $Id:$
+ */
+
+/**
+ * A Container Is Locked exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class ContainerIsLocked extends TX_EXTMVC_Configuration_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * @version $Id:$
+ */
+
+/**
+ * An Invalid Configuration Type Exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidConfigurationType extends TX_EXTMVC_Configuration_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * @version $Id:$
+ */
+
+/**
+ * A No Such File exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class NoSuchFile extends TX_EXTMVC_Configuration_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * @version $Id:$
+ */
+
+/**
+ * A No Such Option exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class NoSuchOption extends TX_EXTMVC_Configuration_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * @version $Id:$
+ */
+
+/**
+ * A Parse Error exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class ParseError extends TX_EXTMVC_Configuration_Exception {
+
+}
+
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * @version $Id:$
- */
-
-/**
- * A Container Is Locked exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class ContainerIsLocked extends TX_EXTMVC_Configuration_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * @version $Id:$
- */
-
-/**
- * An Invalid Configuration Type Exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidConfigurationType extends TX_EXTMVC_Configuration_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * @version $Id:$
- */
-
-/**
- * A No Such File exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class NoSuchFile extends TX_EXTMVC_Configuration_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * @version $Id:$
- */
-
-/**
- * A No Such Option exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class NoSuchOption extends TX_EXTMVC_Configuration_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * @version $Id:$
- */
-
-/**
- * A Parse Error exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class ParseError extends TX_EXTMVC_Configuration_Exception {
-
-}
-
-?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+require_once(PATH_t3lib . 'interfaces/interface.t3lib_singleton.php');
+
+/**
+ * A general purpose configuration manager
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Configuration_Manager implements t3lib_Singleton {
+
+ /**
+ * Storage for the settings, loaded by loadGlobalSettings()
+ *
+ * @var array
+ */
+ protected $settings = array();
+
+ /**
+ * The configuration source instances used for loading the raw configuration
+ *
+ * @var array
+ */
+ protected $configurationSources;
+
+ /**
+ * Constructs the configuration manager
+ *
+ * @param array $configurationSourcesObjectNames An array of object names of the configuration sources
+ */
+ public function __construct(array $configurationSources) {
+ $this->configurationSources = $configurationSources;
+ }
+
+ /**
+ * Returns an array with the settings defined for the specified extension.
+ *
+ * @param string $extensionKey Key of the extension to return the settings for
+ * @return array The settings of the specified extension
+ */
+ public function getSettings($extensionKey, $controllerName = '', $actionName = '') {
+ $settings = array();
+ if (is_array($this->settings[$extensionKey])) {
+ $settings = $this->settings[$extensionKey];
+ if (!empty($controllerName) && is_array($settings[$controllerName])) {
+ if (!empty($actionName) && is_array($settings[$controllerName][$actionName])) {
+ $settings = $settings[$controllerName][$actionName];
+ } else {
+ $settings = $settings[$controllerName];
+ }
+ }
+ // SK: TODO: Look at this in detail
+ // JR: This is an overlay of TS settings; "local" values overwrite more "global" values
+ // TODO Should we provide a hierarchical TS setting overlay?
+ // if (!empty($controllerName) && is_array($settings[$controllerName])) {
+ // foreach ($settings[$controllerName] as $key => $value) {
+ // if (array_key_exists($key, $settings)) {
+ // $settings[$key] = $value;
+ // }
+ // }
+ // }
+ // if (!empty($actionName) && is_array($settings[$controllerName][$actionName])) {
+ // foreach ($settings[$controllerName][$actionName] as $key => $value) {
+ // if (array_key_exists($key, $settings)) {
+ // $settings[$key] = $value;
+ // }
+ // if (array_key_exists($key, $settings[$controllerName])) {
+ // $settings[$controllerName][$key] = $value;
+ // }
+ // }
+ // }
+ }
+ return $settings;
+ }
+
+ /**
+ * Loads the settings defined in the specified extensions and merges them with
+ * those potentially existing in the global configuration folders.
+ *
+ * The result is stored in the configuration manager's settings registry
+ * and can be retrieved with the getSettings() method.
+ *
+ * @param string $extensionKey
+ * @return void
+ * @see getSettings()
+ */
+ public function loadGlobalSettings($extensionKey) {
+ $settings = $this->settings[$extensionKey];
+ if (empty($settings)) $settings = array();
+ foreach ($this->configurationSources as $configurationSource) {
+ $settings = t3lib_div::array_merge_recursive_overrule($settings, $configurationSource->load($extensionKey));
+ }
+ $this->settings[$extensionKey] = $settings;
+ }
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * Configuration source based on FlexForm settings
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Configuration_Source_FlexForm implements TX_EXTMVC_Configuration_SourceInterface {
+
+ /**
+ * XML FlexForm content
+ *
+ * @var string
+ **/
+ protected $flexFormContent;
+
+ /**
+ * Sets the flex form content
+ *
+ * @param string $flexFormContent Flexform content
+ * @return void
+ */
+ public function setFlexFormContent($flexFormContent) {
+ $this->flexFormContent = $flexFormContent;
+ }
+
+ /**
+ * Loads the specified FlexForm configuration and returns its content in a
+ * configuration container. If the file does not exist or could not be loaded,
+ * the empty configuration container is returned.
+ *
+ * @param string $extensionKey The extension key
+ * @return TX_EXTMVC_Configuration_Container
+ */
+ public function load($extensionKey) {
+ $settings = array();
+ if (is_array($this->flexFormContent)) {
+ $flexFormArray = $this->flexFormContent;
+ } elseif (!empty($this->flexFormContent)) {
+ $flexFormArray = t3lib_div::xml2array($this->flexFormContent);
+ }
+ $sheetArray = $flexFormArray['data']['sDEF']['lDEF'];
+ if (is_array($sheetArray)) {
+ foreach($sheetArray as $key => $value) {
+ $settings[$key] = $value['vDEF'];
+ }
+ }
+ return $settings;
+ }
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * Configuration source based on PHP files
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Configuration_Source_PHP implements TX_EXTMVC_Configuration_SourceInterface {
+
+ /**
+ * Loads the specified configuration file and returns its content as an
+ * array. If the file does not exist or could not be loaded, an empty
+ * array is returned
+ *
+ * @param string $extensionKey The extension key
+ * @return array
+ */
+ public function load($extensionKey) {
+ $pathAndFilename = t3lib_extMgm::extPath(strtolower($extensionKey)) . '/Configuration/Settings';
+ $c = t3lib_div::makeInstance('TX_EXTMVC_Configuration_Container');
+ if (file_exists($pathAndFilename . '.php')) {
+ require ($pathAndFilename . '.php');
+ }
+ return $c->getAsArray();
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * Configuration source based on TS settings
+ *
+ */
+class TX_EXTMVC_Configuration_Source_TS implements TX_EXTMVC_Configuration_SourceInterface {
+
+ /**
+ * Loads the specified TypoScript configuration file and returns its content in a
+ * configuration container. If the file does not exist or could not be loaded,
+ * the empty configuration container is returned.
+ *
+ * @param string $extensionKey The extension key
+ * @return array The settings as array without trailing dots
+ */
+ public function load($extensionKey) {
+ // SK: same as with dispatcher. strtolower($extensionKey) is wrong; example: tt_news -> tx_ttnews
+ $settings = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_' . strtolower($extensionKey) . '.'];
+ if (is_array($settings)) $settings = $this->postProcessSettings($settings);
+ return $settings;
+ }
+
+ /**
+ * Removes all trailing dots recursively from TS settings array
+ *
+ * @param array $setup The settings array
+ * @return void
+ */
+ protected function postProcessSettings(array $settings) {
+ $processedSettings = array();
+ foreach ($settings as $key => $value) {
+ if (is_array($value)) $value = $this->postProcessSettings($value);
+ $processedSettings[preg_replace('/(.*)\.$/', '\1', $key, 1)] = $value;
+ }
+ return $processedSettings;
+ }
+
+}
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * Configuration source based on FlexForm settings
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class TX_EXTMVC_Configuration_Source_FlexForm implements TX_EXTMVC_Configuration_SourceInterface {
-
- /**
- * XML FlexForm content
- *
- * @var string
- **/
- protected $flexFormContent;
-
- /**
- * Sets the flex form content
- *
- * @param string $flexFormContent Flexform content
- * @return void
- */
- public function setFlexFormContent($flexFormContent) {
- $this->flexFormContent = $flexFormContent;
- }
-
- /**
- * Loads the specified FlexForm configuration and returns its content in a
- * configuration container. If the file does not exist or could not be loaded,
- * the empty configuration container is returned.
- *
- * @param string $extensionKey The extension key
- * @return TX_EXTMVC_Configuration_Container
- */
- public function load($extensionKey) {
- $settings = array();
- if (is_array($this->flexFormContent)) {
- $flexFormArray = $this->flexFormContent;
- } elseif (!empty($this->flexFormContent)) {
- $flexFormArray = t3lib_div::xml2array($this->flexFormContent);
- }
- $sheetArray = $flexFormArray['data']['sDEF']['lDEF'];
- if (is_array($sheetArray)) {
- foreach($sheetArray as $key => $value) {
- $settings[$key] = $value['vDEF'];
- }
- }
- return $settings;
- }
-
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * Configuration source based on PHP files
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class TX_EXTMVC_Configuration_Source_PHP implements TX_EXTMVC_Configuration_SourceInterface {
-
- /**
- * Loads the specified configuration file and returns its content as an
- * array. If the file does not exist or could not be loaded, an empty
- * array is returned
- *
- * @param string $extensionKey The extension key
- * @return array
- */
- public function load($extensionKey) {
- $pathAndFilename = t3lib_extMgm::extPath(strtolower($extensionKey)) . '/Configuration/Settings';
- $c = t3lib_div::makeInstance('TX_EXTMVC_Configuration_Container');
- if (file_exists($pathAndFilename . '.php')) {
- require ($pathAndFilename . '.php');
- }
- return $c->getAsArray();
- }
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * Configuration source based on TS settings
- *
- */
-class TX_EXTMVC_Configuration_Source_TS implements TX_EXTMVC_Configuration_SourceInterface {
-
- /**
- * Loads the specified TypoScript configuration file and returns its content in a
- * configuration container. If the file does not exist or could not be loaded,
- * the empty configuration container is returned.
- *
- * @param string $extensionKey The extension key
- * @return array The settings as array without trailing dots
- */
- public function load($extensionKey) {
- // SK: same as with dispatcher. strtolower($extensionKey) is wrong; example: tt_news -> tx_ttnews
- $settings = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_' . strtolower($extensionKey) . '.'];
- if (is_array($settings)) $settings = $this->postProcessSettings($settings);
- return $settings;
- }
-
- /**
- * Removes all trailing dots recursively from TS settings array
- *
- * @param array $setup The settings array
- * @return void
- */
- protected function postProcessSettings(array $settings) {
- $processedSettings = array();
- foreach ($settings as $key => $value) {
- if (is_array($value)) $value = $this->postProcessSettings($value);
- $processedSettings[preg_replace('/(.*)\.$/', '\1', $key, 1)] = $value;
- }
- return $processedSettings;
- }
-
-}
-?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * Contract for a configuration source
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+interface TX_EXTMVC_Configuration_SourceInterface {
+
+ /**
+ * Loads the specified configuration file and returns its content in a
+ * configuration container
+ *
+ * @param string $extensionKey The extension key
+ * @return TX_EXTMVC_Configuration_Container
+ */
+ public function load($extensionKey);
+}
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A general purpose configuration container.
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class TX_EXTMVC_Configuration_Container implements Countable, Iterator, ArrayAccess {
-
- /**
- * @var array Configuration options and their values
- */
- protected $options = array();
-
- /**
- * @var boolean Whether this container is locked against write access or open
- */
- protected $locked = FALSE;
-
- /**
- * @var integer The current Iterator index
- */
- protected $iteratorIndex = 0;
-
- /**
- * @var integer The current number of options
- */
- protected $iteratorCount = 0;
-
- /**
- * Constructs the configuration container
- *
- * @param array $fromArray If specified, the configuration container will be intially built from the given array structure and values
- */
- public function __construct($fromArray = NULL) {
- if (is_array($fromArray)) {
- $this->setFromArray($fromArray);
- }
- }
-
- /**
- * Sets the content of this configuration container by parsing the given array.
- *
- * @param array $fromArray Array structure (and values) which are supposed to be converted into container properties and sub containers
- * @return void
- */
- public function setFromArray(array $fromArray) {
- foreach ($fromArray as $key => $value) {
- if (is_array($value)) {
- $subContainer = new self($value);
- $this->offsetSet($key, $subContainer);
- } else {
- $this->offsetSet($key, $value);
- }
- }
- }
-
- /**
- * Returns this configuration container (and possible sub containers) as an array
- *
- * @return array This container converted to an array
- */
- public function getAsArray() {
- $optionsArray = array();
- foreach ($this->options as $key => $value) {
- $optionsArray[$key] = ($value instanceof TX_EXTMVC_Configuration_Container) ? $value->getAsArray() : $value;
- }
- return $optionsArray;
- }
-
- /**
- * Returns the this container as a TypoScript array (with the dot "." as a suffix for keys)
- *
- * @param mixed $options A plain value or a F3_FLOW3_Configuration_Container
- * @return array This container converted to a TypoScript array
- */
- public function getAsTsArray() {
- $optionsArray = array();
- foreach ($this->options as $key => $value) {
- if ($value instanceof F3_GimmeFive_Configuration_Container) {
- $key = $key . '.';
- $optionsArray[$key] = $this->getAsTsArray();
- } else {
- $optionsArray[$key] = $value;
- }
- }
- return $optionsArray;
- }
-
- /**
- * Locks this configuration container agains write access.
- *
- * @return void
- */
- public function lock() {
- $this->locked = TRUE;
- foreach ($this->options as $option) {
- if ($option instanceof TX_EXTMVC_Configuration_Container) {
- $option->lock();
- }
- }
- }
-
- /**
- * If this container is locked against write access.
- *
- * @return boolean TRUE if the container is locked
- */
- public function isLocked() {
- return $this->locked;
- }
-
- /**
- * Merges this container with another configuration container
- *
- * @param TX_EXTMVC_Configuration_Container $otherConfiguration The other configuration container
- * @return TX_EXTMVC_Configuration_Container This container
- */
- public function mergeWith(TX_EXTMVC_Configuration_Container $otherConfiguration) {
- foreach ($otherConfiguration as $optionName => $newOptionValue) {
- if ($newOptionValue instanceof TX_EXTMVC_Configuration_Container && array_key_exists($optionName, $this->options)) {
- $existingOptionValue = $this->__get($optionName);
- if ($existingOptionValue instanceof TX_EXTMVC_Configuration_Container) {
- $newOptionValue = $existingOptionValue->mergeWith($newOptionValue);
- }
- }
- $this->__set($optionName, $newOptionValue);
- }
- return $this;
- }
-
- /**
- * Returns the number of configuration options
- *
- * @return integer Option count
- */
- public function count() {
- return $this->iteratorCount;
- }
-
- /**
- * Returns the current configuration option
- *
- * @return mixed The current option's value
- */
- public function current() {
- return current($this->options);
- }
-
- /**
- * Returns the key of the current configuration option
- *
- * @return string The current configuration option's key
- */
- public function key() {
- return key($this->options);
- }
-
- /**
- * Returns the next configuration option
- *
- * @return mixed Value of the next configuration option
- */
- public function next() {
- $this->iteratorIndex ++;
- return next($this->options);
- }
-
- /**
- * Rewinds the iterator index
- *
- * @return void
- */
- public function rewind() {
- $this->iteratorIndex = 0;
- reset ($this->options);
- }
-
- /**
- * Checks if the current index is valid
- *
- * @return boolean If the current index is valid
- */
- public function valid() {
- return $this->iteratorIndex < $this->iteratorCount;
- }
-
- /**
- * Offset check for the ArrayAccess interface
- *
- * @param mixed $optionName
- * @return boolean TRUE if the offset exists otherwise FALSE
- */
- public function offsetExists($optionName) {
- return array_key_exists($optionName, $this->options);
- }
-
- /**
- * Getter for the ArrayAccess interface
- *
- * @param mixed $optionName Name of the option to retrieve
- * @return mixed The value
- */
- public function offsetGet($optionName) {
- return $this->__get($optionName);
- }
-
- /**
- * Setter for the ArrayAccess interface
- *
- * @param mixed $optionName Name of the option to set
- * @param mixed $optionValue New value for the option
- * @return void
- */
- public function offsetSet($optionName, $optionValue) {
- $this->__set($optionName, $optionValue);
- }
-
- /**
- * Unsetter for the ArrayAccess interface
- *
- * @param mixed $optionName Name of the option to unset
- * @return void
- */
- public function offsetUnset($optionName) {
- $this->__unset($optionName);
- }
-
- /**
- * Magic getter method for configuration options. If an option does not exist,
- * it will be created automatically - if this container is not locked.
- *
- * @param string $optionName Name of the configuration option to retrieve
- * @return mixed The option value
- */
- public function __get($optionName) {
- if (!array_key_exists($optionName, $this->options)) {
- if ($this->locked) throw new TX_EXTMVC_Configuration_Exception_NoSuchOption('An option "' . $optionName . '" does not exist in this configuration container.', 1216385011);
- $this->__set($optionName, new self());
- }
- return $this->options[$optionName];
- }
-
- /**
- * Magic setter method for configuration options.
- *
- * @param string $optionName Name of the configuration option to set
- * @param mixed $optionValue The option value
- * @return void
- * @throws TX_EXTMVC_Configuration_Exception_ContainerIsLocked if the container is locked
- */
- public function __set($optionName, $optionValue) {
- if ($this->locked && !array_key_exists($optionName, $this->options)) throw new TX_EXTMVC_Configuration_Exception_ContainerIsLocked('You tried to create a new configuration option "' . $optionName . '" but the configuration container is already locked. Maybe a spelling mistake?', 1206023011);
- $this->options[$optionName] = $optionValue;
- $this->iteratorCount = count($this->options);
- }
-
- /**
- * Magic isset method for configuration options.
- *
- * @param string $optionName Name of the configuration option to check
- * @return boolean TRUE if the option is set, otherwise FALSE
- */
- public function __isset($optionName) {
- return array_key_exists($optionName, $this->options);
- }
-
- /**
- * Magic unsetter method for configuration options.
- *
- * @param string $optionName Name of the configuration option to unset
- * @return void
- * @throws TX_EXTMVC_Configuration_Exception_ContainerIsLocked if the container is locked
- */
- public function __unset($optionName) {
- if ($this->locked) throw new TX_EXTMVC_Configuration_Exception_ContainerIsLocked('You tried to unset the configuration option "' . $optionName . '" but the configuration container is locked.', 1206023012);
- unset($this->options[$optionName]);
- $this->iteratorCount = count($this->options);
- }
-
- /**
- * Magic method to allow setting of configuration options via dummy setters in the format "set[OptionName]([optionValue])".
- *
- * @param string $methodName Name of the called setter method.
- * @param array $arguments Method arguments, passed to the configuration option.
- * @return TX_EXTMVC_Configuration_Container This configuration container object
- * @throws TX_EXTMVC_Configuration_Exception if $methodName does not start with "set" or number of arguments are empty
- */
- public function __call($methodName, $arguments) {
- if (substr($methodName, 0, 3) != 'set') {
- throw new TX_EXTMVC_Configuration_Exception('Method "' . $methodName . '" does not exist.', 1213444319);
- }
- if (count($arguments) != 1) {
- throw new TX_EXTMVC_Configuration_Exception('You have to pass exactly one argument to a configuration option setter.', 1213444809);
- }
- $optionName = lcfirst(substr($methodName, 3));
- $this->__set($optionName, $arguments[0]);
-
- return $this;
- }
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * @version $Id:$
- */
-
-/**
- * A generic Configuration Exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class TX_EXTMVC_Configuration_Exception extends F3_FLOW3_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-require_once(PATH_t3lib . 'interfaces/interface.t3lib_singleton.php');
-
-/**
- * A general purpose configuration manager
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class TX_EXTMVC_Configuration_Manager implements t3lib_Singleton {
-
- /**
- * Storage for the settings, loaded by loadGlobalSettings()
- *
- * @var array
- */
- protected $settings = array();
-
- /**
- * The configuration source instances used for loading the raw configuration
- *
- * @var array
- */
- protected $configurationSources;
-
- /**
- * Constructs the configuration manager
- *
- * @param array $configurationSourcesObjectNames An array of object names of the configuration sources
- */
- public function __construct(array $configurationSources) {
- $this->configurationSources = $configurationSources;
- }
-
- /**
- * Returns an array with the settings defined for the specified extension.
- *
- * @param string $extensionKey Key of the extension to return the settings for
- * @return array The settings of the specified extension
- */
- public function getSettings($extensionKey, $controllerName = '', $actionName = '') {
- $settings = array();
- if (is_array($this->settings[$extensionKey])) {
- $settings = $this->settings[$extensionKey];
- if (!empty($controllerName) && is_array($settings[$controllerName])) {
- if (!empty($actionName) && is_array($settings[$controllerName][$actionName])) {
- $settings = $settings[$controllerName][$actionName];
- } else {
- $settings = $settings[$controllerName];
- }
- }
- // SK: TODO: Look at this in detail
- // JR: This is an overlay of TS settings; "local" values overwrite more "global" values
- // TODO Should we provide a hierarchical TS setting overlay?
- // if (!empty($controllerName) && is_array($settings[$controllerName])) {
- // foreach ($settings[$controllerName] as $key => $value) {
- // if (array_key_exists($key, $settings)) {
- // $settings[$key] = $value;
- // }
- // }
- // }
- // if (!empty($actionName) && is_array($settings[$controllerName][$actionName])) {
- // foreach ($settings[$controllerName][$actionName] as $key => $value) {
- // if (array_key_exists($key, $settings)) {
- // $settings[$key] = $value;
- // }
- // if (array_key_exists($key, $settings[$controllerName])) {
- // $settings[$controllerName][$key] = $value;
- // }
- // }
- // }
- }
- return $settings;
- }
-
- /**
- * Loads the settings defined in the specified extensions and merges them with
- * those potentially existing in the global configuration folders.
- *
- * The result is stored in the configuration manager's settings registry
- * and can be retrieved with the getSettings() method.
- *
- * @param string $extensionKey
- * @return void
- * @see getSettings()
- */
- public function loadGlobalSettings($extensionKey) {
- $settings = $this->settings[$extensionKey];
- if (empty($settings)) $settings = array();
- foreach ($this->configurationSources as $configurationSource) {
- $settings = t3lib_div::array_merge_recursive_overrule($settings, $configurationSource->load($extensionKey));
- }
- $this->settings[$extensionKey] = $settings;
- }
-
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * Contract for a configuration source
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-interface TX_EXTMVC_Configuration_SourceInterface {
-
- /**
- * Loads the specified configuration file and returns its content in a
- * configuration container
- *
- * @param string $extensionKey The extension key
- * @return TX_EXTMVC_Configuration_Container
- */
- public function load($extensionKey);
-}
-?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An abstract base class for Controllers
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+abstract class TX_EXTMVC_Controller_AbstractController implements TX_EXTMVC_Controller_ControllerInterface {
+
+ /**
+ * @var string Key of the extension this controller belongs to
+ */
+ protected $extensionKey;
+
+ /**
+ * Contains the settings of the current extension
+ *
+ * @var array
+ */
+ protected $settings;
+
+ /**
+ * @var TX_EXTMVC_Request The current request
+ */
+ protected $request;
+
+ /**
+ * @var TX_EXTMVC_Response The response which will be returned by this action controller
+ */
+ protected $response;
+
+ /**
+ * @var TX_EXTMVC_Controller_Arguments Arguments passed to the controller
+ */
+ protected $arguments;
+
+ /**
+ * Actions that schould not be cached (changes the invocated dispatcher to a USER_INT cObject)
+ * @var array
+ */
+ protected $nonCachableActions = array();
+
+ /**
+ * Constructs the controller.
+ *
+ * @param F3_FLOW3_Object_FactoryInterface $objectFactory A reference to the Object Factory
+ * @param F3_FLOW3_Package_ManagerInterface $packageManager A reference to the Package Manager
+ */
+ public function __construct() {
+ // SK: Set $this->extensionKey, could be done the same way as it is done in Fluid
+ $this->arguments = t3lib_div::makeInstance('TX_EXTMVC_Controller_Arguments');
+ }
+
+ /**
+ * Injects the settings of the extension.
+ *
+ * @param array $settings Settings container of the current extension
+ * @return void
+ */
+ public function injectSettings(array $settings) {
+ $this->settings = $settings;
+ }
+
+ /**
+ * Processes a general request. The result can be returned by altering the given response.
+ *
+ * @param TX_EXTMVC_Request $request The request object
+ * @param TX_EXTMVC_Response $response The response, modified by this handler
+ * @return void
+ * @throws TX_EXTMVC_Exception_UnsupportedRequestType if the controller doesn't support the current request type
+ */
+ public function processRequest(TX_EXTMVC_Request $request, TX_EXTMVC_Response $response) {
+ $this->request = $request;
+ $this->request->setDispatched(TRUE);
+ $this->response = $response;
+
+ $this->initializeArguments();
+ $this->mapRequestArgumentsToLocalArguments();
+ }
+
+ /**
+ * Initializes (registers / defines) arguments of this controller.
+ *
+ * Override this method to add arguments which can later be accessed
+ * by the action methods.
+ *
+ * @return void
+ */
+ protected function initializeArguments() {
+ }
+
+ /**
+ * Forwards the request to another controller.
+ *
+ * @return void
+ * @throws TX_EXTMVC_Exception_StopAction
+ */
+ public function forward($actionName, $controllerName = NULL, $extensionKey = NULL, TX_EXTMVC_Controller_Arguments $arguments = NULL) {
+ $this->request->setDispatched(FALSE);
+ $this->request->setControllerActionName($actionName);
+ if ($controllerName !== NULL) $this->request->setControllerName($controllerName);
+ if ($extensionKey !== NULL) $this->request->setControllerExtensionKey($extensionKey);
+ if ($arguments !== NULL) $this->request->setArguments($arguments);
+ throw new TX_EXTMVC_Exception_StopAction();
+ }
+
+ /**
+ * Redirects the web request to another uri.
+ *
+ * NOTE: This method only supports web requests and will thrown an exception if used with other request types.
+ *
+ * @param mixed $uri Either a string representation of a URI or a F3_FLOW3_Property_DataType_URI object
+ * @param integer $delay (optional) The delay in seconds. Default is no delay.
+ * @param integer $statusCode (optional) The HTTP status code for the redirect. Default is "303 See Other"
+ * @throws TX_EXTMVC_Exception_UnsupportedRequestType If the request is not a web request
+ * @throws TX_EXTMVC_Exception_StopAction
+ */
+ public function redirect($uri, $delay = 0, $statusCode = 303) {
+ if (!$this->request instanceof TX_EXTMVC_Web_Request) throw new TX_EXTMVC_Exception_UnsupportedRequestType('redirect() only supports web requests.', 1220539734);
+
+ $escapedUri = htmlentities($uri, ENT_QUOTES, 'utf-8');
+ $this->response->setContent('<html><head><meta http-equiv="refresh" content="' . intval($delay) . ';url=' . $escapedUri . '"/></head></html>');
+ $this->response->setStatus($statusCode);
+ throw new TX_EXTMVC_Exception_StopAction();
+ }
+
+ /**
+ * Sends the specified HTTP status immediately.
+ *
+ * NOTE: This method only supports web requests and will thrown an exception if used with other request types.
+ *
+ * @param integer $statusCode The HTTP status code
+ * @param string $statusMessage A custom HTTP status message
+ * @param string $content Body content which further explains the status
+ * @throws TX_EXTMVC_Exception_UnsupportedRequestType If the request is not a web request
+ * @throws TX_EXTMVC_Exception_StopAction
+ */
+ public function throwStatus($statusCode, $statusMessage = NULL, $content = NULL) {
+ if (!$this->request instanceof TX_EXTMVC_Web_Request) throw new TX_EXTMVC_Exception_UnsupportedRequestType('throwStatus() only supports web requests.', 1220539739);
+
+ $this->response->setStatus($statusCode, $statusMessage);
+ if ($content === NULL) $content = $this->response->getStatus();
+ $this->response->setContent($content);
+ throw new TX_EXTMVC_Exception_StopAction();
+ }
+
+ /**
+ * Maps arguments delivered by the request object to the local controller arguments.
+ *
+ * @return void
+ */
+ protected function mapRequestArgumentsToLocalArguments() {
+ $requestArguments = $this->request->getArguments();
+ foreach ($this->arguments as $argument) {
+ $argumentName = $argument->getName();
+ $argumentShortName = $argument->getShortName();
+ if (array_key_exists($argumentName, $requestArguments)) {
+ $argument->setValue($requestArguments[$argumentName]);
+ } elseif ($argumentShortName !== NULL && array_key_exists($argumentShortName, $requestArguments)) {
+ $argument->setValue($requestArguments[$argumentShortName]);
+ }
+ }
+ }
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A multi action controller
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+// SK: fill initializeArguments() so it parses the arguments for a given view. We need to discuss how this parsing can be
+// SK: done effectively.
+class TX_EXTMVC_Controller_ActionController extends TX_EXTMVC_Controller_AbstractController {
+
+ /**
+ * @var boolean If initializeView() should be called on an action invocation.
+ */
+ protected $initializeView = TRUE;
+
+ /**
+ * @var TX_EXTMVC_View_AbstractView By default a view with the same name as the current action is provided. Contains NULL if none was found.
+ */
+ protected $view = NULL;
+
+ /**
+ * By default a matching view will be resolved. If this property is set, automatic resolving is disabled and the specified object is used instead.
+ * @var string
+ */
+ // SK: rename to defaultViewObjectName. Should only be used if no custom view could be found.
+ // SK: How do we implement this with TYPO3 v4? How can we check if a class exists?
+ // SK: Changing the logic here makes it possible to write specific views for a given action, and use the default view for all other actions.
+ protected $viewObjectName = NULL;
+
+ /**
+ * Pattern after which the view object name is built
+ *
+ * @var string
+ */
+ // SK: Decision: Do we support "format"?
+ protected $viewObjectNamePattern = 'TX_@extension_View_@controller@action';
+
+ /**
+ * Name of the action method
+ * @var string
+ */
+ protected $actionMethodName = 'indexAction';
+
+ /**
+ * Handles a request. The result output is returned by altering the given response.
+ *
+ * @param TX_EXTMVC_Request $request The request object
+ * @param TX_EXTMVC_Response $response The response, modified by this handler
+ * @return void
+ */
+ public function processRequest(TX_EXTMVC_Request $request, TX_EXTMVC_Response $response) {
+ $this->request = $request;
+ $this->request->setDispatched(TRUE);
+ $this->response = $response;
+
+ $this->actionMethodName = $this->resolveActionMethodName();
+ $this->initializeArguments();
+ $this->mapRequestArgumentsToLocalArguments();
+ if ($this->initializeView) $this->initializeView();
+ $this->initializeAction();
+ $this->callActionMethod();
+ }
+
+ /**
+ * Determines the action method and assures that the method exists.
+ *
+ * @return string The action method name
+ * @throws TX_EXTMVC_Exception_NoSuchAction if the action specified in the request object does not exist (and if there's no default action either).
+ */
+ protected function resolveActionMethodName() {
+ $actionMethodName = $this->request->getControllerActionName() . 'Action';
+ if (!method_exists($this, $actionMethodName)) throw new TX_EXTMVC_Exception_NoSuchAction('An action "' . $actionMethodName . '" does not exist in controller "' . get_class($this) . '".', 1186669086);
+ return $actionMethodName;
+ }
+
+ /**
+ * Returns TRUE if the given action (a name of an action like 'show'; without
+ * trailing 'Action') should be cached, otherwise it returns FALSE.
+ *
+ * @param string $actionName
+ * @return void
+ * @author Jochen Rau <jochen.rau@typoplanet.de>
+ */
+ public function isCachableAction($actionName) {
+ return !in_array($actionName, $this->nonCachableActions);
+ }
+
+ /**
+ * Calls the specified action method and passes the arguments.
+ * If the action returns a string, it is appended to the content in the
+ * response object.
+ *
+ * @param string $actionMethodName Name of the action method
+ * @return void
+ */
+ protected function callActionMethod() {
+ $actionResult = call_user_func_array(array($this, $this->actionMethodName), array());
+ if ($actionResult === NULL && $this->view instanceof TX_EXTMVC_View_ViewInterface) {
+ $this->response->appendContent($this->view->render());
+ } elseif (is_string($actionResult) && strlen($actionResult) > 0) {
+ $this->response->appendContent($actionResult);
+ }
+ }
+
+ /**
+ * Prepares a view for the current action and stores it in $this->view.
+ * By default, this method tries to locate a view with a name matching
+ * the current action.
+ *
+ * @return void
+ */
+ protected function initializeView() {
+ $viewObjectName = ($this->viewObjectName === NULL) ? $this->resolveViewObjectName() : $this->viewObjectName;
+ if (!class_exists($viewObjectName)) $viewObjectName = 'TX_EXTMVC_View_EmptyView';
+
+ $this->view = t3lib_div::makeInstance($viewObjectName);
+ $this->view->setRequest($this->request);
+ }
+
+ /**
+ * Determines the fully qualified view object name.
+ *
+ * @return string The fully qualified view object name
+ */
+ protected function resolveViewObjectName() {
+ $possibleViewName = $this->viewObjectNamePattern;
+ $extensionKey = $this->request->getControllerExtensionKey();
+ $possibleViewName = str_replace('@extension', $extensionKey, $possibleViewName);
+ $possibleViewName = str_replace('@controller', $this->request->getControllerName(), $possibleViewName);
+ $possibleViewName = str_replace('@action', ucfirst($this->request->getControllerActionName()), $possibleViewName);
+ return $possibleViewName;
+ }
+
+ /**
+ * Initializes the controller before invoking an action method.
+ *
+ * Override this method to solve tasks which all actions have in
+ * common.
+ *
+ * @return void
+ */
+ protected function initializeAction() {
+ }
+
+ /**
+ * The default action of this controller.
+ *
+ * This method should always be overridden by the concrete action
+ * controller implementation.
+ *
+ * @return void
+ */
+ protected function indexAction() {
+ return 'No index action has been implemented yet for this controller.';
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A controller argument
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ * @scope prototype
+ */
+class TX_EXTMVC_Controller_Argument {
+
+ /**
+ * Name of this argument
+ * @var string
+ */
+ protected $name = '';
+
+ /**
+ * Short name of this argument
+ * @var string
+ */
+ protected $shortName = NULL;
+
+ /**
+ * Data type of this argument's value
+ * @var string
+ */
+ protected $dataType = 'Text';
+
+ /**
+ * TRUE if this argument is required
+ * @var boolean
+ */
+ protected $isRequired = FALSE;
+
+ /**
+ * Actual value of this argument
+ * @var object
+ */
+ protected $value = NULL;
+
+ /**
+ * The argument is valid
+ * @var boolean
+ */
+ protected $isValid = NULL;
+
+ /**
+ * Any error (TX_EXTMVC_Error_Error) that occured while initializing this argument (e.g. a mapping error)
+ * @var array
+ */
+ protected $errors = array();
+
+ /**
+ * The property validator for this argument
+ * @var TX_EXTMVC_Validation_Validator_ValidatorInterface
+ */
+ protected $validator = NULL;
+
+ /**
+ * The property validator for this arguments datatype
+ * @var TX_EXTMVC_Validation_Validator_ValidatorInterface
+ */
+ // TODO Remove DatatypeValidator
+ protected $datatypeValidator = NULL;
+
+ /**
+ * Uid for the argument, if it has one
+ * @var string
+ */
+ protected $uid = NULL;
+
+ /**
+ * Constructs this controller argument
+ *
+ * @param string $name Name of this argument
+ * @param string $dataType The data type of this argument
+ * @throws InvalidArgumentException if $name is not a string or empty
+ */
+ public function __construct($name, $dataType = 'Text') {
+ if (!is_string($name) || strlen($name) < 1) throw new InvalidArgumentException('$name must be of type string, ' . gettype($name) . ' given.', 1187951688);
+ $this->name = $name;
+ if (is_array($dataType)) {
+ $this->setNewValidatorChain($dataType);
+ } else {
+ $this->setDataType($dataType);
+ }
+ }
+
+ /**
+ * Returns the name of this argument
+ *
+ * @return string This argument's name
+ */
+ public function getName() {
+ return $this->name;
+ }
+
+ /**
+ * Sets the short name of this argument.
+ *
+ * @param string $shortName A "short name" - a single character
+ * @return TX_EXTMVC_Controller_Argument $this
+ * @throws InvalidArgumentException if $shortName is not a character
+ */
+ public function setShortName($shortName) {
+ if ($shortName !== NULL && (!is_string($shortName) || strlen($shortName) != 1)) throw new InvalidArgumentException('$shortName must be a single character or NULL', 1195824959);
+ $this->shortName = $shortName;
+ return $this;
+ }
+
+ /**
+ * Returns the short name of this argument
+ *
+ * @return string This argument's short name
+ */
+ public function getShortName() {
+ return $this->shortName;
+ }
+
+ /**
+ * Sets the data type of this argument's value
+ *
+ * @param string $dataType: Name of the data type
+ * @return TX_EXTMVC_Controller_Argument $this
+ */
+ public function setDataType($dataType) {
+ $this->dataType = ($dataType != '' ? $dataType : 'Text');
+ // TODO Make validator path and class names configurable
+ $dataTypeValidatorClassName = 'TX_EXTMVC_Validation_Validator_' . $this->dataType;
+ $classFilePathAndName = t3lib_extMgm::extPath('extmvc') . 'Classes/Validation/Validator/' . $this->dataType . '.php';
+ if (isset($classFilePathAndName) && file_exists($classFilePathAndName)) {
+ require_once($classFilePathAndName);
+ $this->datatypeValidator = t3lib_div::makeInstance($dataTypeValidatorClassName);
+ }
+ return $this;
+ }
+
+ /**
+ * Returns the data type of this argument's value
+ *
+ * @return string The data type
+ */
+ public function getDataType() {
+ return $this->dataType;
+ }
+
+ /**
+ * Marks this argument to be required
+ *
+ * @param boolean $required TRUE if this argument should be required
+ * @return TX_EXTMVC_Controller_Argument $this
+ */
+ public function setRequired($required) {
+ $this->isRequired = $required;
+ return $this;
+ }
+
+ /**
+ * Returns TRUE if this argument is required
+ *
+ * @return boolean TRUE if this argument is required
+ */
+ public function isRequired() {
+ return $this->isRequired;
+ }
+
+ /**
+ * Sets the value of this argument.
+ *
+ * @param mixed $value: The value of this argument
+ * @return TX_EXTMVC_Controller_Argument $this
+ * @throws TX_EXTMVC_Exception_InvalidArgumentValue if the argument is not a valid object of type $dataType
+ */
+ public function setValue($value) {
+ if ($this->isValidValueForThisArgument($value)) {
+ $this->value = $value;
+ }
+ return $this;
+ }
+
+ /**
+ * Returns the value of this argument
+ *
+ * @return object The value of this argument - if none was set, NULL is returned
+ */
+ public function getValue() {
+ return $this->value;
+ }
+
+ /**
+ * Checks if this argument has a value set.
+ *
+ * @return boolean TRUE if a value was set, otherwise FALSE
+ */
+ public function isValue() {
+ return $this->value !== NULL;
+ }
+
+ /**
+ * undocumented function
+ *
+ * @param string $value
+ * @return boolean TRUE if the value is valid for this argument, otherwise FALSE
+ */
+ protected function isValidValueForThisArgument($value) {
+ $isValid = TRUE;
+ $validatorErrors = t3lib_div::makeInstance('TX_EXTMVC_Validation_Errors');
+ // TODO use only Validator; do not distinguish between Validator and DatatypeValidator
+ if ($this->getValidator() !== NULL) {
+ $isValid &= $this->getValidator()->isValid($value, $validatorErrors);
+ } elseif ($this->getDatatypeValidator() !== NULL) {
+ $isValid = $this->getDatatypeValidator()->isValid($value, $validatorErrors);
+ } else {
+ throw new TX_EXTMVC_Validation_Exception_NoValidatorFound('No appropriate validator for the argument "' . $this->getName() . '" was found.', 1235748909);
+ }
+ if (!$isValid) {
+ foreach ($validatorErrors as $error) {
+ $this->addError($error);
+ }
+ }
+ $this->isValid = $isValid;
+ return (boolean)$isValid;
+ }
+
+ /**
+ * Returns TRUE when the argument is valid
+ *
+ * @return boolean TRUE if the argument is valid
+ */
+ public function isValid() {
+ return $this->isValid;
+ }
+
+ /**
+ * Add an initialization error (e.g. a mapping error)
+ *
+ * @param string An error text
+ * @return void
+ */
+ public function addError($error) {
+ $this->errors[] = $error;
+ }
+
+ /**
+ * Get all initialization errors
+ *
+ * @return array An array containing TX_EXTMVC_Error_Error objects
+ * @see addError(TX_EXTMVC_Error_Error $error)
+ */
+ public function getErrors() {
+ return $this->errors;
+ }
+
+ /**
+ * Set an additional validator
+ *
+ * @param string Class name of a validator
+ * @return TX_EXTMVC_MVC_Controller_Argument Returns $this (used for fluent interface)
+ */
+ public function setValidator($className) {
+ $this->validator = t3lib_div::makeInstance($className);
+ return $this;
+ }
+
+ /**
+ * Returns the set validator
+ *
+ * @return TX_EXTMVC_Validation_Validator_ValidatorInterface The set validator, NULL if none was set
+ */
+ public function getValidator() {
+ return $this->validator;
+ }
+
+ /**
+ * Returns the set datatype validator
+ *
+ * @return TX_EXTMVC_Validation_Validator_ValidatorInterface The set datatype validator
+ */
+ public function getDatatypeValidator() {
+ return $this->datatypeValidator;
+ }
+
+ /**
+ * Create and set a validator chain
+ *
+ * @param array Object names of the validators
+ * @return TX_EXTMVC_MVC_Controller_Argument Returns $this (used for fluent interface)
+ */
+ public function setNewValidatorChain(array $validators) {
+ $this->validator = t3lib_div::makeInstance('TX_EXTMVC_Validation_Validator_ChainValidator');
+ foreach ($validators as $validator) {
+ if (is_array($validator)) {
+ $objectName = 'TX_EXTMVC_Validation_Validator_' . $validator[0];
+ $this->validator->addValidator(new $objectName);
+ } else {
+ $objectName = 'TX_EXTMVC_Validation_Validator_' . $validator;
+ $this->validator->addValidator(t3lib_div::makeInstance($objectName));
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set the uid for the argument.
+ *
+ * @param string $uid The uid for the argument.
+ * @return void
+ */
+ public function setUid($uid) {
+ $this->uid = $uid;
+ }
+
+ /**
+ * Get the uid of the argument, if it has one.
+ *
+ * @return string Uid of the argument. If none set, returns NULL.
+ */
+ public function getUid() {
+ return $this->uid;
+ }
+
+ /**
+ * Returns a string representation of this argument's value
+ *
+ * @return string
+ */
+ public function __toString() {
+ return (string)$this->value;
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A composite of controller arguments
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ * @scope prototype
+ */
+class TX_EXTMVC_Controller_Arguments extends ArrayObject {
+
+ /**
+ * @var array Names of the arguments contained by this object
+ */
+ protected $argumentNames = array();
+
+ /**
+ * Adds or replaces the argument specified by $value. The argument's name is taken from the
+ * argument object itself, therefore the $offset does not have any meaning in this context.
+ *
+ * @param mixed $offset Offset - not used here
+ * @param mixed $value The argument
+ * @return void
+ * @throws InvalidArgumentException if the argument is not a valid Controller Argument object
+ */
+ public function offsetSet($offset, $value) {
+ if (!$value instanceof TX_EXTMVC_Controller_Argument) throw new InvalidArgumentException('Controller arguments must be valid TX_EXTMVC_Controller_Argument objects.', 1187953786);
+
+ $argumentName = $value->getName();
+ parent::offsetSet($argumentName, $value);
+ $this->argumentNames[$argumentName] = TRUE;
+ }
+
+ /**
+ * Sets an argument, aliased to offsetSet()
+ *
+ * @param mixed $value The value
+ * @return void
+ * @throws InvalidArgumentException if the argument is not a valid Controller Argument object
+ */
+ public function append($value) {
+ if (!$value instanceof TX_EXTMVC_Controller_Argument) throw new InvalidArgumentException('Controller arguments must be valid TX_EXTMVC_Controller_Argument objects.', 1187953786);
+ $this->offsetSet(NULL, $value);
+ }
+
+ /**
+ * Unsets an argument
+ *
+ * @param mixed $offset Offset
+ * @return void
+ */
+ public function offsetUnset($offset) {
+ $translatedOffset = $this->translateToLongArgumentName($offset);
+ parent::offsetUnset($translatedOffset);
+
+ unset($this->argumentNames[$translatedOffset]);
+ if ($offset != $translatedOffset) {
+ unset($this->argumentShortNames[$offset]);
+ }
+ }
+
+ /**
+ * Returns whether the requested index exists
+ *
+ * @param mixed $offset Offset
+ * @return boolean
+ */
+ public function offsetExists($offset) {
+ $translatedOffset = $this->translateToLongArgumentName($offset);
+ return parent::offsetExists($translatedOffset);
+ }
+
+ /**
+ * Returns the value at the specified index
+ *
+ * @param mixed $offset Offset
+ * @return TX_EXTMVC_Controller_Argument The requested argument object
+ * @throws TX_EXTMVC_Exception_NoSuchArgument if the argument does not exist
+ */
+ public function offsetGet($offset) {
+ $translatedOffset = $this->translateToLongArgumentName($offset);
+ if ($translatedOffset === '') throw new TX_EXTMVC_Exception_NoSuchArgument('The argument "' . $offset . '" does not exist.', 1216909923);
+ return parent::offsetGet($translatedOffset);
+ }
+
+ /**
+ * Creates, adds and returns a new controller argument to this composite object.
+ * If an argument with the same name exists already, it will be replaced by the
+ * new argument object.
+ *
+ * @param string $name Name of the argument
+ * @param string $dataType Name of one of the built-in data types
+ * @param boolean $isRequired TRUE if this argument should be marked as required
+ * @return TX_EXTMVC_Controller_Argument The new argument
+ */
+ public function addNewArgument($name, $dataType = 'Text', $isRequired = FALSE) {
+ $argument = new TX_EXTMVC_Controller_Argument($name, $dataType);
+ $argument->setRequired($isRequired);
+ $this->addArgument($argument);
+ return $argument;
+ }
+
+ /**
+ * Adds the specified controller argument to this composite object.
+ * If an argument with the same name exists already, it will be replaced by the
+ * new argument object.
+ *
+ * Note that the argument will be cloned, not referenced.
+ *
+ * @param TX_EXTMVC_Controller_Argument $argument The argument to add
+ * @return void
+ */
+ public function addArgument(TX_EXTMVC_Controller_Argument $argument) {
+ $this->offsetSet(NULL, $argument);
+ }
+
+ /**
+ * Returns an argument specified by name
+ *
+ * @param string $argumentName Name of the argument to retrieve
+ * @return TX_EXTMVC_Controller_Argument
+ * @throws TX_EXTMVC_Exception_NoSuchArgument
+ */
+ public function getArgument($argumentName) {
+ if (!$this->offsetExists($argumentName)) throw new TX_EXTMVC_Exception_NoSuchArgument('An argument "' . $argumentName . '" does not exist.', 1195815178);
+ return $this->offsetGet($argumentName);
+ }
+
+ /**
+ * Checks if an argument with the specified name exists
+ *
+ * @param string $argumentName Name of the argument to check for
+ * @return boolean TRUE if such an argument exists, otherwise FALSE
+ * @see offsetExists()
+ */
+ public function hasArgument($argumentName) {
+ return $this->offsetExists($argumentName);
+ }
+
+ /**
+ * Returns the names of all arguments contained in this object
+ *
+ * @return array Argument names
+ */
+ public function getArgumentNames() {
+ return array_keys($this->argumentNames);
+ }
+
+ /**
+ * Returns the short names of all arguments contained in this object that have one.
+ *
+ * @return array Argument short names
+ */
+ public function getArgumentShortNames() {
+ $argumentShortNames = array();
+ foreach ($this as $argument) {
+ $argumentShortNames[$argument->getShortName()] = TRUE;
+ }
+ return array_keys($argumentShortNames);
+ }
+
+ /**
+ * Magic setter method for the argument values. Each argument
+ * value can be set by just calling the setArgumentName() method.
+ *
+ * @param string $methodName Name of the method
+ * @param array $arguments Method arguments
+ * @return void
+ */
+ public function __call($methodName, array $arguments) {
+ if (substr($methodName, 0, 3) !== 'set') throw new LogicException('Unknown method "' . $methodName . '".', 1210858451);
+
+ $firstLowerCaseArgumentName = $this->translateToLongArgumentName(strtolower($methodName{3}) . substr($methodName, 4));
+ $firstUpperCaseArgumentName = $this->translateToLongArgumentName(ucfirst(substr($methodName, 3)));
+
+ if (in_array($firstLowerCaseArgumentName, $this->getArgumentNames())) {
+ $argument = parent::offsetGet($firstLowerCaseArgumentName);
+ $argument->setValue($arguments[0]);
+ } elseif (in_array($firstUpperCaseArgumentName, $this->getArgumentNames())) {
+ $argument = parent::offsetGet($firstUpperCaseArgumentName);
+ $argument->setValue($arguments[0]);
+ }
+ }
+
+ /**
+ * Translates a short argument name to its corresponding long name. If the
+ * specified argument name is a real argument name already, it will be returned again.
+ *
+ * If an argument with the specified name or short name does not exist, an empty
+ * string is returned.
+ *
+ * @param string argument name
+ * @return string long argument name or empty string
+ */
+ protected function translateToLongArgumentName($argumentName) {
+
+ if (in_array($argumentName, $this->getArgumentNames())) return $argumentName;
+
+ foreach ($this as $argument) {
+ if ($argumentName === $argument->getShortName()) return $argument->getName();
+ }
+ return '';
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * Interface for controllers
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+interface TX_EXTMVC_Controller_ControllerInterface {
+
+ /**
+ * Sets / injects the settings of the package this controller belongs to.
+ *
+ * @param array $settings Settings container of the current package
+ * @return void
+ */
+ public function injectSettings(array $settings);
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A Special Case of a Controller: If no controller could be resolved or no
+ * controller has been specified in the request, this controller is chosen.
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Controller_DefaultController extends TX_EXTMVC_Controller_ActionController {
+
+ /**
+ * @var TX_EXTMVC_View_DefaultView
+ */
+ protected $defaultView;
+
+ /**
+ * Injects the default view
+ *
+ * @param TX_EXTMVC_View_DefaultView $defaultView The default view
+ * @return void
+ */
+ public function injectDefaultView(TX_EXTMVC_View_DefaultView $defaultView) {
+ $this->defaultView = $defaultView;
+ }
+
+ /**
+ * Processes a generic request and returns a response
+ *
+ * @param TX_EXTMVC_Request $request: The request
+ * @param TX_EXTMVC_Response $response: The response
+ */
+ public function processRequest(TX_EXTMVC_Request $request, TX_EXTMVC_Response $response) {
+ $request->setDispatched(TRUE);
+ switch (get_class($request)) {
+ case 'TX_EXTMVC_Web_Request' :
+ $this->processWebRequest($request, $response);
+ break;
+ default :
+ $response->setContent(
+ "\nWelcome to TYPO3!\n\n" .
+ "This is the default view of the TYPO3 MVC object. You see this message because no \n" .
+ "other view is available. Please refer to the Developer's Guide for more information \n" .
+ "how to create and configure one.\n\n" .
+ "Have fun! The TYPO3 Development Team\n"
+ );
+ }
+ }
+
+ /**
+ * Processes a web request and returns a response
+ *
+ * @param TX_EXTMVC_Web_Request $request: The request
+ * @param TX_EXTMVC_Web_Response $response: The response
+ */
+ protected function processWebRequest(TX_EXTMVC_Web_Request $request, TX_EXTMVC_Web_Response $response) {
+ $this->defaultView->setRequest($request);
+ $response->setContent($this->defaultView->render());
+ }
+
+}
+
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An abstract base class for Controllers
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-abstract class TX_EXTMVC_Controller_AbstractController implements TX_EXTMVC_Controller_ControllerInterface {
-
- /**
- * @var string Key of the extension this controller belongs to
- */
- protected $extensionKey;
-
- /**
- * Contains the settings of the current extension
- *
- * @var array
- */
- protected $settings;
-
- /**
- * @var TX_EXTMVC_Request The current request
- */
- protected $request;
-
- /**
- * @var TX_EXTMVC_Response The response which will be returned by this action controller
- */
- protected $response;
-
- /**
- * @var TX_EXTMVC_Controller_Arguments Arguments passed to the controller
- */
- protected $arguments;
-
- /**
- * Actions that schould not be cached (changes the invocated dispatcher to a USER_INT cObject)
- * @var array
- */
- protected $nonCachableActions = array();
-
- /**
- * Constructs the controller.
- *
- * @param F3_FLOW3_Object_FactoryInterface $objectFactory A reference to the Object Factory
- * @param F3_FLOW3_Package_ManagerInterface $packageManager A reference to the Package Manager
- */
- public function __construct() {
- // SK: Set $this->extensionKey, could be done the same way as it is done in Fluid
- $this->arguments = t3lib_div::makeInstance('TX_EXTMVC_Controller_Arguments');
- }
-
- /**
- * Injects the settings of the extension.
- *
- * @param array $settings Settings container of the current extension
- * @return void
- */
- public function injectSettings(array $settings) {
- $this->settings = $settings;
- }
-
- /**
- * Processes a general request. The result can be returned by altering the given response.
- *
- * @param TX_EXTMVC_Request $request The request object
- * @param TX_EXTMVC_Response $response The response, modified by this handler
- * @return void
- * @throws TX_EXTMVC_Exception_UnsupportedRequestType if the controller doesn't support the current request type
- */
- public function processRequest(TX_EXTMVC_Request $request, TX_EXTMVC_Response $response) {
- $this->request = $request;
- $this->request->setDispatched(TRUE);
- $this->response = $response;
-
- $this->initializeArguments();
- $this->mapRequestArgumentsToLocalArguments();
- }
-
- /**
- * Initializes (registers / defines) arguments of this controller.
- *
- * Override this method to add arguments which can later be accessed
- * by the action methods.
- *
- * @return void
- */
- protected function initializeArguments() {
- }
-
- /**
- * Forwards the request to another controller.
- *
- * @return void
- * @throws TX_EXTMVC_Exception_StopAction
- */
- public function forward($actionName, $controllerName = NULL, $extensionKey = NULL, TX_EXTMVC_Controller_Arguments $arguments = NULL) {
- $this->request->setDispatched(FALSE);
- $this->request->setControllerActionName($actionName);
- if ($controllerName !== NULL) $this->request->setControllerName($controllerName);
- if ($extensionKey !== NULL) $this->request->setControllerExtensionKey($extensionKey);
- if ($arguments !== NULL) $this->request->setArguments($arguments);
- throw new TX_EXTMVC_Exception_StopAction();
- }
-
- /**
- * Redirects the web request to another uri.
- *
- * NOTE: This method only supports web requests and will thrown an exception if used with other request types.
- *
- * @param mixed $uri Either a string representation of a URI or a F3_FLOW3_Property_DataType_URI object
- * @param integer $delay (optional) The delay in seconds. Default is no delay.
- * @param integer $statusCode (optional) The HTTP status code for the redirect. Default is "303 See Other"
- * @throws TX_EXTMVC_Exception_UnsupportedRequestType If the request is not a web request
- * @throws TX_EXTMVC_Exception_StopAction
- */
- public function redirect($uri, $delay = 0, $statusCode = 303) {
- if (!$this->request instanceof TX_EXTMVC_Web_Request) throw new TX_EXTMVC_Exception_UnsupportedRequestType('redirect() only supports web requests.', 1220539734);
-
- $escapedUri = htmlentities($uri, ENT_QUOTES, 'utf-8');
- $this->response->setContent('<html><head><meta http-equiv="refresh" content="' . intval($delay) . ';url=' . $escapedUri . '"/></head></html>');
- $this->response->setStatus($statusCode);
- throw new TX_EXTMVC_Exception_StopAction();
- }
-
- /**
- * Sends the specified HTTP status immediately.
- *
- * NOTE: This method only supports web requests and will thrown an exception if used with other request types.
- *
- * @param integer $statusCode The HTTP status code
- * @param string $statusMessage A custom HTTP status message
- * @param string $content Body content which further explains the status
- * @throws TX_EXTMVC_Exception_UnsupportedRequestType If the request is not a web request
- * @throws TX_EXTMVC_Exception_StopAction
- */
- public function throwStatus($statusCode, $statusMessage = NULL, $content = NULL) {
- if (!$this->request instanceof TX_EXTMVC_Web_Request) throw new TX_EXTMVC_Exception_UnsupportedRequestType('throwStatus() only supports web requests.', 1220539739);
-
- $this->response->setStatus($statusCode, $statusMessage);
- if ($content === NULL) $content = $this->response->getStatus();
- $this->response->setContent($content);
- throw new TX_EXTMVC_Exception_StopAction();
- }
-
- /**
- * Maps arguments delivered by the request object to the local controller arguments.
- *
- * @return void
- */
- protected function mapRequestArgumentsToLocalArguments() {
- $requestArguments = $this->request->getArguments();
- foreach ($this->arguments as $argument) {
- $argumentName = $argument->getName();
- $argumentShortName = $argument->getShortName();
- if (array_key_exists($argumentName, $requestArguments)) {
- $argument->setValue($requestArguments[$argumentName]);
- } elseif ($argumentShortName !== NULL && array_key_exists($argumentShortName, $requestArguments)) {
- $argument->setValue($requestArguments[$argumentShortName]);
- }
- }
- }
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A multi action controller
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-// SK: fill initializeArguments() so it parses the arguments for a given view. We need to discuss how this parsing can be
-// SK: done effectively.
-class TX_EXTMVC_Controller_ActionController extends TX_EXTMVC_Controller_AbstractController {
-
- /**
- * @var boolean If initializeView() should be called on an action invocation.
- */
- protected $initializeView = TRUE;
-
- /**
- * @var TX_EXTMVC_View_AbstractView By default a view with the same name as the current action is provided. Contains NULL if none was found.
- */
- protected $view = NULL;
-
- /**
- * By default a matching view will be resolved. If this property is set, automatic resolving is disabled and the specified object is used instead.
- * @var string
- */
- // SK: rename to defaultViewObjectName. Should only be used if no custom view could be found.
- // SK: How do we implement this with TYPO3 v4? How can we check if a class exists?
- // SK: Changing the logic here makes it possible to write specific views for a given action, and use the default view for all other actions.
- protected $viewObjectName = NULL;
-
- /**
- * Pattern after which the view object name is built
- *
- * @var string
- */
- // SK: Decision: Do we support "format"?
- protected $viewObjectNamePattern = 'TX_@extension_View_@controller@action';
-
- /**
- * Name of the action method
- * @var string
- */
- protected $actionMethodName = 'indexAction';
-
- /**
- * Handles a request. The result output is returned by altering the given response.
- *
- * @param TX_EXTMVC_Request $request The request object
- * @param TX_EXTMVC_Response $response The response, modified by this handler
- * @return void
- */
- public function processRequest(TX_EXTMVC_Request $request, TX_EXTMVC_Response $response) {
- $this->request = $request;
- $this->request->setDispatched(TRUE);
- $this->response = $response;
-
- $this->actionMethodName = $this->resolveActionMethodName();
- $this->initializeArguments();
- $this->mapRequestArgumentsToLocalArguments();
- if ($this->initializeView) $this->initializeView();
- $this->initializeAction();
- $this->callActionMethod();
- }
-
- /**
- * Determines the action method and assures that the method exists.
- *
- * @return string The action method name
- * @throws TX_EXTMVC_Exception_NoSuchAction if the action specified in the request object does not exist (and if there's no default action either).
- */
- protected function resolveActionMethodName() {
- $actionMethodName = $this->request->getControllerActionName() . 'Action';
- if (!method_exists($this, $actionMethodName)) throw new TX_EXTMVC_Exception_NoSuchAction('An action "' . $actionMethodName . '" does not exist in controller "' . get_class($this) . '".', 1186669086);
- return $actionMethodName;
- }
-
- /**
- * Returns TRUE if the given action (a name of an action like 'show'; without
- * trailing 'Action') should be cached, otherwise it returns FALSE.
- *
- * @param string $actionName
- * @return void
- * @author Jochen Rau <jochen.rau@typoplanet.de>
- */
- public function isCachableAction($actionName) {
- return !in_array($actionName, $this->nonCachableActions);
- }
-
- /**
- * Calls the specified action method and passes the arguments.
- * If the action returns a string, it is appended to the content in the
- * response object.
- *
- * @param string $actionMethodName Name of the action method
- * @return void
- */
- protected function callActionMethod() {
- $actionResult = call_user_func_array(array($this, $this->actionMethodName), array());
- if ($actionResult === NULL && $this->view instanceof TX_EXTMVC_View_ViewInterface) {
- $this->response->appendContent($this->view->render());
- } elseif (is_string($actionResult) && strlen($actionResult) > 0) {
- $this->response->appendContent($actionResult);
- }
- }
-
- /**
- * Prepares a view for the current action and stores it in $this->view.
- * By default, this method tries to locate a view with a name matching
- * the current action.
- *
- * @return void
- */
- protected function initializeView() {
- $viewObjectName = ($this->viewObjectName === NULL) ? $this->resolveViewObjectName() : $this->viewObjectName;
- if (!class_exists($viewObjectName)) $viewObjectName = 'TX_EXTMVC_View_EmptyView';
-
- $this->view = t3lib_div::makeInstance($viewObjectName);
- $this->view->setRequest($this->request);
- }
-
- /**
- * Determines the fully qualified view object name.
- *
- * @return string The fully qualified view object name
- */
- protected function resolveViewObjectName() {
- $possibleViewName = $this->viewObjectNamePattern;
- $extensionKey = $this->request->getControllerExtensionKey();
- $possibleViewName = str_replace('@extension', $extensionKey, $possibleViewName);
- $possibleViewName = str_replace('@controller', $this->request->getControllerName(), $possibleViewName);
- $possibleViewName = str_replace('@action', ucfirst($this->request->getControllerActionName()), $possibleViewName);
- return $possibleViewName;
- }
-
- /**
- * Initializes the controller before invoking an action method.
- *
- * Override this method to solve tasks which all actions have in
- * common.
- *
- * @return void
- */
- protected function initializeAction() {
- }
-
- /**
- * The default action of this controller.
- *
- * This method should always be overridden by the concrete action
- * controller implementation.
- *
- * @return void
- */
- protected function indexAction() {
- return 'No index action has been implemented yet for this controller.';
- }
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A controller argument
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- * @scope prototype
- */
-class TX_EXTMVC_Controller_Argument {
-
- /**
- * Name of this argument
- * @var string
- */
- protected $name = '';
-
- /**
- * Short name of this argument
- * @var string
- */
- protected $shortName = NULL;
-
- /**
- * Data type of this argument's value
- * @var string
- */
- protected $dataType = 'Text';
-
- /**
- * TRUE if this argument is required
- * @var boolean
- */
- protected $isRequired = FALSE;
-
- /**
- * Actual value of this argument
- * @var object
- */
- protected $value = NULL;
-
- /**
- * The argument is valid
- * @var boolean
- */
- protected $isValid = NULL;
-
- /**
- * Any error (TX_EXTMVC_Error_Error) that occured while initializing this argument (e.g. a mapping error)
- * @var array
- */
- protected $errors = array();
-
- /**
- * The property validator for this argument
- * @var TX_EXTMVC_Validation_Validator_ValidatorInterface
- */
- protected $validator = NULL;
-
- /**
- * The property validator for this arguments datatype
- * @var TX_EXTMVC_Validation_Validator_ValidatorInterface
- */
- // TODO Remove DatatypeValidator
- protected $datatypeValidator = NULL;
-
- /**
- * Uid for the argument, if it has one
- * @var string
- */
- protected $uid = NULL;
-
- /**
- * Constructs this controller argument
- *
- * @param string $name Name of this argument
- * @param string $dataType The data type of this argument
- * @throws InvalidArgumentException if $name is not a string or empty
- */
- public function __construct($name, $dataType = 'Text') {
- if (!is_string($name) || strlen($name) < 1) throw new InvalidArgumentException('$name must be of type string, ' . gettype($name) . ' given.', 1187951688);
- $this->name = $name;
- if (is_array($dataType)) {
- $this->setNewValidatorChain($dataType);
- } else {
- $this->setDataType($dataType);
- }
- }
-
- /**
- * Returns the name of this argument
- *
- * @return string This argument's name
- */
- public function getName() {
- return $this->name;
- }
-
- /**
- * Sets the short name of this argument.
- *
- * @param string $shortName A "short name" - a single character
- * @return TX_EXTMVC_Controller_Argument $this
- * @throws InvalidArgumentException if $shortName is not a character
- */
- public function setShortName($shortName) {
- if ($shortName !== NULL && (!is_string($shortName) || strlen($shortName) != 1)) throw new InvalidArgumentException('$shortName must be a single character or NULL', 1195824959);
- $this->shortName = $shortName;
- return $this;
- }
-
- /**
- * Returns the short name of this argument
- *
- * @return string This argument's short name
- */
- public function getShortName() {
- return $this->shortName;
- }
-
- /**
- * Sets the data type of this argument's value
- *
- * @param string $dataType: Name of the data type
- * @return TX_EXTMVC_Controller_Argument $this
- */
- public function setDataType($dataType) {
- $this->dataType = ($dataType != '' ? $dataType : 'Text');
- // TODO Make validator path and class names configurable
- $dataTypeValidatorClassName = 'TX_EXTMVC_Validation_Validator_' . $this->dataType;
- $classFilePathAndName = t3lib_extMgm::extPath('extmvc') . 'Classes/Validation/Validator/' . $dataTypeValidatorClassName . '.php';
- if (isset($classFilePathAndName) && file_exists($classFilePathAndName)) {
- require_once($classFilePathAndName);
- $this->datatypeValidator = t3lib_div::makeInstance($dataTypeValidatorClassName);
- }
- return $this;
- }
-
- /**
- * Returns the data type of this argument's value
- *
- * @return string The data type
- */
- public function getDataType() {
- return $this->dataType;
- }
-
- /**
- * Marks this argument to be required
- *
- * @param boolean $required TRUE if this argument should be required
- * @return TX_EXTMVC_Controller_Argument $this
- */
- public function setRequired($required) {
- $this->isRequired = $required;
- return $this;
- }
-
- /**
- * Returns TRUE if this argument is required
- *
- * @return boolean TRUE if this argument is required
- */
- public function isRequired() {
- return $this->isRequired;
- }
-
- /**
- * Sets the value of this argument.
- *
- * @param mixed $value: The value of this argument
- * @return TX_EXTMVC_Controller_Argument $this
- * @throws TX_EXTMVC_Exception_InvalidArgumentValue if the argument is not a valid object of type $dataType
- */
- public function setValue($value) {
- if ($this->isValidValueForThisArgument($value)) {
- $this->value = $value;
- }
- return $this;
- }
-
- /**
- * Returns the value of this argument
- *
- * @return object The value of this argument - if none was set, NULL is returned
- */
- public function getValue() {
- return $this->value;
- }
-
- /**
- * Checks if this argument has a value set.
- *
- * @return boolean TRUE if a value was set, otherwise FALSE
- */
- public function isValue() {
- return $this->value !== NULL;
- }
-
- /**
- * undocumented function
- *
- * @param string $value
- * @return boolean TRUE if the value is valid for this argument, otherwise FALSE
- */
- protected function isValidValueForThisArgument($value) {
- $isValid = TRUE;
- $validatorErrors = t3lib_div::makeInstance('TX_EXTMVC_Validation_Errors');
- if ($this->getValidator() !== NULL) {
- $isValid &= $this->getValidator()->isValid($value, $validatorErrors);
- } elseif ($this->getDatatypeValidator() !== NULL) {
- $isValid = $this->getDatatypeValidator()->isValid($value, $validatorErrors);
- } else {
- throw new TX_EXTMVC_Validation_NoValidatorFound('No appropriate validator for the argument "' . $this->getName() . '" was found.', 1235748909);
- }
- if (!$isValid) {
- foreach ($validatorErrors as $error) {
- $this->addError($error);
- }
- }
- $this->isValid = $isValid;
- return (boolean)$isValid;
- }
-
- /**
- * Returns TRUE when the argument is valid
- *
- * @return boolean TRUE if the argument is valid
- */
- public function isValid() {
- return $this->isValid;
- }
-
- /**
- * Add an initialization error (e.g. a mapping error)
- *
- * @param string An error text
- * @return void
- */
- public function addError($error) {
- $this->errors[] = $error;
- }
-
- /**
- * Get all initialization errors
- *
- * @return array An array containing TX_EXTMVC_Error_Error objects
- * @see addError(TX_EXTMVC_Error_Error $error)
- */
- public function getErrors() {
- return $this->errors;
- }
-
- /**
- * Set an additional validator
- *
- * @param string Class name of a validator
- * @return TX_EXTMVC_MVC_Controller_Argument Returns $this (used for fluent interface)
- */
- public function setValidator($className) {
- $this->validator = t3lib_div::makeInstance($className);
- return $this;
- }
-
- /**
- * Returns the set validator
- *
- * @return TX_EXTMVC_Validation_Validator_ValidatorInterface The set validator, NULL if none was set
- */
- public function getValidator() {
- return $this->validator;
- }
-
- /**
- * Returns the set datatype validator
- *
- * @return TX_EXTMVC_Validation_Validator_ValidatorInterface The set datatype validator
- */
- public function getDatatypeValidator() {
- return $this->datatypeValidator;
- }
-
- /**
- * Create and set a validator chain
- *
- * @param array Object names of the validators
- * @return TX_EXTMVC_MVC_Controller_Argument Returns $this (used for fluent interface)
- */
- public function setNewValidatorChain(array $validators) {
- $this->validator = t3lib_div::makeInstance('TX_EXTMVC_Validation_Validator_ChainValidator');
- foreach ($validators as $validator) {
- if (is_array($validator)) {
- $objectName = 'TX_EXTMVC_Validation_Validator_' . $validator[0];
- $this->validator->addValidator(new $objectName);
- } else {
- $objectName = 'TX_EXTMVC_Validation_Validator_' . $validator;
- $this->validator->addValidator(t3lib_div::makeInstance($objectName));
- }
- }
- return $this;
- }
-
- /**
- * Set the uid for the argument.
- *
- * @param string $uid The uid for the argument.
- * @return void
- */
- public function setUid($uid) {
- $this->uid = $uid;
- }
-
- /**
- * Get the uid of the argument, if it has one.
- *
- * @return string Uid of the argument. If none set, returns NULL.
- */
- public function getUid() {
- return $this->uid;
- }
-
- /**
- * Returns a string representation of this argument's value
- *
- * @return string
- */
- public function __toString() {
- return (string)$this->value;
- }
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A composite of controller arguments
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- * @scope prototype
- */
-class TX_EXTMVC_Controller_Arguments extends ArrayObject {
-
- /**
- * @var array Names of the arguments contained by this object
- */
- protected $argumentNames = array();
-
- /**
- * Adds or replaces the argument specified by $value. The argument's name is taken from the
- * argument object itself, therefore the $offset does not have any meaning in this context.
- *
- * @param mixed $offset Offset - not used here
- * @param mixed $value The argument
- * @return void
- * @throws InvalidArgumentException if the argument is not a valid Controller Argument object
- */
- public function offsetSet($offset, $value) {
- if (!$value instanceof TX_EXTMVC_Controller_Argument) throw new InvalidArgumentException('Controller arguments must be valid TX_EXTMVC_Controller_Argument objects.', 1187953786);
-
- $argumentName = $value->getName();
- parent::offsetSet($argumentName, $value);
- $this->argumentNames[$argumentName] = TRUE;
- }
-
- /**
- * Sets an argument, aliased to offsetSet()
- *
- * @param mixed $value The value
- * @return void
- * @throws InvalidArgumentException if the argument is not a valid Controller Argument object
- */
- public function append($value) {
- if (!$value instanceof TX_EXTMVC_Controller_Argument) throw new InvalidArgumentException('Controller arguments must be valid TX_EXTMVC_Controller_Argument objects.', 1187953786);
- $this->offsetSet(NULL, $value);
- }
-
- /**
- * Unsets an argument
- *
- * @param mixed $offset Offset
- * @return void
- */
- public function offsetUnset($offset) {
- $translatedOffset = $this->translateToLongArgumentName($offset);
- parent::offsetUnset($translatedOffset);
-
- unset($this->argumentNames[$translatedOffset]);
- if ($offset != $translatedOffset) {
- unset($this->argumentShortNames[$offset]);
- }
- }
-
- /**
- * Returns whether the requested index exists
- *
- * @param mixed $offset Offset
- * @return boolean
- */
- public function offsetExists($offset) {
- $translatedOffset = $this->translateToLongArgumentName($offset);
- return parent::offsetExists($translatedOffset);
- }
-
- /**
- * Returns the value at the specified index
- *
- * @param mixed $offset Offset
- * @return TX_EXTMVC_Controller_Argument The requested argument object
- * @throws TX_EXTMVC_Exception_NoSuchArgument if the argument does not exist
- */
- public function offsetGet($offset) {
- $translatedOffset = $this->translateToLongArgumentName($offset);
- if ($translatedOffset === '') throw new TX_EXTMVC_Exception_NoSuchArgument('The argument "' . $offset . '" does not exist.', 1216909923);
- return parent::offsetGet($translatedOffset);
- }
-
- /**
- * Creates, adds and returns a new controller argument to this composite object.
- * If an argument with the same name exists already, it will be replaced by the
- * new argument object.
- *
- * @param string $name Name of the argument
- * @param string $dataType Name of one of the built-in data types
- * @param boolean $isRequired TRUE if this argument should be marked as required
- * @return TX_EXTMVC_Controller_Argument The new argument
- */
- public function addNewArgument($name, $dataType = 'Text', $isRequired = FALSE) {
- $argument = new TX_EXTMVC_Controller_Argument($name, $dataType);
- $argument->setRequired($isRequired);
- $this->addArgument($argument);
- return $argument;
- }
-
- /**
- * Adds the specified controller argument to this composite object.
- * If an argument with the same name exists already, it will be replaced by the
- * new argument object.
- *
- * Note that the argument will be cloned, not referenced.
- *
- * @param TX_EXTMVC_Controller_Argument $argument The argument to add
- * @return void
- */
- public function addArgument(TX_EXTMVC_Controller_Argument $argument) {
- $this->offsetSet(NULL, $argument);
- }
-
- /**
- * Returns an argument specified by name
- *
- * @param string $argumentName Name of the argument to retrieve
- * @return TX_EXTMVC_Controller_Argument
- * @throws TX_EXTMVC_Exception_NoSuchArgument
- */
- public function getArgument($argumentName) {
- if (!$this->offsetExists($argumentName)) throw new TX_EXTMVC_Exception_NoSuchArgument('An argument "' . $argumentName . '" does not exist.', 1195815178);
- return $this->offsetGet($argumentName);
- }
-
- /**
- * Checks if an argument with the specified name exists
- *
- * @param string $argumentName Name of the argument to check for
- * @return boolean TRUE if such an argument exists, otherwise FALSE
- * @see offsetExists()
- */
- public function hasArgument($argumentName) {
- return $this->offsetExists($argumentName);
- }
-
- /**
- * Returns the names of all arguments contained in this object
- *
- * @return array Argument names
- */
- public function getArgumentNames() {
- return array_keys($this->argumentNames);
- }
-
- /**
- * Returns the short names of all arguments contained in this object that have one.
- *
- * @return array Argument short names
- */
- public function getArgumentShortNames() {
- $argumentShortNames = array();
- foreach ($this as $argument) {
- $argumentShortNames[$argument->getShortName()] = TRUE;
- }
- return array_keys($argumentShortNames);
- }
-
- /**
- * Magic setter method for the argument values. Each argument
- * value can be set by just calling the setArgumentName() method.
- *
- * @param string $methodName Name of the method
- * @param array $arguments Method arguments
- * @return void
- */
- public function __call($methodName, array $arguments) {
- if (substr($methodName, 0, 3) !== 'set') throw new LogicException('Unknown method "' . $methodName . '".', 1210858451);
-
- $firstLowerCaseArgumentName = $this->translateToLongArgumentName(strtolower($methodName{3}) . substr($methodName, 4));
- $firstUpperCaseArgumentName = $this->translateToLongArgumentName(ucfirst(substr($methodName, 3)));
-
- if (in_array($firstLowerCaseArgumentName, $this->getArgumentNames())) {
- $argument = parent::offsetGet($firstLowerCaseArgumentName);
- $argument->setValue($arguments[0]);
- } elseif (in_array($firstUpperCaseArgumentName, $this->getArgumentNames())) {
- $argument = parent::offsetGet($firstUpperCaseArgumentName);
- $argument->setValue($arguments[0]);
- }
- }
-
- /**
- * Translates a short argument name to its corresponding long name. If the
- * specified argument name is a real argument name already, it will be returned again.
- *
- * If an argument with the specified name or short name does not exist, an empty
- * string is returned.
- *
- * @param string argument name
- * @return string long argument name or empty string
- */
- protected function translateToLongArgumentName($argumentName) {
-
- if (in_array($argumentName, $this->getArgumentNames())) return $argumentName;
-
- foreach ($this as $argument) {
- if ($argumentName === $argument->getShortName()) return $argument->getName();
- }
- return '';
- }
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * Interface for controllers
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-interface TX_EXTMVC_Controller_ControllerInterface {
-
- /**
- * Sets / injects the settings of the package this controller belongs to.
- *
- * @param array $settings Settings container of the current package
- * @return void
- */
- public function injectSettings(array $settings);
-
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A Special Case of a Controller: If no controller could be resolved or no
- * controller has been specified in the request, this controller is chosen.
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class TX_EXTMVC_Controller_DefaultController extends TX_EXTMVC_Controller_ActionController {
-
- /**
- * @var TX_EXTMVC_View_DefaultView
- */
- protected $defaultView;
-
- /**
- * Injects the default view
- *
- * @param TX_EXTMVC_View_DefaultView $defaultView The default view
- * @return void
- */
- public function injectDefaultView(TX_EXTMVC_View_DefaultView $defaultView) {
- $this->defaultView = $defaultView;
- }
-
- /**
- * Processes a generic request and returns a response
- *
- * @param TX_EXTMVC_Request $request: The request
- * @param TX_EXTMVC_Response $response: The response
- */
- public function processRequest(TX_EXTMVC_Request $request, TX_EXTMVC_Response $response) {
- $request->setDispatched(TRUE);
- switch (get_class($request)) {
- case 'TX_EXTMVC_Web_Request' :
- $this->processWebRequest($request, $response);
- break;
- default :
- $response->setContent(
- "\nWelcome to TYPO3!\n\n" .
- "This is the default view of the TYPO3 MVC object. You see this message because no \n" .
- "other view is available. Please refer to the Developer's Guide for more information \n" .
- "how to create and configure one.\n\n" .
- "Have fun! The TYPO3 Development Team\n"
- );
- }
- }
-
- /**
- * Processes a web request and returns a response
- *
- * @param TX_EXTMVC_Web_Request $request: The request
- * @param TX_EXTMVC_Web_Response $response: The response
- */
- protected function processWebRequest(TX_EXTMVC_Web_Request $request, TX_EXTMVC_Web_Response $response) {
- $this->defaultView->setRequest($request);
- $response->setContent($this->defaultView->render());
- }
-
-}
-
-?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A generic Domain Object
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+abstract class TX_EXTMVC_DomainObject_AbstractDomainObject implements TX_EXTMVC_DomainObject_DomainObjectInterface {
+
+ /**
+ * @var string The uid
+ */
+ protected $uid;
+
+ /**
+ * @var An array holding the clean property values. Set right after reconstitution of the object
+ */
+ private $_cleanProperties = NULL;
+
+ /**
+ * The generic constructor. If you want to implement your own __constructor() method in your Domain Object you have to call
+ * $this->initializeObject() in the first line of your constructor.
+ *
+ * @var array
+ */
+ public function __construct() {
+ $this->initializeObject();
+ }
+
+ /**
+ * This is the magic __wakeup() method. It's invoked by the unserialize statement in the reconstitution process
+ * of the object. If you want to implement your own __wakeup() method in your Domain Object you have to call
+ * parent::__wakeup() first!
+ *
+ * @return void
+ */
+ public function __wakeup() {
+ foreach ($GLOBALS['EXTMVC']['reconstituteObject']['properties'] as $propertyName => $value) {
+ $this->_reconstituteProperty($propertyName, $value);
+ }
+ $this->initializeObject();
+ $this->initializeCleanProperties();
+ }
+
+ /**
+ * A template method to initialize an object. This can be used to manipulate the object after
+ * reconstitution and before the clean state of it's properties is stored.
+ *
+ * @return void
+ */
+ protected function initializeObject() {
+ }
+
+ /**
+ * Getter for uid
+ *
+ * @return string
+ */
+ public function getUid() {
+ return $this->uid;
+ }
+
+ /**
+ * Reconstitutes a property. This method should only be called at reconstitution time!
+ *
+ * @param string $propertyName
+ * @param string $value
+ * @return void
+ * @internal
+ */
+ public function _reconstituteProperty($propertyName, $value) {
+ if (property_exists($this, $propertyName)) {
+ $this->$propertyName = $value;
+ } else {
+ // TODO Should we throw new TX_EXTMVC_Persistence_Exception_UnknownProperty('The property "' . $propertyName . '" doesn\'t exist in this object.', 1233270476);
+ }
+ }
+
+ /**
+ * Register an object's clean state, e.g. after it has been reconstituted
+ * from the database
+ *
+ * @return void
+ * @internal
+ */
+ public function _memorizeCleanState() {
+ $this->initializeCleanProperties();
+ $cleanProperties = array();
+ foreach ($this->_cleanProperties as $propertyName => $propertyValue) {
+ $cleanProperties[$propertyName] = $this->$propertyName;
+ }
+ $this->_cleanProperties = $cleanProperties;
+ }
+
+ /**
+ * Returns TRUE if the properties were modified after reconstitution
+ *
+ * @return boolean
+ * @internal
+ */
+ public function _isDirty() {
+ if (!is_array($this->_cleanProperties)) throw new TX_EXTMVC_Persistence_Exception_CleanStateNotMemorized('The clean state of the object "' . get_class($this) . '" has not been memorized before asking _isDirty().', 1233309106);
+ if ($this->uid !== NULL && $this->uid != $this->_cleanProperties['uid']) throw new TX_EXTMVC_Persistence_Exception_TooDirty('The uid "' . $this->uid . '" has been modified, that is simply too much.', 1222871239);
+ foreach ($this->_cleanProperties as $propertyName => $propertyValue) {
+ if ($this->$propertyName !== $propertyValue) return TRUE;
+ }
+ return FALSE;
+ }
+
+ /**
+ * Returns a hash map of property names and property values
+ *
+ * @return array The properties
+ * @internal
+ */
+ public function _getProperties() {
+ return get_object_vars($this);
+ }
+
+ /**
+ * Returns a hash map of dirty properties and $values
+ *
+ * @return boolean
+ * @internal
+ */
+ public function _getDirtyProperties() {
+ if (!is_array($this->_cleanProperties)) throw new TX_EXTMVC_Persistence_Exception_CleanStateNotMemorized('The clean state of the object "' . get_class($this) . '" has not been memorized before asking _isDirty().', 1233309106);
+ if ($this->uid !== NULL && $this->uid != $this->_cleanProperties['uid']) throw new TX_EXTMVC_Persistence_Exception_TooDirty('The uid "' . $this->uid . '" has been modified, that is simply too much.', 1222871239);
+ $dirtyProperties = array();
+ foreach ($this->_cleanProperties as $propertyName => $propertyValue) {
+ if ($this->$propertyName !== $propertyValue) {
+ $dirtyProperties[$propertyName] = $this->$propertyName;
+ }
+ }
+ return $dirtyProperties;
+ }
+
+ /**
+ * Saves a copy of values of the persitable properties inside the object itself. This method is normally
+ * called right after it's reconstitution from a storage.
+ *
+ * @return void
+ * @author Jochen Rau <jochen.rau@typoplanet.de>
+ */
+ private function initializeCleanProperties() {
+ $properties = get_object_vars($this);
+ $dataMapper = t3lib_div::makeInstance('TX_EXTMVC_Persistence_Mapper_ObjectRelationalMapper');
+ foreach ($properties as $propertyName => $propertyValue) {
+ if ($dataMapper->isPersistableProperty(get_class($this), $propertyName)) {
+ $this->_cleanProperties[$propertyName] = NULL;
+ }
+ }
+ $this->_cleanProperties['uid'] = NULL;
+ }
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An abstract Entity. An Entity is an object fundamentally defined not by its attributes,
+ * but by a thread of continuity and identity (e.g. a person).
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+abstract class TX_EXTMVC_DomainObject_AbstractEntity extends TX_EXTMVC_DomainObject_AbstractDomainObject {
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A abstract Value Object. A Value Object is an object that describes some characteristic
+ * or attribute (e.g. a color) but carries no concept of identity.
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+abstract class TX_EXTMVC_DomainObject_AbstractValueObject extends TX_EXTMVC_DomainObject_AbstractDomainObject {
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A Domain Object Interface
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+interface TX_EXTMVC_DomainObject_DomainObjectInterface {
+
+ /**
+ * Reconstitutes a property. This method should only be called at reconstitution time!
+ *
+ * @param string $propertyName
+ * @param string $value
+ * @return void
+ * @internal
+ */
+ public function _reconstituteProperty($propertyName, $value);
+
+ /**
+ * Register an object's clean state, e.g. after it has been reconstituted
+ * from the database
+ *
+ * @return void
+ * @internal
+ */
+ public function _memorizeCleanState();
+
+ /**
+ * Returns TRUE if the properties were modified after reconstitution
+ *
+ * @return boolean
+ * @internal
+ */
+ public function _isDirty();
+ /**
+ * Returns a hash map of property names and property values
+ *
+ * @return array The properties
+ * @internal
+ */
+ public function _getProperties();
+ /**
+ * Returns a hash map of dirty properties and $values
+ *
+ * @return boolean
+ * @internal
+ */
+ public function _getDirtyProperties();
+
+}
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A generic Domain Object
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-abstract class TX_EXTMVC_DomainObject_AbstractDomainObject implements TX_EXTMVC_DomainObject_DomainObjectInterface {
-
- /**
- * @var string The uid
- */
- protected $uid;
-
- /**
- * @var An array holding the clean property values. Set right after reconstitution of the object
- */
- private $_cleanProperties = NULL;
-
- /**
- * The generic constructor. If you want to implement your own __constructor() method in your Domain Object you have to call
- * $this->initializeObject() in the first line of your constructor.
- *
- * @var array
- */
- public function __construct() {
- $this->initializeObject();
- }
-
- /**
- * This is the magic __wakeup() method. It's invoked by the unserialize statement in the reconstitution process
- * of the object. If you want to implement your own __wakeup() method in your Domain Object you have to call
- * parent::__wakeup() first!
- *
- * @return void
- */
- public function __wakeup() {
- foreach ($GLOBALS['EXTMVC']['reconstituteObject']['properties'] as $propertyName => $value) {
- $this->_reconstituteProperty($propertyName, $value);
- }
- $this->initializeObject();
- $this->initializeCleanProperties();
- }
-
- /**
- * A template method to initialize an object. This can be used to manipulate the object after
- * reconstitution and before the clean state of it's properties is stored.
- *
- * @return void
- */
- protected function initializeObject() {
- }
-
- /**
- * Getter for uid
- *
- * @return string
- */
- public function getUid() {
- return $this->uid;
- }
-
- /**
- * Reconstitutes a property. This method should only be called at reconstitution time!
- *
- * @param string $propertyName
- * @param string $value
- * @return void
- * @internal
- */
- public function _reconstituteProperty($propertyName, $value) {
- if (property_exists($this, $propertyName)) {
- $this->$propertyName = $value;
- } else {
- // TODO Should we throw new TX_EXTMVC_Persistence_Exception_UnknownProperty('The property "' . $propertyName . '" doesn\'t exist in this object.', 1233270476);
- }
- }
-
- /**
- * Register an object's clean state, e.g. after it has been reconstituted
- * from the database
- *
- * @return void
- * @internal
- */
- public function _memorizeCleanState() {
- $this->initializeCleanProperties();
- $cleanProperties = array();
- foreach ($this->_cleanProperties as $propertyName => $propertyValue) {
- $cleanProperties[$propertyName] = $this->$propertyName;
- }
- $this->_cleanProperties = $cleanProperties;
- }
-
- /**
- * Returns TRUE if the properties were modified after reconstitution
- *
- * @return boolean
- * @internal
- */
- public function _isDirty() {
- if (!is_array($this->_cleanProperties)) throw new TX_EXTMVC_Persistence_Exception_CleanStateNotMemorized('The clean state of the object "' . get_class($this) . '" has not been memorized before asking _isDirty().', 1233309106);
- if ($this->uid !== NULL && $this->uid != $this->_cleanProperties['uid']) throw new TX_EXTMVC_Persistence_Exception_TooDirty('The uid "' . $this->uid . '" has been modified, that is simply too much.', 1222871239);
- foreach ($this->_cleanProperties as $propertyName => $propertyValue) {
- if ($this->$propertyName !== $propertyValue) return TRUE;
- }
- return FALSE;
- }
-
- /**
- * Returns a hash map of property names and property values
- *
- * @return array The properties
- * @internal
- */
- public function _getProperties() {
- return get_object_vars($this);
- }
-
- /**
- * Returns a hash map of dirty properties and $values
- *
- * @return boolean
- * @internal
- */
- public function _getDirtyProperties() {
- if (!is_array($this->_cleanProperties)) throw new TX_EXTMVC_Persistence_Exception_CleanStateNotMemorized('The clean state of the object "' . get_class($this) . '" has not been memorized before asking _isDirty().', 1233309106);
- if ($this->uid !== NULL && $this->uid != $this->_cleanProperties['uid']) throw new TX_EXTMVC_Persistence_Exception_TooDirty('The uid "' . $this->uid . '" has been modified, that is simply too much.', 1222871239);
- $dirtyProperties = array();
- foreach ($this->_cleanProperties as $propertyName => $propertyValue) {
- if ($this->$propertyName !== $propertyValue) {
- $dirtyProperties[$propertyName] = $this->$propertyName;
- }
- }
- return $dirtyProperties;
- }
-
- /**
- * Saves a copy of values of the persitable properties inside the object itself. This method is normally
- * called right after it's reconstitution from a storage.
- *
- * @return void
- * @author Jochen Rau <jochen.rau@typoplanet.de>
- */
- private function initializeCleanProperties() {
- $properties = get_object_vars($this);
- $dataMapper = t3lib_div::makeInstance('TX_EXTMVC_Persistence_Mapper_ObjectRelationalMapper');
- foreach ($properties as $propertyName => $propertyValue) {
- if ($dataMapper->isPersistableProperty(get_class($this), $propertyName)) {
- $this->_cleanProperties[$propertyName] = NULL;
- }
- }
- $this->_cleanProperties['uid'] = NULL;
- }
-
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An abstract Entity. An Entity is an object fundamentally defined not by its attributes,
- * but by a thread of continuity and identity (e.g. a person).
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-abstract class TX_EXTMVC_DomainObject_AbstractEntity extends TX_EXTMVC_DomainObject_AbstractDomainObject {
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A abstract Value Object. A Value Object is an object that describes some characteristic
- * or attribute (e.g. a color) but carries no concept of identity.
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-abstract class TX_EXTMVC_DomainObject_AbstractValueObject extends TX_EXTMVC_DomainObject_AbstractDomainObject {
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A Domain Object Interface
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-interface TX_EXTMVC_DomainObject_DomainObjectInterface {
-
- /**
- * Reconstitutes a property. This method should only be called at reconstitution time!
- *
- * @param string $propertyName
- * @param string $value
- * @return void
- * @internal
- */
- public function _reconstituteProperty($propertyName, $value);
-
- /**
- * Register an object's clean state, e.g. after it has been reconstituted
- * from the database
- *
- * @return void
- * @internal
- */
- public function _memorizeCleanState();
-
- /**
- * Returns TRUE if the properties were modified after reconstitution
- *
- * @return boolean
- * @internal
- */
- public function _isDirty();
- /**
- * Returns a hash map of property names and property values
- *
- * @return array The properties
- * @internal
- */
- public function _getProperties();
- /**
- * Returns a hash map of dirty properties and $values
- *
- * @return boolean
- * @internal
- */
- public function _getDirtyProperties();
-
-}
-?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A generic MVC exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Exception extends Exception {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Infinite Loop" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InfiniteLoop extends TX_EXTMVC_Exception {
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "invalid action name" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidActionName extends TX_EXTMVC_Exception {
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Argument Name" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidArgumentName extends TX_EXTMVC_Exception {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Argument Type" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+
+class InvalidArgumentType extends TX_EXTMVC_Exception {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Argument Value" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+
+class InvalidArgumentValue extends TX_EXTMVC_Exception {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Controller" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+
+class InvalidController extends TX_EXTMVC_Exception {
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Controller Name" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidControllerName extends TX_EXTMVC_Exception {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Format" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidFormat extends TX_EXTMVC_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Marker" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidMarker extends TX_EXTMVC_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Extension Key" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidExtensionKey extends TX_EXTMVC_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Part" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidPart extends TX_EXTMVC_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Request Method" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidRequestMethod extends TX_EXTMVC_Exception {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Request Type" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidRequestType extends TX_EXTMVC_Exception {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "invalid RoutePartHandler" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidRoutePartHandler extends TX_EXTMVC_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Template Resource" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidTemplateSource extends TX_EXTMVC_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "invalid ViewHelper" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidViewHelper extends TX_EXTMVC_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A "No Such Action" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class NoSuchAction extends TX_EXTMVC_Exception {
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A "No Such Argument" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class NoSuchArgument extends TX_EXTMVC_Exception {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A "No Such Controller" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class NoSuchController extends TX_EXTMVC_Exception {
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * This exception is thrown by a controller to stop the execution of the current
+ * action and return the control to the dispatcher. The dispatcher catches this
+ * exception and - depending on the "dispatched" status of the request - either
+ * continues dispatching the request or returns control to the request handler.
+ *
+ * See the Action Controller's forward() and redirect() methods for more information.
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Exception_StopAction extends TX_EXTMVC_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * This exception is thrown by a controller to stop the execution of the current
+ * action and return the control to the dispatcher. The dispatcher catches this
+ * exception and sets the extension to USER_INT (not cached)
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Exception_StopUncachedAction extends TX_EXTMVC_Exception {
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Successive Dynamic RoutePart" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class SuccessiveDynamicRouteParts extends TX_EXTMVC_Exception {
+
+}
+
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Infinite Loop" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InfiniteLoop extends TX_EXTMVC_Exception {
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "invalid action name" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidActionName extends TX_EXTMVC_Exception {
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Argument Name" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidArgumentName extends TX_EXTMVC_Exception {
-
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Argument Type" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-
-class InvalidArgumentType extends TX_EXTMVC_Exception {
-
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Argument Value" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-
-class InvalidArgumentValue extends TX_EXTMVC_Exception {
-
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Controller" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-
-class InvalidController extends TX_EXTMVC_Exception {
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Controller Name" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidControllerName extends TX_EXTMVC_Exception {
-
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Format" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidFormat extends TX_EXTMVC_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Marker" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidMarker extends TX_EXTMVC_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Extension Key" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidExtensionKey extends TX_EXTMVC_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Part" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidPart extends TX_EXTMVC_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Request Method" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidRequestMethod extends TX_EXTMVC_Exception {
-
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Request Type" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidRequestType extends TX_EXTMVC_Exception {
-
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "invalid RoutePartHandler" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidRoutePartHandler extends TX_EXTMVC_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Template Resource" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidTemplateSource extends TX_EXTMVC_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "invalid ViewHelper" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidViewHelper extends TX_EXTMVC_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A "No Such Action" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class NoSuchAction extends TX_EXTMVC_Exception {
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A "No Such Argument" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class NoSuchArgument extends TX_EXTMVC_Exception {
-
-}
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A "No Such Controller" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class NoSuchController extends TX_EXTMVC_Exception {
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * This exception is thrown by a controller to stop the execution of the current
- * action and return the control to the dispatcher. The dispatcher catches this
- * exception and - depending on the "dispatched" status of the request - either
- * continues dispatching the request or returns control to the request handler.
- *
- * See the Action Controller's forward() and redirect() methods for more information.
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class TX_EXTMVC_Exception_StopAction extends TX_EXTMVC_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * This exception is thrown by a controller to stop the execution of the current
- * action and return the control to the dispatcher. The dispatcher catches this
- * exception and sets the extension to USER_INT (not cached)
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class TX_EXTMVC_Exception_StopUncachedAction extends TX_EXTMVC_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Successive Dynamic RoutePart" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class SuccessiveDynamicRouteParts extends TX_EXTMVC_Exception {
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Unsupported Request Type" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class UnsupportedRequestType extends TX_EXTMVC_Exception {
-
-}
-?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Unsupported Request Type" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class UnsupportedRequestType extends TX_EXTMVC_Exception {
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A generic Persistence exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Persistence_Exception extends TX_EXTMVC_Exception {
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Class" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidClass extends TX_EXTMVC_Persistence_Exception {
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Invalid Property Type" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class InvalidPropertyType extends TX_EXTMVC_Persistence_Exception {
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A "Missing Backend" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class MissingBackend extends TX_EXTMVC_Persistence_Exception {
+}
+
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Class" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidClass extends TX_EXTMVC_Persistence_Exception {
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Invalid Property Type" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class InvalidPropertyType extends TX_EXTMVC_Persistence_Exception {
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A "Missing Backend" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class MissingBackend extends TX_EXTMVC_Persistence_Exception {
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * A "Too Dirty" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-// SK: What does "TooDirty" mean? The UID has been modified? I'd suggest a more understandable name :-)
-// JR: That's a class name Karsten has chosen. In deed, the exception will be thrown if UID has been modified
-class TooDirty extends TX_EXTMVC_Persistence_Exception {
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
-* Copyright notice
-*
-* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-* All rights reserved
-*
-* This script is part of the TYPO3 project. The TYPO3 project is
-* free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* The GNU General Public License can be found at
-* http://www.gnu.org/copyleft/gpl.html.
-*
-* This script is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * An "Unsupported Method" exception
- *
- * @package TYPO3
- * @subpackage extmvc
- * @version $ID:$
- */
-class TX_EXTMVC_Persistence_Exception_UnsupportedMethod extends TX_EXTMVC_Persistence_Exception {
-}
-
-?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A "Too Dirty" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+// SK: What does "TooDirty" mean? The UID has been modified? I'd suggest a more understandable name :-)
+// JR: That's a class name Karsten has chosen. In deed, the exception will be thrown if UID has been modified
+class TooDirty extends TX_EXTMVC_Persistence_Exception {
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * An "Unsupported Method" exception
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Persistence_Exception_UnsupportedMethod extends TX_EXTMVC_Persistence_Exception {
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A column map to map a column configured in $TCA on a property of a domain object.
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+// SK: I did not do an in-depth check of this class
+// SK: PHPDoc ;-)
+class TX_EXTMVC_Persistence_Mapper_ColumnMap {
+
+ /**
+ * Constants reflecting the type of relation
+ */
+ const RELATION_NONE = 0;
+ const RELATION_HAS_ONE = 1;
+ const RELATION_HAS_MANY = 2;
+ const RELATION_HAS_AND_BELONGS_TO_MANY = 3;
+
+ /**
+ * Constants reflecting the type of value
+ */
+ const TYPE_UNKNOWN = 0;
+ const TYPE_STRING = 1;
+ const TYPE_DATE = 2;
+ const TYPE_INTEGER = 3;
+ const TYPE_FLOAT = 4;
+ const TYPE_BOOLEAN = 5;
+
+ /**
+ * The property name corresponding to the table name
+ *
+ * @var string
+ **/
+ protected $propertyName;
+
+ /**
+ * The column name
+ *
+ * @var string
+ **/
+ protected $columnName;
+
+ /**
+ * The type of relation
+ *
+ * @var int
+ **/
+ protected $typeOfRelation;
+
+ /**
+ * The type of value
+ *
+ * @var int
+ **/
+ protected $typeOfValue;
+
+ /**
+ * The name of the child's class
+ *
+ * @var string
+ **/
+ protected $childClassName;
+
+ /**
+ * The name of the child's table
+ *
+ * @var string
+ **/
+ protected $childTableName;
+
+ /**
+ * The where clause to narrow down the selected child records
+ *
+ * @var string
+ **/
+ protected $childTableWhere;
+
+ /**
+ * The name of the field the results from the child's table are sorted by
+ *
+ * @var string
+ **/
+ protected $childSortByFieldName;
+
+ /**
+ * The name of the relation table
+ *
+ * @var string
+ **/
+ protected $relationTableName;
+
+ /**
+ * The name of the field holding the parents key
+ *
+ * @var string
+ **/
+ protected $parentKeyFieldName;
+
+ /**
+ * The name of the field holding the name of the table of the parent's records
+ *
+ * @var string
+ **/
+ protected $parentTableFieldName;
+
+ public function __construct($columnName) {
+ $this->setColumnName($columnName);
+ $this->setPropertyName(TX_EXTMVC_Utility_Strings::underscoredToLowerCamelCase($columnName));
+ }
+
+ public function setTypeOfRelation($typeOfRelation) {
+ switch ($typeOfRelation) {
+ case self::RELATION_NONE;
+ case self::RELATION_HAS_ONE;
+ case self::RELATION_HAS_MANY;
+ case self::RELATION_HAS_AND_BELONGS_TO_MANY;
+ $this->typeOfRelation = $typeOfRelation;
+ break;
+ default:
+ $this->typeOfRelation = NULL;
+ break;
+ }
+ }
+
+ public function isRelation() {
+ return $this->typeOfRelation !== NULL && $this->typeOfRelation !== self::RELATION_NONE;
+ }
+
+ public function getTypeOfRelation() {
+ return $this->typeOfRelation;
+ }
+
+ public function setTypeOfValue($typeOfValue) {
+ switch ($typeOfValue) {
+ case self::TYPE_UNKNOWN;
+ case self::TYPE_STRING;
+ case self::TYPE_DATE;
+ case self::TYPE_INTEGER;
+ case self::TYPE_FLOAT;
+ case self::TYPE_BOOLEAN;
+ $this->typeOfValue = $typeOfValue;
+ break;
+ default:
+ $this->typeOfValue = NULL;
+ break;
+ }
+ }
+
+ public function getTypeOfValue() {
+ return $this->typeOfValue;
+ }
+
+ public function setPropertyName($propertyName) {
+ $this->propertyName = $propertyName;
+ }
+
+ public function getPropertyName() {
+ return $this->propertyName;
+ }
+
+ public function setColumnName($columnName) {
+ $this->columnName = $columnName;
+ }
+
+ public function getColumnName() {
+ return $this->columnName;
+ }
+
+ public function setChildClassName($childClassName) {
+ $this->childClassName = $childClassName;
+ }
+
+ public function getChildClassName() {
+ return $this->childClassName;
+ }
+
+ public function setChildTableName($childTableName) {
+ $this->childTableName = $childTableName;
+ }
+
+ public function getChildTableName() {
+ return $this->childTableName;
+ }
+
+ public function setChildTableWhere($childTableWhere) {
+ $this->childTableWhere = $childTableWhere;
+ }
+
+ public function getChildTableWhere() {
+ return $this->childTableWhere;
+ }
+
+ public function setChildSortByFieldName($childSortByFieldName) {
+ $this->childSortByFieldName = $childSortByFieldName;
+ }
+
+ public function getChildSortByFieldName() {
+ return $this->childSortByFieldName;
+ }
+
+ public function setRelationTableName($relationTableName) {
+ $this->relationTableName = $relationTableName;
+ }
+
+ public function getRelationTableName() {
+ return $this->relationTableName;
+ }
+
+ public function setParentKeyFieldName($parentKeyFieldName) {
+ $this->parentKeyFieldName = $parentKeyFieldName;
+ }
+
+ public function getParentKeyFieldName() {
+ return $this->parentKeyFieldName;
+ }
+
+ public function setParentTableFieldName($parentTableFieldName) {
+ $this->parentTableFieldName = $parentTableFieldName;
+ }
+
+ public function getParentTableFieldName() {
+ return $this->parentTableFieldName;
+ }
+
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/***************************************************************
+* Copyright notice
+*
+* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+* All rights reserved
+*
+* This script is part of the TYPO3 project. The TYPO3 project is
+* free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* The GNU General Public License can be found at
+* http://www.gnu.org/copyleft/gpl.html.
+*
+* This script is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * A data map to map a single table configured in $TCA on a domain object.
+ *
+ * @package TYPO3
+ * @subpackage extmvc
+ * @version $ID:$
+ */
+class TX_EXTMVC_Persistence_Mapper_DataMap {
+// SK: PHPDoc (even for getters and setters, sorry ;-) )
+// SK: I did not do an in-depth check of this class
+ /**
+ * The domain class name
+ *
+ * @var string
+ **/
+ protected $className;
+
+ /**
+ * The table name corresponding to the domain class configured in $TCA
+ *
+ * @var string
+ **/
+ protected $tableName;
+
+ /**
+ * An array of column maps configured in $TCA
+ *
+ * @var array
+ **/
+ protected $columnMaps;
+
+ /**
+ * Constructs this DataMap
+ *
+ * @param string $className The class name. This determines the table to fetch the configuration for
+ */
+ public function __construct($className) {
+ $this->setClassName($className);
+ // SK: strtolower(..) is the wrong conversion for the class name. See the notice in the dispatcher (tt_news ->tx_ttnews)
+ $this->setTableName(strtolower($this->className));
+ t3lib_div::loadTCA($this->getTableName());
+ }
+
+ public function setClassName($className) {
+ $this->className = $className;
+ }
+
+ public function getClassName() {
+ return $this->className;
+ }
+
+ public function setTableName($tableName) {
+ $this->tableName = $tableName;
+ }
+
+ public function getTableName() {
+ return $this->tableName;
+ }
+
+ // SK: Why is initialize() not called in the constructor? Without initialize(), the object cannot do anything - or am I wrong here?
+ public function initialize() {
+ $columns = $GLOBALS['TCA'][$this->getTableName()]['columns'];
+ if (is_array($columns)) {
+ $this->addCommonColumns();
+ foreach ($columns as $columnName => $columnConfiguration) {
+ $columnMap = new TX_EXTMVC_Persistence_Mapper_ColumnMap($columnName, $this);
+ $this->setTypeOfValue($columnMap, $columnConfiguration);
+ // TODO support for IRRE
+ // TODO support for MM_insert_fields and MM_match_fields
+ // SK: Discuss the above things
+ $this->setRelations($columnMap, $columnConfiguration);
+ $this->addColumnMap($columnMap);
+ }
+ } else {
+ // TODO Throw exception
+ }
+ }
+
+ protected function addCommonColumns() {
+ $this->addColumn('uid', TX_EXTMVC_Persistence_Mapper_ColumnMap::TYPE_INTEGER);
+ $this->addColumn('pid', TX_EXTMVC_Persistence_Mapper_ColumnMap::TYPE_INTEGER);
+ $this->addColumn('tstamp', TX_EXTMVC_Persistence_Mapper_ColumnMap::TYPE_DATE);
+ $this->addColumn('crdate', TX_EXTMVC_Persistence_Mapper_ColumnMap::TYPE_DATE);
+ $this->addColumn('cruser_id', TX_EXTMVC_Persistence_Mapper_ColumnMap::TYPE_INTEGER);
+ if ($this->getDeletedColumnName() !== NULL) {
+ $this->addColumn($this->getDeletedColumnName(), TX_EXTMVC_Persistence_Mapper_ColumnMap::TYPE_BOOLEAN);
+ }
+ if ($this->getHiddenColumnName() !== NULL) {
+ $this->addColumn($this->getHiddenColumnName(), TX_EXTMVC_Persistence_Mapper_ColumnMap::TYPE_BOOLEAN);
+ }
+ }
+
+ protected function setTypeOfValue(TX_EXTMVC_Persistence_Mapper_ColumnMap &$columnMap, $columnConfiguration) {
+ if (strpos($columnConfiguration['config']['eval'], 'date') !== FALSE
+ || strpos($columnConfiguration['config']['eval'], 'datetime') !== FALSE) {
+ &