[TYPO3-english] Is there a condition to check the OS of the server?

Christopher Christopher at temporaryforwarding.com
Wed Dec 17 16:50:55 CET 2008


Hi Dmitry!

"Dmitry Dulepov" <dmitry at typo3.org> schrieb im Newsbeitrag 
news:mailman.1.1229506670.17310.typo3-english at lists.netfielders.de...
> Hi!
>
> Christopher wrote:
>> The follwoing works:
>> Add this to your localconf.php:
>> function user_checkOS($os) {
>>     if (TYPO3_OS == 'WIN') {
>>         # return $os gives back the value,
>>         # which was used to compare in the Typoscript-Condition
>>         # (which is "Windows"; see below).
>>         # So it makes the condition become true.
>>         return $os;
>
> It must not be $os :( It must be "true". You return the wrong thing. It 
> may work but it is technically wrong.

I think that I return $os, which will always be treated as true...

>> If I put the code into a file in fileadmin and use includeLibs like this:
>> includeLibs.user_checkOS = fileadmin/user_checkOS.php
>> it does not work on Windows.
>> The condition in TypoScript does not match.
>> But I think the file is included, because of the following:
>> If I copy the function to localconf.php AND use includeLibs, I get a 
>> "Cannot
>> redeclare..."-error, ("previously declared in localconf.php") in FE.
>
> This is totally wrong. You must not put such things in localconf.php, this 
> is against every TYPO3 practice.

That is not what the docs say:
http://typo3.org/documentation/document-library/references/doc_core_tsref/4.2.0/view/1/4/#id4149527
This document has not been changed for quite some time. If it is wrong, why 
hasn't it been corrected?

>> Why does the condition not work with includeLibs on Windows?
>
> I don't know. I have only Linux and Mac under hand.

I don't know either.
Maybe I just ignore this bug.

Regards

Christopher 




More information about the TYPO3-english mailing list