Jump to content

Extensions idea


ingyingamar

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.