php-general Digest 24 Dec 2007 05:02:35 -0000 Issue 5197

Topics (messages 266237 through 266252):

Re: html to doc and pdf ??
        266237 by: Bastien Koert

questions about php's configure script ... (somewhat Mac OS X related)
        266238 by: Jochem Maas

PHP interprocesss communication
        266239 by: Christophe Gosiau

Try{} Catch()
        266240 by: Al
        266241 by: Martin Alterisio
        266242 by: Al
        266243 by: Christophe Gosiau
        266250 by: ked

Asynchronous socket connection timing issue.
        266244 by: Nicolas Le Gland

Php exec
        266245 by: mattias
        266246 by: Christophe Gosiau
        266248 by: mattias

PHP 5.3.0
        266247 by: Jaden Abbott

Re: about __get,__set Overloading, read-only properties
        266249 by: ked

is there have something in php that allows method redispatch?
        266251 by: Wan Chaowei
        266252 by: Wan Chaowei

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 ---
PDF is easy, there are many packages and classes that can convert the html to 
PDFs. A quick google will give you lots of results like

www.fpdf.org
http://www.digitaljunkies.ca/dompdf/

etc

word docs will be harder to create

bastien
_________________________________________________________________
Discover new ways to stay in touch with Windows Live! Visit the City @ Live 
today!
http://getyourliveid.ca/?icid=LIVEIDENCA006

--- End Message ---
--- Begin Message ---
having gone through configure and compile hell getting php built on Mac OS X 
Leopard I have
become a little more familiar with the intricasies of compiling software ... 
undoubtly I
still have a heap to learn.

to that end I was hoping someone could shed some light on the following queries

1. what exactly do --with-libdir and --disable-rpath do and how/when should 
they be used?

2. php's configure says it does not support --disable-dependency-tracking but 
apparently
it's a general configure option that is 'always' available .. is this true? and 
what is it
for? (the entropy.ch php5.2.5.release1 tarball contains a php binary which says 
that this
option was used in it's configure line)

3. how does one build a 64bit version of php? (or better yet a [Mac OS X] 
universal binary)

4. do I need to care about building shared extensions 
(--with-foobar=shared,/usr/local/foobar/),
whats the point unless your release the build for other people to use?

--- End Message ---
--- Begin Message ---
Hi,
I'm trying to write the following program:
A browser connects to an apache web-server where a PHP application is running. Most of the actions of the application are Mysql database actions. There are however also actions that needs to be done on the client side but that are not possible inside a browser (output to a display on a serial connection, printing to multiple printers...). For these actions I wrote a .NET program that is running on the client side and makes a TCP connection to a PHP server that is running on the same server as the webserver. This PHP server is a multithreaded server that spawns child threads. Every connection from every user is handled by a seperate child thread.

So, on the client side, I have a .NET program with a persistent connection to the PHP server and a browser connecting to apache that runs a PHP application. If the user chooses to perform an action that needs to be done on the client side (let's say output data to a serial connection), the webserver needs to tell the PHP server to send data to the clients .NET program (who will makes the final serial connection).

The problems I have with this setup are:
1) How does my PHP application finds out what thread is handling the TCP connection according to the user who is logged in into the application? 2) What is the best way to send a command to this thread? Shared Memory? Socket Pairs? Named Pipes? 3) Has anyone already made a similar setup or does anyone has good documentation about interprocess communication?

thx
Christophe

--- End Message ---
--- Begin Message ---
Try() and Catch() seems neat; but, I've not found it to be very practical.

Anyone using it? How?

Al...

--- End Message ---
--- Begin Message ---
It's not supposed to be practical, it's just a way to handle errors. You
shouldn't rely on try/catch for algorithm implementation.

You create exceptions for errors and unexpected behavior. Then in some other
part of the system you use try/catch to prevent the code from terminating
abruptly. You catch the exception (you should know which exceptions can be
thrown), and act accordingly. Either closing resources, add a log message
with debug information, and/or sending an error message to the user.

2007/12/23, Al <[EMAIL PROTECTED]>:
>
> Try() and Catch() seems neat; but, I've not found it to be very practical.
>
> Anyone using it? How?
>
> Al...
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message --- I understand it's intended use and how to use it, have just not found a good use for it yet.



Martin Alterisio wrote:
It's not supposed to be practical, it's just a way to handle errors. You
shouldn't rely on try/catch for algorithm implementation.

You create exceptions for errors and unexpected behavior. Then in some other
part of the system you use try/catch to prevent the code from terminating
abruptly. You catch the exception (you should know which exceptions can be
thrown), and act accordingly. Either closing resources, add a log message
with debug information, and/or sending an error message to the user.

2007/12/23, Al <[EMAIL PROTECTED]>:
Try() and Catch() seems neat; but, I've not found it to be very practical.

Anyone using it? How?

Al...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message --- Try{} catch{} makes more sense when your application is Object Oriented and you use the MVC model. Your library performs some actions but when an error occures, it can't write directly to your browser. Your modules speak with your library and checks if an error occures.. If so a decent error message can be shown...


Al schreef:
Try() and Catch() seems neat; but, I've not found it to be very practical.

Anyone using it? How?

Al...

--- End Message ---
--- Begin Message ---
use it just like in JAVA, It offers a uniform/good way to  manage exception
in app.  
e.g. 
function getObjFromDB($key)
{
if (strlen($key)!=0 )
throw new Exception ("need condition .");
if (!mysql_connect(...))
throw new Exception ("can't connect to db .");
.....
}

