[TYPO3-core] RFC: #13262: replace hardcoded typo3/ with TYPO3_mainDir
Dmitry Dulepov
dmitry.dulepov+t3ml at gmail.com
Mon Jan 18 10:16:13 CET 2010
Hi!
On 2010-01-16 21:35:55 +0200, Georg Ringer said:
> This is an SVN patch request.
>
> Type: Bugfix,nobrainer
>
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=13262
>
> Branches: Trunk, 4.3
>
> Problem:
> The path typo3/ should not be hardcoded as there is a constant for that
>
> Solution:
> Replace it with TYPO3_mainDir
It is a very good move but it is not enough. A week ago I had to rename
typo3/ to something else and it turned out that the worse thing is BE
modules. Many of them has this type of code:
define('TYPO3_MOD_PATH', '../typo3conf/ext/dam/mod_file/');
$BACK_PATH='../../../../typo3/';
Imagine having a hundred extensions with 2-3 modules and going to
rename typo3/ everywhere in conf.php. You can't simply use sed for this
because sometimes typo3/ should stay (like in XCLASSes).
I could not find a way to solve these references automatically.
conf.php is included before init.php where TYPO3_mainDir is defined.
I ended up on adjusting $BACK_PATH in init.php. I checked for "typo3/"
and replaced it with TYPO3_mainDir value. So all modules got proper
path automatically without touching conf.php in extensions. See the
attached file (it is a manually constructed diff, so may not apply
directly).
Would it be a nice addition to the current patch?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: backpath-fix.diff
Type: application/octet-stream
Size: 1052 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100118/92ee5e36/attachment.obj>
-------------- next part --------------
--
Dmitry Dulepov
"Trust me, I am a doctor!" (c) Gregory House, M.D.
More information about the TYPO3-team-core
mailing list