[TYPO3-core] RFC #9460: Feature: Add the ability of including external files to includeJS/getFileName
Mikkel Ricky
mikkel at mikkelricky.dk
Tue Dec 23 10:51:07 CET 2008
Martin Kutschker wrote:
> Mikkel Ricky schrieb:
>> This is an SVN patch request.
>>
>> Type: New feature
>>
>> Bugtracker references: http://bugs.typo3.org/view.php?id=9460
>>
>> Branches: trunk
>>
>> Problem: Add the ability of including external files to
>> includeJS/getFileName
>>
>> Solution: Rename original "getFileName" and create a new "getFileName"
>> that acts as a wrapper for the original one:
>
> Why is the old function now a wrapper. Couldn't the new code simply be
> added to the function itself?
It sure could, but it's easier to understand what's going on when a
separate function is used for resolving Typoscript resources.
> Besides that: we don't use private functions only protected. And if it's
> marked in proper PHP5 syntax the function name doesn't need and
> underscore in PHP4 style.
I wasn't aware of the fact that private functions aren't used in TYPO3.
The reason for making the function private is that it's just a utility
function used by (the new) getFilename.
Regarding the name starting with an underscore: I don't like this
either, but when I wrote the code I couldn't come up with a good/better
name for the function. Maybe something like "getTypoScriptResource" can
be used? Or the code could/should be merged into "getFilename".
> I'm not happy with the regexp allowing absolute pathes (Unix style
> only). It's not in the line of the TYPO3 code to allow file access
> outside of the TYPO3 source and data directories.
I understand your concern. It will, however, be nice to be able to
include CSS and JavaScript from absolute urls on the server, e.g. if you
have multiple TYPO3 installations in subdirectories that use some shared
JavaScript libraries on the server (a local copy of YUI
(http://developer.yahoo.com/yui/), say).
I appreciate your comments, and I hope we can find a good solution for
including external CSS and JavaScript resources and, thus, make use of
Google hosting a lot of JavaScript libraries
[http://code.google.com/apis/ajaxlibs/].
Regards,
Mikkel
More information about the TYPO3-team-core
mailing list