Re: Can a PHP 5 Object Be Persisted Past Script End?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, August 17, 2006 12:14 pm, Bruce Bailey wrote:
> In order to improve performance for a socket-based PHP 5 object, I
> would
> like to persist an object beyond the end of a script.  Is there any
> way to
> make this work?  Will PHP 5 automatically destroy the object sometime
> after
> the script ends?

Pretty sure the object will not exist when the script ends.

You can serialize it and store it and bring it back (after require'ing
the class definition, or using autoload) but the serialize/unserialize
has a penalty...

If you are already mucking with sockets and such, you could go
whole-hog and consider writing your own message / distribution
handler, so that your socket-based script never actually ends, so the
object never goes away.

-- 
Like Music?
http://l-i-e.com/artists.htm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux