Re: Anyone wrote persistent variable extension?
| From: | medvitz | Date: | Sat, 13 Apr 2002 15:29:37 +0000 |
| Subject: | Re: Anyone wrote persistent variable extension? | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-82753@lists.php.net to get a copy of this message | ||
You've posted on this a couple of times. The thing with srm is that
they're set up as 'remote' functions. In order to get to a function, to
have to contact a (net necessarily) remote daemon. While I do agree that
this is cool and useful functionality, what I'm looking for is something
that IMHO is a bit simpler.
Let me explain:
Let's say that for a given web application I have a function library in a
file 'functions.php'. Every page in the site includes this file... I've
even put it in the prepend, so I don't have to remember to do it to every
page. By doing this, all of the desired functions 'magically appear' for
my other scripts to execute. Keeping the include option would allow for
caching of these files, using on of the available cache extensions (APC,
Zend Cache) which would produce a similar effect.
What I'm proposing (for the functions anywats) is that a list of files that
exists in the PHP.ini file get loaded. The functions from these files stay
resident in memory and get merged with the local function table prior to
script execution. In a way, it would function like extensions written in
PHP as opposed to C. This functionality would also exist for class
definitions using the same mechanism.
For variables, I was thinking about a 'registration' process, similar to
how session variables are registered. This registration would not set the
variables to memory, as it does for sessions, you would need to call a
specific function for that. In this way, every process could get a 'base'
data set to work with. Prior to script execution, these variables can be
loaded / copied into the global scope. Alternately, you can retreive them
through a function ( $data = perDataGet($key) )
I hope this makes things more clear. The SEM stuff looks really cool, I
just don't think it fits the needs that I have. We could, however, discuss
further.... I may be wrong.
Medvitz
derick@php.net wrote:
> Hello,
>
> On Fri, 12 Apr 2002, medvitz wrote:
>
>> I'm currently looking into an extension that would allow both persistent
>> variables, as well as persistent functions. At this point I'm still
>> going through the internals to determine the feasibility of such an
>> extension.
>
> I dont want to plug, but SRM can already do this:
> http://www.vl-srm.net/doc/features.remote-functions.php
>
> The documentation still need to be written, but that will follow soon.
>
> Derick
>
> -----------------------------------------------------------------------
> Did I help you? Consider a gift:
> http://www.amazon.co.uk/exec/obidos/registry/SLCB276UZU8B
> -----------------------------------------------------------------------
> PHP: Scripting the Web - derick@php.net
> All your branches are belong to me!
> SRM: Script Running Machine - www.vl-srm.net
> -----------------------------------------------------------------------