I've managed to go this long without having to use git to manage source code but I want to use a library which will let me integrate with the Xero accounting system and I need to play by their rules. I'm on shared hosting with Plesk because the sites are very, very low traffic in a very, very targetted niche. So, I used Plesk to install the main git package and it installed the dependencies - however, the main git package didn't have Dotenv as a dependency. I don't want to fork because I can see the value in having them maintain their code. So, I've used Plesk to add Dotenv and my files are organised like this hosting/git/xero hosting/git/dotenv hosting/httpdocs/git/xero/vendor/... all the other packages My code calls hosting/httpdocs/git/xero/vendor/autoload.php and I'm not sure what it actually does but I can see that it doesn't load Dotenv. What do I call to get Dotenv loaded?
You'll "need" command line access and NPM or YARN installed. Instructions right on dotenv's page. https://www.npmjs.com/package/dotenv Given it's a system level node.js package I'm surprised you were able to get this far just using Plesk... much less run ANY of this on shared hosting since most of them tell you "no" -- and sometimes even "f*** off" -- when it comes to even installing node.js on shared hosting plans. It's also a bit weird that a PHP codebase would rely on a NPM package that does what PHP's $_ENV already handles. Unless we're talking an entirely different dotenv... or PHP is trying to read .env files which... shouldn't be necessary for much of anything.
different package. turns out it was only needed to get the api keys and then not used again - and they said you shouldn't use it in the production version of the code so I have no f'ing idea why they bothered in the first place. For all the effort of finding that package against editing a standard php file that can be required. I last messed with xero back in '14 and despaired of the html it spat out (id used multiple times etc) but hoping they've tidied up their act.