I'm using Composer for module dependency management (loving using autoload.php instead of a ton of includes and requires!).
I want to include a PHP file that is outside of the root Composer directory (for security) with credentials stored in defines()
.
This isn't working, composer.json:
{
"autoload": {
"classmap": ["../credentials.php"]
}
}
credentials.php:
define('RYAN','BRODIE');
test.php:
require_once __DIR__.'/../vendor/autoload.php';
echo RYAN;
Results in Notice: Use of undefined constant RYAN
. If Composer's autoloader is only intended for Class includes then I'd be grateful for any hacks (as it were) to make this work.