I am trying to use the
rename_function()
override_function()
options that are built into the APD php extension. But I don't want to rely on that extension being loaded.
This is another one of my out-of-the-box ideas that presents me with the thought to override the require_once function. During this function call, I want to check for the existence of the same file in another path. If it exists then require that one.. otherwise just do normal require once.
If I use the APD extension it works fine with this:
Code: rename_function('require_once', 'require_once_orig');
override_function('require_once', '$file', 'return require_once_new($file);');
function require_once_new($file) {
$modfile = str_replace(ROOT.'/', ROOT.'/'.MODS.'/', $file);
if (file_exists($modfile)) {
require_once_orig($modfile);
} else {
require_once_orig($file);
}
}
so if original file is:
/home/public_html/site/includes/page.php
I want to check if
/home/public_html/site/mods/includes/page.php exists first and load the one I want.
I am overriding the require_once function because I am adding this to an existing framework and don't want to have to update it in all locations. This would make it completely dynamic so that all require_once calls will check for existence of the file in the other path.
Any thoughts?
Merger of 6 sister companies under one flagship company after go live
Dear Experts,
problems with contact forms that are only protected against SQL injections
What could be a potential problem with contact forms that are only protected against SQL injections and have an admin side view for the enquiry ?
what business processes?
Hi,
PHP switch function help
Hi, I am trying to create a search function for a directory website. On the search function on html page I have a dropdown menu. From this you can select one OF 3 options - shoes, handbags, shoes and
Having a problem get the selected item from a drop down menu
I have been looking at this for days now.I have a drop down menu that get it's values from an sql database That works but now I want to get the item and pass it to another query that's where I get
[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.If the program exits normally the port closes fine, however, if it crashes sometimes it remains open and I am unable to close it. The next time
Server side $_SESSION
how does one keep the session completely server side. no cookies to the browser at all. i need this site to be cookie and jscript free.
help with email script...
hey I need help with my mail scriptwhen the form on http://www.mcgdesignstudio.com/contact.html is filled out, it send the from with no errors.. however i never receive it.. my hosting company have
Passing vars to the DB
I have 3 small testing tables:ID TYPE1 pepperoni2 C. bacon3 tacoID TYPE1 small2 med3 largeID TYPE1 bud2 hef3 mil best4 7up5 orange6 cokeEach one is a select menu. How would I pass these as
array help
Does anyone know how to require 10 text fields for individual grades and output class average? (10 pt grading scale)