Changed author of dispatch class and synopsis master
authorChristian Opitz <christian.opitz@netresearch.de>
Sun, 27 Jan 2013 13:44:42 +0000 (14:44 +0100)
committerChristian Opitz <christian.opitz@netresearch.de>
Fri, 31 May 2013 13:22:25 +0000 (15:22 +0200)
class.tx_t3build_dispatch.php [deleted file]
dispatch.php

diff --git a/class.tx_t3build_dispatch.php b/class.tx_t3build_dispatch.php
deleted file mode 100644 (file)
index d314b20..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2009 AOE media GmbH <dev@aoemedia.de>
-*  All rights reserved
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-require_once PATH_t3lib . 'class.t3lib_cli.php';
-require_once t3lib_extMgm::extPath('t3build').'controller/class.t3build_abstractController.php';
-
-/**
- * General CLI dispatcher for the t3build extension.
- *
- * @package t3build
- * @author Oliver Hader <oliver.hader@aoemedia.de>
- */
-class tx_t3build_dispatch extends t3lib_cli {
-       const ExtKey = 't3build';
-       const Mask_ClassName = 'tx_t3build_%sController';
-       const Mask_ClassFile = 'classes/class.tx_t3build_%sController.php';
-       const Mask_Action = '%sAction';
-
-       /**
-        * @var array
-        */
-       protected $classInstances = array();
-
-       /**
-        * Creates this object.
-        */
-       public function __construct() {
-               parent::__construct();
-               $this->cli_help = array_merge($this->cli_help, array(
-                       'name' => 'tx_t3build_dispatch',
-                       'synopsis' => self::ExtKey . ' controller action ###OPTIONS###',
-                       'description' => '',
-                       'examples' => 'typo3/cli_dispatch.phpsh ' . self::ExtKey . ' database updateStructure',
-                       'author' => '(c) 2010 AOE media GmbH <dev@aoemedia.de>',
-               ));
-       }
-
-       /**
-        * Sets the CLI arguments.
-        *
-        * @param array $arguments
-        * @return void
-        */
-       public function setCliArguments(array $arguments) {
-               $this->cli_args = $arguments;
-       }
-
-       /**
-        * Gets or generates an instance of the given class name.
-        *
-        * @param string $className
-        * @return object
-        */
-       public function getClassInstance($className) {
-               if (!isset($this->classInstances[$className])) {
-                       $this->classInstances[$className] = t3lib_div::makeInstance($className);
-               }
-               return $this->classInstances[$className];
-       }
-
-       /**
-        * Sets an instance for the given class name.
-        *
-        * @param string $className
-        * @param object $classInstance
-        * @return void
-        */
-       public function setClassInstance($className, $classInstance) {
-               $this->classInstances[$className] = $classInstance;
-       }
-
-       /**
-        * Dispatches the requested actions to the accordant controller.
-        *
-        * @return void
-        */
-       public function dispatch() {
-               $controller = (string)$this->cli_args['_DEFAULT'][1];
-               $action = (string)$this->cli_args['_DEFAULT'][2];
-
-               if (!$controller || !$action) {
-                       throw new Exception('The CLI process must be called with a controller and action name.');
-               }
-
-               $className = sprintf(self::Mask_ClassName, $controller);
-               $classFile = sprintf(self::Mask_ClassFile, $controller);
-               $actionName = sprintf(self::Mask_Action, $action);
-
-               if (!class_exists($className)) {
-                       t3lib_div::requireOnce(PATH_tx_t3build . $classFile);
-               }
-
-               $instance = $this->getClassInstance($className);
-
-               if (!is_callable(array($instance, $actionName))) {
-                       throw new Exception('The action ' . $action . ' is not implemented in controller ' . $controller);
-               }
-
-               $result = call_user_func_array(
-                       array($instance, $actionName),
-                       array($this->cli_args)
-               );
-
-               return $result;
-       }
-}
index 4f6823f..8d2367b 100644 (file)
@@ -19,7 +19,7 @@ require_once t3lib_extMgm::extPath('t3build').'classes/class.tx_t3build_provider
  * General CLI dispatcher for the t3build extension.
  *
  * @package t3build
- * @author Oliver Hader <oliver.hader@aoemedia.de>
+ * @author Christian Opitz <christian.opitz@netresearch.de>
  */
 class tx_t3build_dispatch extends t3lib_cli {
        const ExtKey = 't3build';
@@ -37,10 +37,10 @@ class tx_t3build_dispatch extends t3lib_cli {
                $this->providerInfo = t3lib_div::makeInstance('tx_t3build_providerInfo');
                $this->cli_help = array_merge($this->cli_help, array(
                        'name' => 'tx_t3build_dispatch',
-                       'synopsis' => self::ExtKey . ' controller action ###OPTIONS###',
+                       'synopsis' => self::ExtKey . ' command [subcommand] ###OPTIONS###',
                        'description' => '',
                        'examples' => 'typo3/cli_dispatch.phpsh ' . self::ExtKey . ' database updateStructure',
-                       'author' => '(c) 2010 AOE media GmbH <dev@aoemedia.de>',
+                       'author' => '(c) 2013 Netresearch GmbH & Co.KG <typo3@netresearch.de>',
                ));
        }