Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
1 result

Installer.php

Blame
  • Installer.php 772 B
    <?php
    
    namespace Foobar;
    
    use Composer\Installers;
    use Composer\Package\PackageInterface;
    use Composer\Repository\InstalledRepositoryInterface;
    
    class Installer extends \Composer\Installers\Installer {
      public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) {
        echo "A1\n";
        if ('web/core' != substr($this->getInstallPath($package), -8)) {
          return parent::uninstall($repo, $package);
        }
        echo "B1\n";
        return NULL;
      }
    
      public function cleanup($type, PackageInterface $package, ?PackageInterface $prevPackage = null) {
        echo "A2\n";
        if ('web/core' != substr($this->getInstallPath($package), -8)) {
          return parent::cleanup($type, $package, $prevPackage);
        }
        echo "B2\n";
        return NULL;
      }
      
    }