Re: [PHP] Detect and Redirect Mobile Users

2013-06-13 Thread Dead Letter.Office
http://php.net/manual/en/misc.configuration.php#ini.browscap http://tempdownloads.browserscap.com/ $browser = get_browser(null, TRUE); if (isset($browser['ismobiledevice']) && ($browser['ismobiledevice'] == TRUE)) { $isMobile = TRUE; } else { $isMobile = FALSE; } unset($browser); -- PHP

Re: [PHP] What is the name of the pattern that will ...

2013-06-13 Thread David Harkness
Hi Richard, On Thu, Jun 13, 2013 at 10:16 AM, Richard Quadling wrote: > I'm building a class which needs to have certain methods called by the > subclass, but the subclass can extend but not obscure/override the > behaviour. > This is the Template Method pattern, though in this case you could us

[PHP] What is the name of the pattern that will ...

2013-06-13 Thread Richard Quadling
Hi. I'm building a class which needs to have certain methods called by the subclass, but the subclass can extend but not obscure/override the behaviour. So, for example, a method AuthRequestMade() will record the activity of making an authorisation request. It cannot make the actual request as th

Re: AW: [PHP] PHP is Zero

2013-06-13 Thread Matijn Woudt
On Thu, Jun 13, 2013 at 1:49 PM, BUSCHKE Daniel < daniel.busc...@nextiraone.eu> wrote: > To be more technical: > > If intval('8315e839da08e2a7afe6dd12ec58245d') would return NULL instead of > 8315 then PHP would be still weak-typed and the developer could know that > the conversion failed. Good id

Re: [PHP] Detect and Redirect Mobile Users

2013-06-13 Thread Camille Hodoul
Hello, I stumbled upon this the other day : http://mobiledetect.net/ I haven't tried it yet, since I have my own small user agent parser when I need it, but it may help you if it's a pure php solution you're looking for. Have a nice day 2013/6/13 dealTek > Hi all, > > I'm curious of a simple,

Re: [PHP] Detect and Redirect Mobile Users

2013-06-13 Thread Matijn Woudt
On Thu, Jun 13, 2013 at 3:20 PM, Matijn Woudt wrote: > > > > On Thu, Jun 13, 2013 at 3:17 AM, Paul M Foster wrote: > >> On Wed, Jun 12, 2013 at 04:19:50PM -0700, dealTek wrote: >> >> > Hi all, >> > >> > I'm curious of a simple, common, universal way to detect a mobile user >> so I can redirect th

Re: [PHP] Detect and Redirect Mobile Users

2013-06-13 Thread Matijn Woudt
On Thu, Jun 13, 2013 at 3:17 AM, Paul M Foster wrote: > On Wed, Jun 12, 2013 at 04:19:50PM -0700, dealTek wrote: > > > Hi all, > > > > I'm curious of a simple, common, universal way to detect a mobile user > so I can redirect them to a mobile directory... > > > > What is best for this: Javascript

Re: [PHP] Enabling the chroot() function in PHP 5.4

2013-06-13 Thread Matijn Woudt
Hi Aaron, It's better if you ask this question on the PHP internals list, there's hardly anyone compiling it's own PHP here. - Matijn On Thu, Jun 13, 2013 at 9:55 AM, Aaron Stephens wrote: > Hi All, > > Does anybody know how to enable the chroot() function in PHP 5.4? It > was easy in PHP

[PHP] Re: AW: AW: PHP is Zero

2013-06-13 Thread Alessandro Pellizzari
Il Thu, 13 Jun 2013 13:27:51 +0200, BUSCHKE Daniel ha scritto: > Why is PHP doing that? Because a decision had to be made, and they chose to do it that way. > I know it works as designed and I know it is > documented like this but that does not mean that it is a good feature, > does it? It is a

Re: [PHP] Detect and Redirect Mobile Users

2013-06-13 Thread raphael khaiat
Hi, On Thu, Jun 13, 2013 at 1:19 AM, dealTek wrote: > Hi all, > > I'm curious of a simple, common, universal way to detect a mobile user so > I can redirect them to a mobile directory... > > What is best for this: Javascript - CSS - PHP? > > I think for my purposes if I can detect screen size or

Re: [PHP] PHP is Zero

2013-06-13 Thread Samuel Lopes Grigolato
Just found out that MySQL uses the same implicit conversion precedence on SQL clauses. That shows me that possibly exists some "higher order" rule that states this consistency, and changing that is outside the scope of PHP. On Thu, Jun 13, 2013 at 9:20 AM, Stuart Dallas wrote: > On 13 Jun 2013,

