Extbase:
authorJochen Rau <j.rau@web.de>
Wed, 15 Apr 2009 09:14:22 +0000 (09:14 +0000)
committerJochen Rau <j.rau@web.de>
Wed, 15 Apr 2009 09:14:22 +0000 (09:14 +0000)
* Some adjustments to the code according to the renaming of "blogexample" to "blog_example"

typo3/sysext/extbase/Classes/Configuration/Source/PhpSource.php
typo3/sysext/extbase/Classes/MVC/Request.php
typo3/sysext/extbase/Classes/Persistence/Tests/Repository_testcase.php
typo3/sysext/extbase/Tests/Persistence/Mapper/DataMap_testcase.php
typo3/sysext/extbase/Tests/Persistence/Repository_testcase.php
typo3/sysext/extbase/class.tx_extbase_dispatcher.php

index d970384..4120ced 100644 (file)
@@ -40,7 +40,7 @@ class Tx_Extbase_Configuration_Source_PhpSource implements Tx_Extbase_Configurat
         * @return array
         */
        public function load($extensionName) {
-               $pathAndFilename = t3lib_extMgm::extPath(strtolower($extensionName)) . '/Configuration/Settings';
+               $pathAndFilename = t3lib_extMgm::extPath(Tx_Extbase_Utility_Strings::camelCaseToLowerCaseUnderscored($extensionName)) . '/Configuration/Settings';
                $c = t3lib_div::makeInstance('Tx_Extbase_Configuration_Container');
                if (file_exists($pathAndFilename . '.php')) {
                        require ($pathAndFilename . '.php');
index 18a34a9..1e6ff95 100644 (file)
@@ -225,6 +225,15 @@ class Tx_Extbase_MVC_Request {
        }
 
        /**
+        * Returns the extension name of the specified controller.
+        *
+        * @return string The extension name
+        */
+       public function getExtensionKey() {
+               return Tx_Extbase_Utility_Strings::camelCaseToLowerCaseUnderscored($this->extensionName);
+       }
+
+       /**
         * Sets the name of the controller which is supposed to handle the request.
         * Note: This is not the object name of the controller!
         *
index 1c44e89..92422b4 100644 (file)
@@ -27,7 +27,7 @@ require_once('Base_testcase.php');
 class Tx_Extbase_Persistence_Repository_testcase extends Tx_Extbase_Base_testcase {
 
        public function __construct() {
-               require_once(t3lib_extMgm::extPath('blogexample') . 'Classes/Domain/BlogRepository.php');
+               require_once(t3lib_extMgm::extPath('blog_example') . 'Classes/Domain/BlogRepository.php');
        }
 
        public function setUp() {
@@ -130,7 +130,7 @@ require_once('Base_testcase.php');
 class Tx_Extbase_Persistence_Repository_testcase extends Tx_Extbase_Base_testcase {
 
        public function __construct() {
-               require_once(t3lib_extMgm::extPath('blogexample') . 'Classes/Domain/BlogRepository.php');
+               require_once(t3lib_extMgm::extPath('blog_example') . 'Classes/Domain/BlogRepository.php');
        }
 
        public function setUp() {
@@ -233,7 +233,7 @@ require_once('Base_testcase.php');
 class Tx_Extbase_Persistence_Repository_testcase extends Tx_Extbase_Base_testcase {
 
        public function __construct() {
-               require_once(t3lib_extMgm::extPath('blogexample') . 'Classes/Domain/BlogRepository.php');
+               require_once(t3lib_extMgm::extPath('blog_example') . 'Classes/Domain/BlogRepository.php');
        }
 
        public function setUp() {
index cf651b9..7c2d17b 100644 (file)
@@ -27,7 +27,7 @@ require_once(PATH_tslib . 'class.tslib_content.php');
 class Tx_Extbase_Persistence_Mapper_DataMap_testcase extends Tx_Extbase_Base_testcase {
        
        public function setUp() {
-               require_once(t3lib_extMgm::extPath('blogexample') . 'Classes/Domain/Model/Blog.php');
+               require_once(t3lib_extMgm::extPath('blog_example') . 'Classes/Domain/Model/Blog.php');
        
                $GLOBALS['TSFE']->fe_user = $this->getMock('tslib_feUserAuth');
                $GLOBALS['TSFE'] = $this->getMock('tslib_fe', array('includeTCA'));
@@ -46,7 +46,7 @@ class Tx_Extbase_Persistence_Mapper_DataMap_testcase extends Tx_Extbase_Base_tes
                global $_EXTKEY;
                $TCA['tx_blogexample_domain_model_blog'] = array (
                        'ctrl' => array (
-                               'title'             => 'LLL:EXT:blogexample/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog',
+                               'title'             => 'LLL:EXT:blog_example/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog',
                                'label'                         => 'name',
                                'tstamp'            => 'tstamp',
                                'prependAtCopy'     => 'LLL:EXT:lang/locallang_general.xml:LGL.prependAtCopy',
@@ -69,7 +69,7 @@ class Tx_Extbase_Persistence_Mapper_DataMap_testcase extends Tx_Extbase_Base_tes
                                ),
                                'name' => array(
                                        'exclude' => 0,
-                                       'label'   => 'LLL:EXT:blogexample/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog.name',
+                                       'label'   => 'LLL:EXT:blog_example/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog.name',
                                        'config'  => array(
                                                'type' => 'input',
                                                'size' => 20,
@@ -79,7 +79,7 @@ class Tx_Extbase_Persistence_Mapper_DataMap_testcase extends Tx_Extbase_Base_tes
                                ),
                                'description' => array(
                                        'exclude' => 1,
-                                       'label'   => 'LLL:EXT:blogexample/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog.description',
+                                       'label'   => 'LLL:EXT:blog_example/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog.description',
                                        'config'  => array(
                                                'type' => 'text',
                                                'eval' => 'required',
@@ -89,7 +89,7 @@ class Tx_Extbase_Persistence_Mapper_DataMap_testcase extends Tx_Extbase_Base_tes
                                ),
                                'logo' => array(
                                        'exclude' => 1,
-                                       'label'   => 'LLL:EXT:blogexample/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog.logo',
+                                       'label'   => 'LLL:EXT:blog_example/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog.logo',
                                        'config'  => array(
                                                'type'          => 'group',
                                                'internal_type' => 'file',
@@ -104,7 +104,7 @@ class Tx_Extbase_Persistence_Mapper_DataMap_testcase extends Tx_Extbase_Base_tes
                                ),
                                'posts' => array(
                                        'exclude' => 1,
-                                       'label'   => 'LLL:EXT:blogexample/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog.posts',
+                                       'label'   => 'LLL:EXT:blog_example/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog.posts',
                                        'config' => array(
                                                'type' => 'inline',
                                                // TODO is 'foreign_class' in $TCA the best way?
@@ -121,7 +121,7 @@ class Tx_Extbase_Persistence_Mapper_DataMap_testcase extends Tx_Extbase_Base_tes
                                ),
                                'author' => array(
                                        'exclude' => 1,
-                                       'label'   => 'LLL:EXT:blogexample/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog.author',
+                                       'label'   => 'LLL:EXT:blog_example/Resources/Language/locallang_db.xml:tx_blogexample_domain_model_blog.author',
                                        'config' => array(
                                                'type' => 'select',
                                                'foreign_class' => 'Tx_BlogExample_Domain_Model_Author',
index c49a97a..af58f7d 100644 (file)
@@ -24,7 +24,7 @@
 
 class Tx_Extbase_Persistence_Repository_testcase extends Tx_Extbase_Base_testcase {
        public function __construct() {
-               require_once(t3lib_extMgm::extPath('blogexample', 'Classes/Domain/Model/BlogRepository.php'));
+               require_once(t3lib_extMgm::extPath('blog_example', 'Classes/Domain/Model/BlogRepository.php'));
        }
 
        public function test_FindDelegatesToObjectRelationalMapperBuildQueryAndFetch() {
index 6d6de00..74542e1 100644 (file)
@@ -22,6 +22,8 @@
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
 
+require_once(t3lib_extMgm::extPath('extbase') . 'Classes/Utility/Strings.php');
+
 /**
  * Creates a request an dispatches it to the controller which was specified
  * by TS Setup, Flexform and returns the content to the v4 framework.
@@ -133,7 +135,7 @@ class Tx_Extbase_Dispatcher {
                        }
                        $className = implode('_', $classNameParts);
                        if (count($classNameParts) > 2 && $classNameParts[0] === 'Tx') {
-                               $classFilePathAndName = t3lib_extMgm::extPath(strtolower($classNameParts[1])) . 'Classes/';
+                               $classFilePathAndName = t3lib_extMgm::extPath(Tx_Extbase_Utility_Strings::camelCaseToLowerCaseUnderscored($classNameParts[1])) . 'Classes/';
                                $classFilePathAndName .= implode(array_slice($classNameParts, 2, -1), '/') . '/';
                                $classFilePathAndName .= array_pop($classNameParts) . '.php';
                        }