php-windows Digest 30 Jan 2010 17:43:59 -0000 Issue 3751

Topics (messages 29832 through 29836):

exception throw from __autoload could not be catched on php 5.3.1
        29832 by: Eric Lee
        29833 by: Venkat Raman Don
        29834 by: Venkat Raman Don
        29835 by: Eric Lee

What about php 5.3 and printers or PHP_PRINTER.DLL ?
        29836 by: Robert

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi php-dev pros,

I got an issue about catching exception throw from __autoload on php 5.3.1.

The manual state that exception throw from __autoload could be catched with
try.. catch statement same as the normal flow.

But I'can archive that even I have copied the same sample code from the
manual.

Here are the code segment.

[[[
function __autoload($name) {
   echo "Want to load $name.\n";
   throw new Exception("Unable to load $name.");
}

try {
   $obj = new NonLoadableClass();
} catch (Exception $e) {
   echo $e->getMessage(), "\n";
}

]]]

Are there anyone experienced this or not ?

Thanks in advance !

Regards,
Eric,

--- End Message ---
--- Begin Message ---
Yes, I am also able to reproduce this in the browser using both 5.3.1 as well 
as 5.3.0 on Windows using IIS.

Seems like a bug.

You may like to file the bug at http://bugs.php.net.

Thanks,
Don.

-----Original Message-----
From: Eric Lee [mailto:pge...@gmail.com] 
Sent: Thursday, January 28, 2010 9:09 PM
To: php-wind...@lists.php.net
Subject: [PHP-WIN] exception throw from __autoload could not be catched on php 
5.3.1

Hi php-dev pros,

I got an issue about catching exception throw from __autoload on php 5.3.1.

The manual state that exception throw from __autoload could be catched with
try.. catch statement same as the normal flow.

But I'can archive that even I have copied the same sample code from the
manual.

Here are the code segment.

[[[
function __autoload($name) {
   echo "Want to load $name.\n";
   throw new Exception("Unable to load $name.");
}

try {
   $obj = new NonLoadableClass();
} catch (Exception $e) {
   echo $e->getMessage(), "\n";
}

]]]

Are there anyone experienced this or not ?

Thanks in advance !

Regards,
Eric,

--- End Message ---
--- Begin Message ---
On second thought, the output I am getting:

Want to load NonLoadableClass. Unable to load NonLoadableClass.

