[TYPO3-dev] Extend class in extension's creation

Oliver Hader oh at inpublica.de
Tue Sep 26 18:18:09 CEST 2006


Hi,

Hraklis Karvasonis wrote:
> I tried also that, but now i receive the following:
> 
> Warning: main(PATH_t3libclass.t3lib_extmgm.php): failed to open stream:
> No such file or directory in mynewclass.php on line 3

Is it possible that this class/script is not called by TYPO3, but it's
call directly from outside via browser? The 'PATH_t3lib' definition
isn't substituted by the value it should be, so I guess the php script
is called directly.

If this could be answered with "yes", you have to include some TYPO3
specific thingy to be able to use them, for example:

$BACK_PATH = '../../../typo3/';
define('TYPO3_MOD_PATH', '../typo3conf/ext/myextension/');
require_once($BACK_PATH.'init.php');

You could have a look to typo3_src/typo3/wizard_add.php, how this could
be done. You can also have a look to some other Backend Modules of TYPO3
or wizard scripts.

> Fatal error: main(): Failed opening required
> 'PATH_t3libclass.t3lib_extmgm.php' (include_path='.:/usr/share/pear') in
> mynewclass.php on line 3
> 
> Is there any way i can define somewhere that the new class gets all the
> includes like the extension's new class does? Because right now it seems
> that it doesn't find any class i am trying to include there.
> 
> Thanks.
> 
> Oliver Hader wrote:
>> Hraklis Karvasonis wrote:
>>> is Fatal error: Undefined class name 't3lib_extmgm' in mynewclass.php on
>>> line 11
>>
>> Okay, the extmgm is not found, so t3lib_extMgm::extPath isn't working at
>> all. You have to include/require the t3lib-class before using it:
>>
>> require_once(PATH_t3lib.'class.t3lib_extmgm.php');
>> require_once(t3lib_extMgm::extPath('myextension').'class.myextension.php');


olly
-- 
Oliver Hader
http://inpublica.de/




More information about the TYPO3-dev mailing list