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

Christopher Christopher at temporaryforwarding.com
Tue Dec 16 14:27:24 CET 2008


Hi Dmitry!

"Dmitry Dulepov" <dmitry at typo3.org> schrieb im Newsbeitrag 
news:mailman.1.1229416481.1459.typo3-english at lists.netfielders.de...
> Hi!
>
> Christopher wrote:
>> unfortunatelly it does not work.
>> among other things I have tried the follwing code:
>>
>> <?php
>> function user_checkOS($os) {
>>
>>   if (TYPO3_OS == 'WIN') {
>>       $os = 'Windows';
>>       # That should be the way you meant it...
>>       return $os;
>>   }
>>   else {
>>    $os = 'other';
>>    return $os;
>>   }
>> }
>>
>> ?>
>
> This will not work because you always return what is considered "true". 
> This function must return true or false. You return $os, which will always 
> be treated as true.


So it should be the following?
if (TYPO3_OS == 'WIN') {
    return $os == "Windows";
}
else {
    return $os == "different";
}


TS:
includeLibs.user_checkOS = fileadmin/script/user_checkOS.php
[userFunc = user_checkOS("Windows")]
config.locale_all = german
[ELSE]
config.locale_all = de_DE
[global]

Regards

Christopher 




More information about the TYPO3-english mailing list