is consistent with the example on php.net ( 
http://php.net/manual/en/language.oop5.autoload.php ).

So sorry about previous mail. This is not reproing for me. Are you running it 
using PHP command line? This is not supported in CLI mode. Can you paste the 
output you are getting?

I modified the program to:

<?php

function __autoload($name) {
   echo "Want to load $name.\n";
   throw new Exception("Unable to load $name."); }

try {
   $obj = new NonLoadableClass();
} catch (Exception $e) {
   echo "Don\n";
   echo $e->getMessage(), "\n";
}

?>

And I get the output as:
Want to load NonLoadableClass. Don Unable to load NonLoadableClass.

So I can see 'Don' getting printed in the browser. Please let us know the 
output you are getting.

Thanks,
Don.

-----Original Message-----
From: Venkat Raman Don [mailto:don.ra...@microsoft.com] 
Sent: Thursday, January 28, 2010 9:48 PM
To: Eric Lee; php-wind...@lists.php.net
Subject: RE: [PHP-WIN] exception throw from __autoload could not be catched on 
php 5.3.1

Yes, I am also able to reproduce this in the browser using both 5.3.1 as well 
as 5.3.0 on Windows using IIS.

Seems like a bug.

You may like to file the bug at http://bugs.php.net.

Thanks,
Don.

-----Original Message-----
From: Eric Lee [mailto:pge...@gmail.com] 
Sent: Thursday, January 28, 2010 9:09 PM
To: php-wind...@lists.php.net
Subject: [PHP-WIN] exception throw from __autoload could not be catched on php 
5.3.1

Hi php-dev pros,

I got an issue about catching exception throw from __autoload on php 5.3.1.

The manual state that exception throw from __autoload could be catched with
try.. catch statement same as the normal flow.

But I'can archive that even I have copied the same sample code from the
manual.

Here are the code segment.

[[[
function __autoload($name) {
   echo "Want to load $name.\n";
   throw new Exception("Unable to load $name.");
}

try {
   $obj = new NonLoadableClass();
} catch (Exception $e) {
   echo $e->getMessage(), "\n";
}

]]]

Are there anyone experienced this or not ?

Thanks in advance !

Regards,
Eric,

--- End Message ---
--- Begin Message ---
Don.


I'am sorry that the issue have been solved and  that is due to I missed
something in the code ! !
And it works fine now.

Thanks for you help ! !




Regards,
Eric,




On Fri, Jan 29, 2010 at 2:08 PM, Venkat Raman Don
<don.ra...@microsoft.com>wrote:

> On second thought, the output I am getting:
>
> Want to load NonLoadableClass. Unable to load NonLoadableClass.
>
> is consistent with the example on php.net (
> http://php.net/manual/en/language.oop5.autoload.php ).
>
> So sorry about previous mail. This is not reproing for me. Are you running
> it using PHP command line? This is not supported in CLI mode. Can you paste
> the output you are getting?
>
> I modified the program to:
>
> <?php
>
> function __autoload($name) {
>   echo "Want to load $name.\n";
>   throw new Exception("Unable to load $name."); }
>
> try {
>   $obj = new NonLoadableClass();
> } catch (Exception $e) {
>    echo "Don\n";
>   echo $e->getMessage(), "\n";
> }
>
> ?>
>
> And I get the output as:
> Want to load NonLoadableClass. Don Unable to load NonLoadableClass.
>
> So I can see 'Don' getting printed in the browser. Please let us know the
> output you are getting.
>
> Thanks,
> Don.
>
> -----Original Message-----
> From: Venkat Raman Don [mailto:don.ra...@microsoft.com]
> Sent: Thursday, January 28, 2010 9:48 PM
> To: Eric Lee; php-wind...@lists.php.net
> Subject: RE: [PHP-WIN] exception throw from __autoload could not be catched
> on php 5.3.1
>
> Yes, I am also able to reproduce this in the browser using both 5.3.1 as
> well as 5.3.0 on Windows using IIS.
>
> Seems like a bug.
>
> You may like to file the bug at http://bugs.php.net.
>
> Thanks,
> Don.
>
> -----Original Message-----
> From: Eric Lee [mailto:pge...@gmail.com]
> Sent: Thursday, January 28, 2010 9:09 PM
> To: php-wind...@lists.php.net
> Subject: [PHP-WIN] exception throw from __autoload could not be catched on
> php 5.3.1
>
> Hi php-dev pros,
>
> I got an issue about catching exception throw from __autoload on php 5.3.1.
>
> The manual state that exception throw from __autoload could be catched with
> try.. catch statement same as the normal flow.
>
> But I'can archive that even I have copied the same sample code from the
> manual.
>
> Here are the code segment.
>
> [[[
> function __autoload($name) {
>   echo "Want to load $name.\n";
>   throw new Exception("Unable to load $name.");
> }
>
> try {
>   $obj = new NonLoadableClass();
> } catch (Exception $e) {
>   echo $e->getMessage(), "\n";
> }
>
> ]]]
>
> Are there anyone experienced this or not ?
>
> Thanks in advance !
>
> Regards,
> Eric,
>

--- End Message ---
--- Begin Message ---
Hi to all of you dear friends.

Is still possible to print from php scripts directly to server's attached 
printers?
(here it is php for windows, so this question is intended as to print on a 
windows server WAMP)

Thank you for any update.

A related curiosity is about PHP_PRINTER.DLL. Has that dll been abandoned?

Mr. Pierre Joye is publishing one intended (seems) to fit on php 5.2.8
http://downloads.php.net/pierre/

but using it with last apache makes that extension to not be loaded (checked 
on apache error log). So playing with search engines i've found (looks like) 
that the higher php version usable with php_printer.dll is

PHP 5.2.8 with pecl for PHP 5.2.6
http://us2.php.net/get/pecl-5.2.6-Win32.zip/from/a/mirror

it does work, already verified.

Yes, cool! ... But the behaviour is that this does not allow me to upgrade 
MySQL. (* see at bottom)

Next issue/question: seems to me that pecl collections later than 5.2.6 are 
not available. Isn't it?

Thank you for any help or tip on how to upgrade PHP and still be able to 
print directly to server's attached printers from php scripts.

Kind regards

Robert

(*) about MySQL upgrade (off topic but just to explain my request)
With the WAMP environment I've installed phpmyadmin.
I was going to install MySQL 5.1.42 but...
Well, using the libmysql.dll provided with PHP 5.2.8 makes a warning appear 
in the phpmyadmin server home page. The warning says:
"Your PHP MySQL library version 5.0.51a differs from your MySQL server 
version 5.1.xx. This may cause unpredictable behavior"
Again on search engines...: appeared a solution like "overwrite the php 
provided libmysql.dll you copied in \system32 directory with the one in the 
mysql installation directory".
Tried.

This doesn't work and crashes apache as soon I attempt to login phpmyadmin.

So, for the moment, the only solution I've found has been to remove MySQL 
5.1.42 and install MySQL 5.0.90 (community). Apache is 2.2.14. Windows is 
2008 server standard edition. 



--- End Message ---

Reply via email to