Closed strarsis closed 7 years ago
I don't use it directly, it's used indirectly by the various packages. Without it I presume support for git
would need to be dropped, so yes it's a requirement.
It's possible that it could be done in pure PHP by parsing the .git/config
folder to figure out what the origin
is. Figuring out which branch is the current branch is more difficult however.
If you implement this with unit tests as a library I'll happily use it, but it's far beyond the scope of what composerpress should do
So yes, it can, but it's not a trivial task, and I won't do it myself
Would using a PHP library for native git support overkill, e.g. https://github.com/czproject/git-php ? Edit: It could be just pulled in with composer like the other dependencies.
@strarsis that uses exec
https://github.com/czproject/git-php/blob/master/src/GitRepository.php#L580 it's not native PHP at all. If it were pure PHP I'd be deeply suspicious of it, and i'd expect the library to be massive
Also according to the PHP docs:
(PHP 4 >= 4.3.0, PHP 5, PHP 7) http://php.net/manual/en/function.proc-open.php
If your machine does not support proc_open
then I very much doubt that it supports Composer fully, and is likely running an ancient version of PHP, or it's configured explicitly to prevent shell execution, so exec
won't be available either.
If you really need to run Composerpress, either switch hosts, or pull a copy of the site on to your computer in a local dev environment such as flywheel or VVV, and run it there.
Could the use of
proc_open
be avoided?