PHPComposter\PHPComposter\Installer::install PHP Method

install() public method

Install the package.
Since: 0.1.0
public install ( Composer\Repository\InstalledRepositoryInterface $repo, Composer\Package\PackageInterface $package )
$repo Composer\Repository\InstalledRepositoryInterface The repository from where the package was fetched.
$package Composer\Package\PackageInterface The package to install.
    public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        $path = $this->getInstallPath($package);
        if ($this->io->isVerbose()) {
            $this->io->write(sprintf(_('Symlinking PHP Composter action %1$s'), $path), true);
        }
        parent::install($repo, $package);
        foreach ($this->getHooks($package) as $prioritizedHook => $method) {
            $array = explode('.', $prioritizedHook);
            if (count($array) > 1) {
                list($priority, $hook) = $array;
            } else {
                $hook = $array[0];
                $priority = 10;
            }
            if ($this->io->isVeryVerbose()) {
                $this->io->write(sprintf(_('Adding method "%1$s" to hook "%2$s" with priority %3$s'), $method, $hook, $priority), true);
            }
            HookConfig::addEntry($hook, $method, $priority);
        }
    }