Re: Persistent Objects

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

 



On Sunday 15 July 2007 19:58:09 Wesley Acheson wrote:
> Hi,
>
> At work we use Java so one thing is annoying me. Is there really no
> way to create a persistent object in PHP?  As far as my understanding
> goes each object will be recreated on each and every request.
>
> The reason I was asking is I wanted to create a form object that would
> be used as follows.
>
> which would require recreating the from stuff three times at least
> Once for a JS file. Once for a HTML output.  And once for Server side
> validation)
>
> Please note that the following is just an example off the top of my
> head the code to do this hasn't been written yet and the exact
> implemantation may be different.  It would be much better to only
> create the object once.
>
Hi,

Normally you have to recrate your objects in every request. IN php universe 
everything was each request.

Unless you do someting manually.
Best way was shared memory storages, like memcached. you can use Memcached to 
store your objects (I'm note sure to store object in real or serialized).

If you havent access memcached in your hosting you may try serialized object 
in sql or flat file. 

Also you can store our session with memcached or sql too. Also there where 
another shared memory storage around there (I forgot its name, plesae search 
archives of the list) It has much more capabilites than memcached and it has 
no packages (a bit difficult the install).

Also if you have any php opcode chace please use it was very helpfull 
(especially APC)

Regards

Sancar

-- 
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