RE: [PHP] Static constants? Server persistent?
| From: | Lance Lovette | Date: | Sat, 05 Oct 2002 23:40:23 +0000 |
| Subject: | RE: [PHP] Static constants? Server persistent? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118974@lists.php.net to get a copy of this message | ||
I wrote the PWEE PHP extension to solve this exact problem.
http://pwee.sourceforge.net
It's great for constants but it's true power comes from "executor
persistent" variables. I haven't updated the web site but it does work with
PHP 4.2.3.
Lance
> -----Original Message-----
> From: Jean-Christian Imbeault [mailto:jean_christian@myrealbox.com]
> Sent: Sunday, September 29, 2002 6:59 AM
> To: php-general@lists.php.net
> Subject: [PHP] Static constants? Server persistent?
>
>
> This is a bit hard for me to explain but is there any way to have PHP
> store a persistent server-side constant. Something that will stay in RAM
> and is not dependent on client connection.
>
> For example I have this code in consts.inc file:
>
> define ("HOME_PAGE",
> "http://myip.com/index.html);
>
> But if I want access to the constant I need to include the file in every
> script that needs it.
>
> I am hoping there is some way to say to the PHP engine, "this is a
> static constant that will never change, keep it RAM, and share it
> between invocations/children".
>
> Is this feasible? Is it is I could then "cache" whole blocks of static
> HTML and that would speed up my scripts quite a bit ... AND my my life
> as a programmer easier since I wouldn't have to always have an
> "include("conts.inc")" statement at the top of each of my scripts ...
>
> Jc
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>