[TYPO3-dev] Your opinion please: ZF and T3

Christian Opitz - Netzelf christian.opitz at netzelf.de
Wed Jun 30 22:58:36 CEST 2010


Hi Guys,

I'm currently writing an extension that enables developers to develop 
plugins with the Zend Framework - so what i'm doing is sticking router, 
response, DB-adapter, module loaders and so on together to get them 
working within TYPO3. Works good so far and I'll release it in TER soon 
because i think its quite usefull for others too. (It's name will be ZFext)

Dear ExtBase-developers: This is no contra to your great work - it's 
just that i currently need some structure base in plugins for a larger 
project with 4.2.8 - where i'm not the one who is deciding about updates.

Ok - quite long introduction - what I'm asking you, is your honest opinion.

Actually the typoscript generated by Zfext_ExtMgm::addPItoST43() is the 
same as that of the method in t3lib_extMgm. Except three differences. 
Code says it faster than words:

plugin.tx_zfextexample_pi1 = USER_INT
plugin.tx_zfextexample_pi1 {
     includeLibs = typo3conf/ext/zfext/plugin/class.tx_zfext.php
     userFunc = tx_zfext->main
     prefixId = tx_zfextexample_pi1
}

I can live with the includeLibs and userFunc property but the prefixId 
bothers me somehow (BUT i need it in the zfext-plugin to resolve which 
plugin was called).

As i saw ExtBase goes another way by not writing it's 
USER/USER_INT-object not in the plugin...-object but directly into 
tt_content.list.

Now what worries me for certain days is how i should do that - because i 
somehow have the feeling that USER/USER_INT-objects in the 
plugin-objects is not the worst method as i think that it gives a faster 
insight whats happening. What do you think about that?

Second thing that worries me is if i should support more types than the 
list_type - currently i do. Does anybody want to put that kind of plugin 
in another than the list_type?

And just to be complete, I'd like to ask you another last thing: The 
prefixId in the plugin-conf is the key to an entry in 
config.tx_zfext.resources.zfext where per default only the extKey is 
set. When you change the default options defined as static variable in 
Zfext_ExtMgm (actually defaultController, defaultAction, autoload, 
suffixInClassName and namespace) these will be found in this object too 
(Set by Zfext_ExtMgm::addPItoST43). So for instance when you register 
the above plugin like that:

Zfext_ExtMgm::addPItoST43($_EXTKEY, array(
     'directory' => 'pi1',
     'suffix' => '_pi1',
     'cached' => false,
     'suffixInClassName' => false
));

this will lead to the upper plugin-conf and additionaly to:

config.tx_zfext.resources.zfext.tx_zfextexample_pi1 {
     extKey = zfext_example
     suffixInClassName = 0
}

Do you like that way - or would you prefer to have the configuration for 
each plugin directly in it's USER-object? (I thought that this could 
sometimes lead to problems and misunderstandings)

So, finally i got it more or less - hope this was not to long.

Thank you very much in advance,
Christian

P.S.:
In the example above standard controller class will be in 
EXT:zfext_example/pi1/controllers/IndexController.php and must be named 
Tx_ZfextExample_IndexController (Same pattern for models, forms etc.)
The complete TS-config for zfext in my current test-installation is that:

config {
     tx_zfext {
         resources {
             frontcontroller {
                 controllerdirectory {
                     tx_zfext = EXT:zfext/plugin/controllers
                     tx_zfextexample_pi1 = EXT:zfext_example/pi1/controllers
                 }
                 plugins {
                     pluginAutoloader = Zfext_Controller_Plugin_Autoloader
                 }
                 defaultmodule = tx_zfext
             }
             zfext {
                 autoloadNamespaces = Zfext,Example
                 tx_zfext {
                     autoloader = 0
                     extKey = zfext
                 }
                 tx_zfextexampe_pi1 {
                     extKey = zfext_example

                 }
             }
             db {
                 adapter = TYPO3
             }
             translate {
                 adapter = Zfext_Translate_Adapter_Typo3
                 data = simple
             }
             includePaths {
                 tx_zfext_library = EXT:zfext/library     #added by 
Zfext_ExtMgm::addLibrary('zfext', 'library');
                 tx_examplelibrary = EXT:example_library      #added by 
Zfext_ExtMgm::addLibrary('example_library');
                 zfLibrary =       # Set this to your path to Zend 
Framework library and zfext will add it to include_path
             }
             bootstrap {
                 path = EXT:zfext/library/Zfext/Bootstrap.php
                 class = Zfext_Bootstrap
             }
         }
     }
}




More information about the TYPO3-dev mailing list