php-general Digest 1 Nov 2009 18:21:46 -0000 Issue 6421
Topics (messages 299547 through 299551):
Re: Two Parser Passes
299547 by: Steve
299548 by: Daniel Kolbo
Time zone discrepancy - America/New_York = CDT?
299549 by: Nathan Lebovic
299550 by: Nathan Lebovic
299551 by: Mattias Thorslund
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Daniel Kolbo wrote:
Hello,
Is it possible to get a list (array) of classes not found in a script
before the fatal error exits the parser. I realize that PHP parses the
script twice. It would be nice at the end of the first parsing pass to
check to see which classes haven't been defined (yet), so that I could
define them before the second pass. This way I could load only those
classes a script needs.
Thanks in advance,
dK
`
It sounds like you are looking for autoload:
http://www.php.net/manual/language.oop5.autoload.php
--- End Message ---
--- Begin Message ---
Steve wrote:
> Daniel Kolbo wrote:
>> Hello,
>>
>> Is it possible to get a list (array) of classes not found in a script
>> before the fatal error exits the parser. I realize that PHP parses the
>> script twice. It would be nice at the end of the first parsing pass to
>> check to see which classes haven't been defined (yet), so that I could
>> define them before the second pass. This way I could load only those
>> classes a script needs.
>>
>> Thanks in advance,
>> dK
>> `
>>
> It sounds like you are looking for autoload:
> http://www.php.net/manual/language.oop5.autoload.php
>
Mr. Steve that's pretty cool. Thanks.
Is there a similar type function for autoloading undefined functions?
Thanks,
dK
`
--- End Message ---
--- Begin Message ---
I'm using PHP 5.2.6; I just updated timezones with PECL timezonedb to make
sure that wasn't the problem.
These are the results that I'm getting, which I cannot figure out:
date_default_timezone_set("America/New_York");
echo date("e"); //output "America/New_York"
echo date("T"); //output "CST"
date_default_timezone_set("EST");
echo date("e"); //output "EST"
echo date("T"); //output "CDT"
Any ideas?
Thanks,
- Nathan
--- End Message ---
--- Begin Message ---
Sorry there was a typo in that output. This is what I'm getting:
date_default_timezone_set("America/New_York");
echo date("e"); //output "America/New_York"
echo date("T"); //output "CST"
date_default_timezone_set("EST");
echo date("e"); //output "EST"
echo date("T"); //output "EST"
- Nathan
On Sun, Nov 1, 2009 at 3:48 AM, Nathan Lebovic <[email protected]> wrote:
>
> I'm using PHP 5.2.6; I just updated timezones with PECL timezonedb to make
> sure that wasn't the problem.
>
> These are the results that I'm getting, which I cannot figure out:
>
> date_default_timezone_set("America/New_York");
> echo date("e"); //output "America/New_York"
> echo date("T"); //output "CST"
>
> date_default_timezone_set("EST");
> echo date("e"); //output "EST"
> echo date("T"); //output "CDT"
>
> Any ideas?
>
> Thanks,
>
> - Nathan
--- End Message ---
--- Begin Message ---
The output I get (after adding newlines to the output) is:
America/New_York
EST
EST
EST
PHP 5.2.10. I suspect this comes from the operating system. Maybe update
your tzdata package if you're on a Linux system.
Cheers,
Mattias
Nathan Lebovic wrote:
Sorry there was a typo in that output. This is what I'm getting:
date_default_timezone_set("America/New_York");
echo date("e"); //output "America/New_York"
echo date("T"); //output "CST"
date_default_timezone_set("EST");
echo date("e"); //output "EST"
echo date("T"); //output "EST"
- Nathan
On Sun, Nov 1, 2009 at 3:48 AM, Nathan Lebovic <[email protected]> wrote:
I'm using PHP 5.2.6; I just updated timezones with PECL timezonedb to make sure
that wasn't the problem.
These are the results that I'm getting, which I cannot figure out:
date_default_timezone_set("America/New_York");
echo date("e"); //output "America/New_York"
echo date("T"); //output "CST"
date_default_timezone_set("EST");
echo date("e"); //output "EST"
echo date("T"); //output "CDT"
Any ideas?
Thanks,
- Nathan
--- End Message ---