php-general Digest 22 May 2011 14:31:08 -0000 Issue 7323

2011-05-22 Thread php-general-digest-help
php-general Digest 22 May 2011 14:31:08 - Issue 7323 Topics (messages 313061 through 313071): Re: A Review Request 313061 by: Robert Cummings Re: Closing Session (Revisited) 313062 by: Roger Riordan Re: Check the byte sequence of a file to tell if it is UTF-8 without the

Re: [PHP] Closing Session (Revisited)

2011-05-22 Thread Roger Riordan
On Thu, 05 May 2011 08:28:53 -0400, sstap...@mnsi.net (Steve Staples) wrote: On Thu, 2011-05-05 at 21:41 +1000, Roger Riordan wrote: I have developed a common engine which I use for several different websites. I had been using PHP 5.2.? and IE6 (yes; I know!), and had been able to have

Re: [PHP] Check the byte sequence of a file to tell if it is UTF-8 without the BOM using PHP ?

2011-05-22 Thread Eli Orr (Office)
Hi Adam, I have a prof that the XML advise does not work in real cases I had. We are using XMLs in our system but when you edit the XML with a text editor and put the XML heading of UTF-8 ?xml version=1.0 encoding=UTF-8? it DOES NOT assure the text inside is encoded in UTF-8 so but maybe

Re: [PHP] Check the byte sequence of a file to tell if it is UTF-8 without the BOM using PHP ?

2011-05-22 Thread Peter Lind
On 22 May 2011 08:17, Eli Orr (Office) eli@logodial.com wrote: Hi Adam, I have a prof that the XML advise does not work in real cases I had. We are using XMLs in our system but when you edit the XML with  a text editor and put the XML heading of UTF-8 ?xml version=1.0 encoding=UTF-8?

Re: [PHP] Check the byte sequence of a file to tell if it is UTF-8 without the BOM using PHP ?

2011-05-22 Thread Eli Orr (Office)
Dear Peter, But my point was different. If you DO NOT have any BOM of a File does mb_detect_encodin can detect the file type by scanning the whole file ?? Thanks Eli On 22/05/2011 09:53, Peter Lind wrote: On 22 May 2011 08:17, Eli Orr (Office)eli@logodial.com wrote: Hi Adam, I

Re: [PHP] Check the byte sequence of a file to tell if it is UTF-8 without the BOM using PHP ?

2011-05-22 Thread Peter Lind
On 22 May 2011 09:03, Eli Orr (Office) eli@logodial.com wrote: Dear Peter, But my point was different. If you DO NOT have any BOM of a File does mb_detect_encodin can detect the file type by scanning the whole file ?? A few points: 1. top-posting on this list is frowned upon. Please

Re: [PHP] Check the byte sequence of a file to tell if it is UTF-8 without the BOM using PHP ?

2011-05-22 Thread Eli Orr (Office)
Thank you Peter. Can you please advise if mb_detect_encodin does detect the file type by its structure / content? Thanks Eli On 22/05/2011 10:12, Peter Lind wrote: On 22 May 2011 09:03, Eli Orr (Office)eli@logodial.com wrote: Dear Peter, But my point was different. If you DO NOT

[PHP] Queries and Common Practices

2011-05-22 Thread admin
I have been working on a class methods for some time now. I have reached a cross road when it comes to common practice of developing query structure. Long ago I wrote queries where I just called the field I wanted on a particular table unless I was joining them. Example: $query =

Re: [PHP] Queries and Common Practices

2011-05-22 Thread Ashley Sheridan
On Sun, 2011-05-22 at 05:33 -0400, ad...@buskirkgraphics.com wrote: I have been working on a class methods for some time now. I have reached a cross road when it comes to common practice of developing query structure. Long ago I wrote queries where I just called the field I

Re: [PHP] Queries and Common Practices

2011-05-22 Thread Richard Quadling
On 22 May 2011 10:50, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Sun, 2011-05-22 at 05:33 -0400, ad...@buskirkgraphics.com wrote: I have been working on a class methods for some time now. I have reached a cross road when it comes to common practice of developing query structure.

[PHP] context when calling non static method of class in a static way

2011-05-22 Thread Simon Hilz
hi, lets assume the following classes: class Foo{ public function bar() { echo get_class($this); } } class Foobar{ public function callBarStatic() { Foo::bar(); } } the following code results in the output Foobar: $obj = new Foobar();