function foo ()
{
$err='';
for (...)
{
try
{
getObjFromDB('');
}
catch (Exception $e) // if you throw a exception but didn't catch it , the
PHP app will stop and not prompt any error message.
{
        echo $e; //output the error message.
        $err .= $e;
} 
}
echo "done , total message : {$err}";
}
 


> -----Original Message-----
> From: Al [mailto:[EMAIL PROTECTED] 
> Sent: Monday, December 24, 2007 5:59 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Try{} Catch()
> 
> I understand it's intended use and how to use it, have just 
> not found a good use for it yet.
> 
> 
> 
> Martin Alterisio wrote:
> > It's not supposed to be practical, it's just a way to 
> handle errors. You
> > shouldn't rely on try/catch for algorithm implementation.
> > 
> > You create exceptions for errors and unexpected behavior. 
> Then in some other
> > part of the system you use try/catch to prevent the code 
> from terminating
> > abruptly. You catch the exception (you should know which 
> exceptions can be
> > thrown), and act accordingly. Either closing resources, add 
> a log message
> > with debug information, and/or sending an error message to the user.
> > 
> > 2007/12/23, Al <[EMAIL PROTECTED]>:
> >> Try() and Catch() seems neat; but, I've not found it to be 
> very practical.
> >>
> >> Anyone using it? How?
> >>
> >> Al...
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

--- End Message ---
--- Begin Message ---
Hello everyone here.

This is my first post in this newsgroup, I hope I won't be to much
off-topic. Feel free to redirect me to any better group.


I am getting strange timing issues when failing to asynchronously connect
sockets on closed or filtered ports, but I'm quite unsure if this is a PHP
issue or my misunderstanding, as it seems that socket streams only wrap
around <sys/socket.h>.

I'm running the latest 5.2.5.5 Windows PHP build downloaded yesterday,
running from the command line without any configuration changed from
default. My code is at http://rafb.net/p/DEwN8J71.html with results at
http://rafb.net/p/cnB4dC80.html


Connecting to an open port seems consistent between synchronous and
asynchronous sockets. Opening the socket is instantaneous, connection
establishes in 0.17 seconds, and closing is fast.

Connecting to a filtered port ends up with a socket timeout, but
asynchronous socket closing blocks for 0.5 second which is quite huge. No
network transfer was captured by Wireshark apart from the initial SYN
packet.

Connecting to a closed port with a synchronous socket times out, with
several retries being sent after the server explicitly refused the
connection with a RST ACK. Why doesn't it simply break after the first try ?

Connecting to a closed port with an asynchronous socket takes the time of a
single try, marking the stream as having had an except in stream_select
after RST ACK was received. But here again, fclose()-ing the resource hangs
for 0.5 second.


Why is that an explicitly refused synchronous connection retries until
timeout ? Why doesn't it cancel instantaneously ?

Why is that closing a failed asynchronous socket takes so much time ? It is
really losing a lot of asynchronous' interest if it hangs that long ?


Note that if I don't explicitly fclose() the resources of failed
asynchronous sockets, the same 0.5 seconds lag appears at the end of the
script execution for each one. I guess PHP cleanly frees resources at
shutdown, but it can reach several seconds when several sockets have failed.

Is there another way than fclose() to clear asynchronous sockets ?


Thank you for any advice.

-- 
Nicolas Le Gland

--- End Message ---
--- Begin Message ---
If i use courier-mta
Can i create a php script wich create mailboxes?
And users
Hope any understand

--- End Message ---
--- Begin Message ---
Try to configure courier te read his mailboxes/users from mysql?

mattias schreef:
If i use courier-mta
Can i create a php script wich create mailboxes?
And users
Hope any understand

--- End Message ---
--- Begin Message ---
Yes i have looked in that but not understadn anything

-----Ursprungligt meddelande-----
Från: Christophe Gosiau [mailto:[EMAIL PROTECTED] 
Skickat: den 23 december 2007 23:37
Till: [EMAIL PROTECTED]
Ämne: [PHP] Re: Php exec


Try to configure courier te read his mailboxes/users from mysql?

mattias schreef:
> If i use courier-mta
> Can i create a php script wich create mailboxes?
> And users
> Hope any understand

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Anyone know when PHP 5.3.0 will be out? 5.2.5 is Current and a lot of the 
documentation on php.net is showing that it will be implemented in 5.3.0  such 
as namespaces.

Joshua

       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.

--- End Message ---
--- Begin Message ---
 I think  you misread my pure-hearted thankfulness.I am sorry for my
ambiguous sentence.   
Last reply mean :  I'm  happy to known that we have the same idea,  just
like a student got teacher's praise .
Merry Christmas Eve!


> -----Original Message-----
> From: Jochem Maas [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, December 23, 2007 9:08 AM
> To: ked
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] about __get,__set Overloading, read-only properties
> 
> ked schreef:
> >  My idea is just  your answer...happy..ing  ^_^
> > 
> > You are so warmhearted.  Thanks a lot!  : )
> 
> I don't get accused of that very often. are you being 
> sarcastic or did my suggestion help? (sorry I didn't quite 
> understand your reply)
> 
> > 
> > I will never post a question to a existing thread .
> 
> good. that's one down 1,000,983 to go :-)
> 
> > 

--- End Message ---
--- Begin Message ---
hello all,

i'm poor in english and php. i want to kown is there have something in
php that allows method redispatch?

like this
http://search.cpan.org/~dconway/NEXT-0.60/lib/NEXT.pm

--- End Message ---
--- Begin Message ---
hello all,
i'm poor in php and english,I want to know is there have something in
php that allows method redispatch?

like this
http://search.cpan.org/~dconway/NEXT-0.60/lib/NEXT.pm

--- End Message ---

Reply via email to