Re: Persistant global objects: WAS: RE: [PHP-DEV] ZendEngine2 availability

From: Date: Fri, 06 Sep 2002 04:07:11 +0000
Subject: Re: Persistant global objects: WAS: RE: [PHP-DEV] ZendEngine2 availability
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-87985@lists.php.net to get a copy of this message
I forgot msession extension. http://www.mohawksoft.com/phoenix/msession.html the rpc extension may also be of interest - (not know the code that well, I'm guessing it may be able to provide a more efficient object serialization), although I doubt that the current string method is really that bad Just a guess, but trying to isolate the data that needs 'sessionizing' and optimizing that, rather than planning object serialization (which may be easier to code), may prove to be quicker to implement, although not as clean.. Regards alan Tyson Lloyd Thwaites wrote:
Something like that would be great. Do you mean store the *PHP object in smh, after serialization, or do it on the Zend side from within an extension? I guess what I am after is the ability to cache certain data objects so that they can be retrieved with maximum speed, because there will be thousands of them. <!-- background A bit of background, I am using an EntityLocator object that looks for Entity objects of the specified type and id (ie, table/pkey). It uses an EntityFactory which will save every object it creates out to disk. If an object is requested of the same class and id, it will deserialize the saved one and return that. Obviously these objects expire their cached version when they are updated or deleted. --> If these data objects could be written in C, and stored in some great global washing basket in the sky, then that would just be great. Threaded access will be an issue, but we can deal with that by using a single Application object. I just have a feeling that all the serialize/deserialization that is happening now will be bad for scalability, when it constantly needs to hit the disk to create these objects. Just a few thoughts. I would love to come up with a funky solution to this. (PS: AFAIK ASP Application vars are actually stored in a seperate, single-threaded containter. This is somewhat amusing, as many programmers (myself included once :) store database connection objects in the Application to save having to reconnect - little did we realise that there might 100's of different requests all queueing up to use this single connection...heh heh :) Thanks for your help, Tyson Lloyd Thwaites Technical Lead I.T&e Limited
-----Original Message----- From: Rasmus Lerdorf [mailto:rasmus@php.net] Sent: Friday, 6 September 2002 12:19 To: Tyson Lloyd Thwaites Cc: php-dev@lists.php.net Subject: Re: [PHP-DEV] Persistant global objects: WAS: RE: [PHP-DEV] ZendEngine2 availability You could just stick it in shared memory. Obviously given the standard multi-process Apache architecture application objects ASP-style cannot be implemented the same way. -Rasmus On Fri, 6 Sep 2002, Tyson Lloyd Thwaites wrote:
Hi guys, thanks for your help, I was able to get a Z2 build up and running. Unfortunately it didn't appear to be quite stable enough for
     
what I'm doing
yet, but at least it is cmoing along nicely! One question while I'm here: I'm interested in persistant
     
global objects,
like ASP's Application objects. I am sure this has been talked
     
out on the
list before, but I did a quick search and couldn't find anything. Is this possible? Yesterday I wrote my first PHP test extension (Yay! I'm so
     
happy - until now
I've been terrified of it!) I was able to register a class in the zend engine (after to looking at the PECL stuff), but I was
     
wondering whether I
could register a live, running object somewhere so that all
     
scripts could
access it across requests? Would this maybe even require access to an external engine written in C? At the moment I have a static Application object in PHP that just writes serialized objects to disk. This is not quite the same as
     
having the object
staying in ram though. I have implemented a Factory class that
     
creates data
objects and caches them to prevent database hits, and this speeds the process up by about 400%. But there will be thousands and
     
thousands of these
objects, and I would love to store them in RAM. I know this sort of thing should really be written in Java, but
     
I decided to
stick with PHP for this project so there is no going back! Any comments, corrections, put-back-in-boxes, or thoughts on
     
how to do this
will be ecstatically (get it? static? never mind) received. Cheers Tyson Lloyd Thwaites Technical Lead I.T&e Limited
     
-----Original Message----- From: Rasmus Lerdorf [mailto:rasmus@php.net] Sent: Thursday, 5 September 2002 5:50 To: Zeev Suraski Cc: Tyson Lloyd Thwaites; dhardiker@staff.firstcreative.net; php-dev@lists.php.net Subject: RE: [PHP-DEV] ZendEngine2 availability Or just checkout php4-ze2 instead and you will get everything
       
in one go
named correctly. On Thu, 5 Sep 2002, Zeev Suraski wrote:
       
Not sure why nobody stepped in and said it, but the Engine2 is
         
quite alive
       
and kicking. You just have to work a bit in order to get a
         
fairly recent
       
version. Not so recent version: http://www.php.net/distributions/php-4.3.0-dev-zend2-alpha2.tar.gz
         
http://www.php.net/distributions/php-4.3.0-dev-zend2-win32-alpha2.zip
Getting a recent version - check out the latest version of PHP,
         
erase (or
       
rename) the Zend/ directory inside it, and then check-out the
         
ZendEngine2
       
module from cvs.php.net:/repository. You would have to
         
rename that new
check-out to 'Zend' so that PHP uses it. Once that's done
         
- build, and
you'd have a ZE2-powered version. It's pretty much beta
         
quality at this stage.
       
Zeev At 02:29 05/09/2002, Tyson Lloyd Thwaites wrote:
         
Oh, ok. Sigh! I'll stick with the old engine then. Thanks Tyson Lloyd Thwaites Technical Lead I.T&e Limited
           
-----Original Message----- From: Dan Hardiker [mailto:dhardiker@staff.firstcreative.net] Sent: Wednesday, 4 September 2002 6:36 To: tysonlt@webmedia.com.au Cc: php-dev@lists.php.net Subject: Re: [PHP-DEV] ZendEngine2 availability
             
Sorry if this is out of place, but is there any estimates
               
as to when the
       
famous Z2 might be ready?
               
There is more (accurate) information in the archives of
             
this list, but
       
from what I recall, the estimates were about 6 months off. -- Dan Hardiker [dhardiker@staff.firstcreative.net] ADAM Software & Systems Engineer First Creative Ltd
             
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
           
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
         
       
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php
     
   


« previous php.dev (#87985) next »