Re: [PHP] Script ID?

2011-05-22 Thread tedd
At 1:47 PM -0400 5/21/11, Adam Richardson wrote: On Sat, May 21, 2011 at 10:11 AM, tedd mailto:t...@sperling.comt...@sperling.com wrote: Hi gang: Okay, so,what's the best (i.e., most secure) way for your script to identify itself *IF* you plan on using that information later, such as the

Re: [PHP] Queries and Common Practices

2011-05-22 Thread tedd
At 10:50 AM +0100 5/22/11, Ashley Sheridan wrote: -snip- but I also give the table a moniker which lets me shorten the queries as I type: SELECT p.id, p.name FROM people p WHERE p.gender = 'male' This way, I can easily join in other tables, my typing is kept to a minimum as I do it also.

Re: [PHP] Queries and Common Practices

2011-05-22 Thread Dotan Cohen
On Sun, May 22, 2011 at 17:38, tedd tedd.sperl...@gmail.com wrote: SELECT p.id, p.name, a.total FROM people p, accounts.a WHERE gender = 'male' Finding the error in the above code is fun. I'm surprised I spotted, it shows how sensitive one gets to debugging. For that matter, I like the OP's

Re: [PHP] context when calling non static method of class in a static way

2011-05-22 Thread Simon Hilz
Richard, yes! at least my example works. i didn't test it any further; i doubt it is intended that way. Simon Hilz Am 22.05.2011 16:42, schrieb ad...@buskirkgraphics.com: Simon, So without extending foo you can run bar in another class? Richard L. Buskirk -Original

Re: [PHP] context when calling non static method of class in a static way

2011-05-22 Thread Simon Hilz
Mike, yes i know the difference. I actually discovered that by accident when i've forgot to write the static keyword. my code lead to an exception. i wondered about the details of that exception and came to the solution that the behavior as decribed exists. in my opinion one could really use

RE: [PHP] context when calling non static method of class in a static way

2011-05-22 Thread admin
Simon, To be honest if it works, I hope they do not fix it. My only problem is that my classes are typically not in the same file but they are extended. I am going to try that on an extended class and see if I can instantiate a method from another class in a separate file. Richard L.

RE: [PHP] context when calling non static method of class in a static way

2011-05-22 Thread admin
Correct that. I do not know what I was even thinking when I wrote that response. It does not make any sense what so ever. The class is already extended of course I can call a method from it. Sorry Richard L. Buskirk -Original Message- From: Simon Hilz [mailto:simon.h...@gmx.de]

Re: [PHP] context when calling non static method of class in a static way

2011-05-22 Thread Simon Hilz
the good thing about this bug would be, that it's not neccesary to extend a class to use its methods as if they would be defined in the extending class. this way i think it would be possible to implement something like multiple inheritance, which is currently not (that easy) possible. when

Re: [PHP] context when calling non static method of class in a static way

2011-05-22 Thread Peter Lind
class A { public function b() { echo get_class($this); } static function c() { echo get_class($this); } } class B { public function test(){ A::b(); A::c(); } } $b = new B; $b-test(); Generates: Strict Standards: Non-static method A::b()

Re: [PHP] context when calling non static method of class in a static way

2011-05-22 Thread Simon Hilz
i cant reproduce that error. which php version do you use? i've coded an example for a behavior-pattern: = error_reporting(E_ALL E_STRICT); class Car { private $fuel = 0; private $drivenDistance = 0; private $consumption =

Re: [PHP] A Review Request

2011-05-22 Thread tedd
At 5:50 PM +0200 5/22/11, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote: On Sat, 21 May 2011 09:26:02 -0400, tedd wrote: The function strcmp() simply evaluates two strings and reports back -1, 0, or 1 depending upon their alphabetical relationship. It might do that, but don't bet your horse on

Re: [PHP] context when calling non static method of class in a static way

2011-05-22 Thread Richard Quadling
On 22 May 2011 22:44, Simon Hilz simon.h...@gmx.de wrote: i cant reproduce that error. which php version do you use? i've coded an example for a behavior-pattern: Try with ... ?php error_reporting(-1); ini_set('display_errors', 1); class Car { ... I get output of ... Fuel of my new BMW with