Reply to Re: Auto_prepend_file

Your name:

Reply:


Posted by Jerry Stuckle on 05/12/07 19:34

Schraalhans Keukenmeester wrote:
> I am considering using the php 'auto_prepend_file' directive to have a
> few default things loaded and some superglobals unset for all customers
> using my server. The intended file does not produce any output to the
> browser, just sets a few variables, modifies/unsets a few server &
> environment variables, defines a few constants and loads a custom ftp
> class definition.
>
> It seems temptingly easy to do so, but I would like to have some insight
> in what can of worms I may be opening going this route. Are there strong
> arguments pro/against using this feature? Some great examples perhaps?
>
> Thanks for your advice in advance!
> Sh.
>
>

I wouldn't.

Environment variables for all users should be set before Apache starts.
Then they'll all be available. And which superglobals are you
referring to? I'd get fairly upset if one of the superglobals I need is
missing. Same with server variables.

As for variables - what would be the purpose? And what if one of the
scripts I use happens to use those same variables? Or a class with the
same name as your custom ftp class? There's a reason most hosts don't
do this - it can screw up someone's scripts.

Also, you're forcing the parser to parse more code for every PHP script
out there - whether it's needed or not.

Just set everything up in your Apache start script and let it run. And
if you want to give them access to your custom FTP class, let them have it.



--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация