New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a directory after installation finishes #1417
Comments
the composer scripts can also be a PHP static method (it was even the only way originally). So it would be Btw, take care that scripts only work in the root package (but I guess phpbb is not really expected to be installed as a dependency of another project anyway) |
What stof said is an option yes. Because indeed shell scripts are pretty hard to manage cross-platform. The other option is to just add a .gitkeep in that dir in the git repo and be done with it. |
Thanks, one question though:
I forget why we don't (want to) have it as a .gitkeep. I would guess someone was opposed to it, maybe on the basis of having too many empty directories in the repo. If it was up to me I'd have a Makefile create the dirs I needed. |
@p it needs to be autoloaded through composer's PSR-0 autoloader (so that composer can autoload it when running git) |
Maybe you can help us out here.
We have a directory that is not used by phpbb itself, and is not in the repository as a result, that users (most of them in fact) are expected to use. Therefore we want to make sure our users have this directory when they look for it.
Solution #1: we build release packages, and can trivially create the needed directory there. This works for most users. Problem is, anyone cloning the repository won't have the directory in the git checkout.
Solution #2: since we require users to install dependencies via composer for any git checkout, we thought we could ask composer to create the directory for us when it's done installing dependencies.
Therefore, we have: https://github.com/phpbb/phpbb3/pull/1032/files
Now, the problem with this is mkdir fails when the directory exists. mkdir -p apparently does not exist on windows so that's a no go.
Any suggestions, short of writing a php script to create the directory?
If we do write a php script, do we have to specify php binary name ("php", on PATH) in the command? Can composer execute the script with whichever php was used to execute composer?
The text was updated successfully, but these errors were encountered: