[TYPO3-english] Is there a condition to check the OS of the server?
Dmitry Dulepov
dmitry at typo3.org
Tue Dec 16 09:34:41 CET 2008
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.
--
Dmitry Dulepov
TYPO3 core team
In the blog: http://typo3bloke.net/post-details/how_will_i_fix_bugs_in_extensions_from_now_on/
My TYPO3 book: http://www.packtpub.com/typo3-extension-development/book
More information about the TYPO3-english
mailing list