-4
I have a question/problem regarding php Composer. Come on, my PHP projects are now mostly using Composer, to "modularize" some parts I started using the property repositories on Composer.json.
I’m trying to use that package Simplecrudphp. I clone the repository in a folder called modules in my project and in composer.json
colloquial:
"repositories": [
{
"type": "path",
"url": "./modules/SimpleCrudPhp"
}
],
"autoload": {
"psr-4": {
"App\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"App\\": "src",
},
"files": [
"env.php"
]
},
"require": {
"simplephp/simple-crud": "dev-master"
}
The problem is that the Simplecrudphp package needs to run the file Config.php that takes the environment variables loaded in the autoload in the file env.php, but how Simplecrudphp performs before the env.php it does not take the environment variables and ends up not working.
Obs.: When I put a require __DIR__ . "../../../../env.php";
within the Config.php it works, but I don’t want a solution that has to keep modifying something within the package.
I wonder if you have how to modify the Composer.json of the main project for it to carry this repositories (Simplecrudphp) after the autoload/autoload-dev? Or some approach you can use to make the package work without me having to modify its content every time you create a new project?
From now on, thank you.
See if this helps https://stackoverflow.com/questions/36745691/cant-get-composer-path-repository-to-work
– Marcos Xavier
I took a look, but dev-master is not the problem, the package works, but by loading after env.php, it does not take the value of the variables to define it()
– Evelyn FB