Issue
I'm trying to find the base directory of my application from within a composer package. Is there an composer API or proper way to accomplish this.
To clarify, if my package install looks like this and I've got files here (using psr-4):
/home/project/vendor/Acme/my-package/src/
how can I find /home/project dynamically?
Updated Info:
I'm trying to load a .env file from the root which contains an API URL endpoint via Dotenv package from within the package.
Solution
Based in input from @Sven best and cleanest solution was to collect input on class initialization and leave configuration out of the package.
Answered By - dcbarans Answer Checked By - Katrina (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.