Re: [PHP] PHP is Zero

2013-06-13 Thread Stuart Dallas
On 13 Jun 2013, at 12:27, BUSCHKE Daniel wrote: > Hi, > >> It gives up when it finds a non-numeric character (as the documentation >> would tell you) > > Why is PHP doing that? I know it works as designed and I know it is > documented like this but that does not mean that it is a good feature

Re: AW: [PHP] PHP is Zero

2013-06-13 Thread Samuel Lopes Grigolato
I agree with you that this is a confusing and error-prone behavior, but I also agree with Richard Gray, I wouldn't try to change this for the same reason that a "1+1=3" shouldn't be touched if it's "correct" on a huge amount of existing codebases... On Thu, Jun 13, 2013 at 8:49 AM, BUSCHKE Danie

AW: AW: [PHP] PHP is Zero

2013-06-13 Thread BUSCHKE Daniel
To be more technical: If intval('8315e839da08e2a7afe6dd12ec58245d') would return NULL instead of 8315 then PHP would be still weak-typed and the developer could know that the conversion failed. Good idea? Of course NULL should be transparent in operations like +. So 0 + NULL should be still 0.

AW: AW: [PHP] PHP is Zero

2013-06-13 Thread BUSCHKE Daniel
Hi, > It gives up when it finds a non-numeric character (as the documentation would > tell you) Why is PHP doing that? I know it works as designed and I know it is documented like this but that does not mean that it is a good feature, does it? So lets talk about the question: Is that behaviour

Re: AW: [PHP] PHP is Zero

2013-06-13 Thread Pete Ford
On 13/06/13 10:44, BUSCHKE Daniel wrote: Hi, thanks for your answer. Especially the answer "42" made me laughing :) My "Why" questions should be understand as "Why must it be like that" questions. On 13/06/13 08:59, BUSCHKE Daniel wrote: 5. Thats a bug I have opend: https://bugs.php.net/bug.ph

Re: AW: [PHP] PHP is Zero

2013-06-13 Thread richard gray
On 13/06/2013 11:44, BUSCHKE Daniel wrote: Hi, thanks for your answer. Especially the answer "42" made me laughing :) My "Why" questions should be understand as "Why must it be like that" questions. On 13/06/13 08:59, BUSCHKE Daniel wrote: 5. Thats a bug I have opend: https://bugs.php.net/bug

AW: [PHP] PHP is Zero

2013-06-13 Thread BUSCHKE Daniel
Hi, thanks for your answer. Especially the answer "42" made me laughing :) My "Why" questions should be understand as "Why must it be like that" questions. >> On 13/06/13 08:59, BUSCHKE Daniel wrote: >> 5. Thats a bug I have opend: https://bugs.php.net/bug.php?id=51739 where I >> also had the sa

Re: [PHP] PHP is Zero

2013-06-13 Thread Pete Ford
On 13/06/13 08:59, BUSCHKE Daniel wrote: Hi all, I want to start a discussion about a PHP behaviour that drives me crazy for years. For the beginning I would like you to guess what the result of the following snippet will be: var_dump('PHP' == 0); I know the difference of == and === but the r

AW: [PHP] PHP is Zero

2013-06-13 Thread BUSCHKE Daniel
Hi, I used 2 x =. Using 3 x = would not result in that behaviour because string is not equal to number. I am fine === here. I explicitly talk about the 2 x = variant. BTW: # php -r 'var_dump("PHP" == 0);' bool(true) # php -r 'var_dump("PHP" == 1);' bool(false) regards Daniel -Ursprünglich

Re: [PHP] PHP is Zero

2013-06-13 Thread georg
Sorry missed to post list as well Hi Daniel, here is wild goose i assume you have 3 x = in your "problem" formulation which could possibly result in the akward standard C mixup; the rightmost = first parsed and resulting in an ASSIGMENT to the variable with that value, the comes the parsing of

[PHP] PHP is Zero

2013-06-13 Thread BUSCHKE Daniel
Hi all, I want to start a discussion about a PHP behaviour that drives me crazy for years. For the beginning I would like you to guess what the result of the following snippet will be: var_dump('PHP' == 0); I know the difference of == and === but the result was unexcpected for me. And I hope

[PHP] Enabling the chroot() function in PHP 5.4

2013-06-13 Thread Aaron Stephens
Hi All, Does anybody know how to enable the chroot() function in PHP 5.4? It was easy in PHP 5.3 as long as you were building the CLI by itself. In the PHP 5.4 configure script there is a new PHP_BINARIES variable being used instead of setting PHP_SAPI=cli and thus the "#define ENABLE_C