1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00

Remove plugin installer hackery

This commit is contained in:
Jordi Boggiano 2021-02-17 23:21:18 +01:00
parent 7267533690
commit f7e8f7625f
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
10 changed files with 39 additions and 61 deletions

View file

@ -8,16 +8,15 @@ class Hooks
{
public static function preUpdate(Event $event)
{
flush();
echo '!!PreUpdate:'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n";
echo '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n";
fwrite(STDERR, '!!PreUpdate:'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n");
fwrite(STDERR, '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n");
}
public static function postUpdate(Event $event)
{
echo '!!PostUpdate:'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n";
echo '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n";
echo '!!PluginA:'.InstalledVersions::getVersion('plugin/a')."\n";
echo '!!PluginB:'.InstalledVersions::getVersion('plugin/b')."\n";
fwrite(STDERR, '!!PostUpdate:'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n");
fwrite(STDERR, '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n");
fwrite(STDERR, '!!PluginA:'.InstalledVersions::getVersion('plugin/a')."\n");
fwrite(STDERR, '!!PluginB:'.InstalledVersions::getVersion('plugin/b')."\n");
}
}

View file

@ -10,7 +10,8 @@ class PluginA implements PluginInterface
{
public function activate(Composer $composer, IOInterface $io)
{
echo '!!PluginA:'.InstalledVersions::getVersion('plugin/a').JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n";
echo '!!PluginAInit'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n";
echo '!!PluginA:'.(InstalledVersions::isInstalled('plugin/a') ? InstalledVersions::getVersion('plugin/a') : 'null')."\n";
echo '!!PluginB:'.(InstalledVersions::isInstalled('plugin/b') ? InstalledVersions::getVersion('plugin/b') : 'null')."\n";
echo '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n";
}

View file

@ -10,8 +10,9 @@ class PluginB implements PluginInterface
{
public function activate(Composer $composer, IOInterface $io)
{
echo '!!PluginB:'.InstalledVersions::getVersion('plugin/b').JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n";
echo '!!PluginBInit'.JsonFile::encode(InstalledVersions::getInstalledPackages(), 320)."\n";
echo '!!PluginA:'.(InstalledVersions::isInstalled('plugin/a') ? InstalledVersions::getVersion('plugin/a') : 'null')."\n";
echo '!!PluginB:'.(InstalledVersions::isInstalled('plugin/b') ? InstalledVersions::getVersion('plugin/b') : 'null')."\n";
echo '!!Versions:console:'.InstalledVersions::getVersion('symfony/console').';process:'.InstalledVersions::getVersion('symfony/process').';filesystem:'.InstalledVersions::getVersion('symfony/filesystem')."\n";
}