I've made a PHP framework. To start it, you do:
require 'framework.php';
framework_start(__DIR__);
I'm trying to eliminate the __DIR__ part, if at all possible. It's telling the framework what the "base dir" for the application is. I can't think of any way to determine the "__DIR__" for the file that calls framework_start(), from within framework_start().
I can't help but feel annoyed that it can't just be:
require 'framework.php';
framework_start();
... and then framework_start(); somehow figures out the __DIR__ value on its own. But if I just reference __DIR__ from the PHP file that contains framework_start(), it will obviously return the wrong dir path.
Is this possible at all? If so, how?