[TYPO3-dev] scheduler and doNotLoadInFE
Jigal van Hemert
jigal at xs4all.nl
Sun Apr 3 08:40:41 CEST 2011
Hi,
On 2-4-2011 21:24, Thomas Kowtsch wrote:
> if (t3lib_div::inList($TYPO3_CONF_VARS['EXT']['extList'], 'scheduler')) {
> $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList_FE'] .= ',scheduler';
> [...]
> }
>
> in the ext_localconf.php
>
> Withing the extension code, we try to use this code:
>
> if (t3lib_extMgm::isLoaded('scheduler')) {
> require_once(t3lib_extMgm::extPath('scheduler').'class.tx_scheduler.php');
> [...]
> }
>
> But it never gets executed because extMgm::isLoaded returns false :-(
I think it requires a bit of DIY to actually load the scheduler. Looking
at the code in t3lib_extMgm when "loading" the extensions it checks the
extension type, build the paths to it and creates the temp_CACHED*
files. These are used for the actual loading.
Since scheduler isn't included in the frontend temp_CACHED* file you
need to do all the checks yourself and add scheduler to the loaded
extensions:
// find type of ext and determine paths
// add these to the global TYPO3_LOADED_EXT
$temp_extKey = 'scheduler';
if (@is_dir(PATH_typo3conf . 'ext/' . $temp_extKey . '/')) {
$GLOBALS['TYPO3_LOADED_EXT'][$temp_extKey] = array('type' => 'L',
'siteRelPath' => 'typo3conf/ext/' . $temp_extKey . '/', 'typo3RelPath'
=> '../typo3conf/ext/' . $temp_extKey . '/');
} elseif (@is_dir(PATH_typo3 . 'ext/' . $temp_extKey . '/')) {
$GLOBALS['TYPO3_LOADED_EXT'][$temp_extKey] = array('type' => 'G',
'siteRelPath' => TYPO3_mainDir . 'ext/' . $temp_extKey . '/',
'typo3RelPath' => 'ext/' . $temp_extKey . '/');
} elseif (@is_dir(PATH_typo3 . 'sysext/' . $temp_extKey . '/')) {
$GLOBALS['TYPO3_LOADED_EXT'][$temp_extKey] = array('type' => 'S',
'siteRelPath' => TYPO3_mainDir . 'sysext/' . $temp_extKey . '/',
'typo3RelPath' => 'sysext/' . $temp_extKey . '/');
}
After this t3lib_extMgm::extPath() and extRelPath know about the loaded
extension and you can use them to include the necessary files (e.g.
ext_localconf.php). This last part is probably necessary because it is
not included in the frontend temp_CACHED* file.
Also the autoload features of TYPO3 should also work as expected.
(Code untested)
--
Kind regards / met vriendelijke groet,
Jigal van Hemert.
More information about the TYPO3-dev
mailing list