ingyingamar Posted November 23, 2007 Share Posted November 23, 2007 In reference to posts by myself and another (links below) there seems to be an issue with protecting source code and making reusable code across multiple virtual domains. Here is an idea that I have that might partially solve both issues if someone is interested (I do not program in C). Create an extension (or module?) that when php starts would load a /folder (outside any virtual host dir of course) with php files. It would then 'register' the file name (minus the .php extension of course) as a builtin 'FUNCTION', allowing that function/file to be called when needed.... It seems to me that this would protect source code from prying eyes and allow anyone to create a serverwide set of functions that any virtual host can access. Is this even possible? Would anyone be interested in doing this? I'm amazed that this isn't built into PH already....... http://www.phpfreaks.com/forums/index.php/topic,168859.0.html http://www.phpfreaks.com/forums/index.php/topic,126931.0.html Quote Link to comment Share on other sites More sharing options...
trq Posted November 23, 2007 Share Posted November 23, 2007 This is simple enough to do using the auto_prepend_file ini directive. All you need do then is make sure the file being included is owned by the same user that apache uses (www-data on my machine) and that it is chmoded to 661. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.