I wonder it is possible to use Boost.PHP to replace some PHP core functions logic and/or extend them. So What I want is simple: When a php script calls for require_once(dirname(__FILE__) . "/file.php"); I want to receive dirname(__FILE__) . "/file.php" with my function, create somehow that required file (in my case, go to some distributed storage), and return that file to PHP interpreter as if it was desired file.
Is it possible with Boost.PHP? How could I do such thing?
To change the beavior of a core php function you can use the
runkitextension.Please not that the extension is mainly used for unittesting and not used in production that often (as far as i know at least).
So you can to
For things like
requireorissetthat are language constructs and not functions see @Wrikken answer (+1)