# execute my php code before every php call

- Thread: https://externals.io/message/53254
- Original archive: https://news-web.php.net/php.internals/53254
- Started by techloop on 2011-06-12T18:47:11+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #53254 — techloop — 2011-06-12T18:47:11+00:00

URL: https://externals.io/message/53254#53254

Hi all,

I have a simple code that override some env vars but i need it to run before 
any other php code on every php execution.
I would like to avoid any change of all php code (even if its only to 
include the include command).

Any one knows of such way ?

I dont mind overriding this vars on php configuration file but i dont have 
any control of it as its should work on even the most strict web hosting 
(that still allow env vars manipulation)

Any alternatives ?

Thanks,

TL

---

## #53255 — Pierre Joye — 2011-06-12T19:12:15+00:00

URL: https://externals.io/message/53254#53255 · In reply to: #53254

hi,

It is not really a question for this list but more php-general.

See http://www.php.net/manual/en/ini.core.php#ini.auto-prepend-file

Cheers,


> Hi all,
>
> I have a simple code that override some env vars but i need it to run before
> any other php code on every php execution.
> I would like to avoid any change of all php code (even if its only to
> include the include command).
>
> Any one knows of such way ?
>
> I dont mind overriding this vars on php configuration file but i dont have
> any control of it as its should work on even the most strict web hosting
> (that still allow env vars manipulation)
>
> Any alternatives ?
>
> Thanks,
>
> TL
>
>
>
> --
> 
> 
>
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
