Closed xewl closed 7 years ago
Would it be possible to dump the output of the error here?
There is no need to touch
the file first before calling file_put_contents
. If the filename
does not exist, the file is created
Yes, I see, and that's what I thought at first too, but it still gave 2 errorlines on that function/line.
Also.. the generated puphpet file didn't create the foldersync either (looking at the config) when I did this, and so for some reason the whole vagrant file was not giving me access to the installed magento-directory after the second up. The link was gone.. So I kinda abandoned this generated vagrant due to that.
I will come back to this asap with screenshots a dump, when I'm able to re-do it. [Work, sleep, repeat :8ball: ]
Okay, a hint would be the first comment on the PHP-page...
"file_put_contents()
fails if you try to put a file in a directory that doesn't exist."
So, yes it creates the file, but not the folder it's written to; that one needs to exist and be writable already.
I guess the folder didn't exist. But I'll check for this quirk later.
What OS are you running on? The auth.json
file is created in your COMPOSER_HOME
directory. Which on Mac and most nix systems is /home/<user>/.composer
There are some nix systems that use the XDG_CONFIG_HOME/composer
however I am working on a fix for that.
Not sure I follow about the Vagrant file not giving access to the magento directory, its not the job of Vagrant to give folder access.
I was using Windows 10 in this case. Not my best choice of a dev platform either, but I needed a fast solution.
Unfortunately this is the problem. Magestead doesn't not work with Windows as I don't have a windows machine to test it. It also has the COMPOSER_HOME
in a different location, obviously :)
I would like to add Windows support for magestead however the lack of Windows machines makes it impossible to test.
Hopefully someone can help add this functionality in - PR's are welcome :)
When generating a new project, there's a php-error in
Magestead\Helper\Options.php on line 191
that's trying to write away the credentials to/.composer/auth.json
viafile_put_contents()
.I think checking for non-existance &
touch()
would be in order in this step.