writelnInfoPackage

@param PackageInterface $package
@param string           $action
@param string           $message
167781
public function writelnInfoPackage(PackageInterface $package, $action = '', $message = '')
    {
        $this->output->writeln(sprintf('bower <info>%s</info> <fg=cyan>%s</fg=cyan> %s',
            str_pad($package->getName() . '#' . $package->getRequiredVersion(), 21, ' ', STR_PAD_RIGHT),
            str_pad($action, 10, ' ', STR_PAD_LEFT),
            $message
        ));
    }
1271653
function writePackageVersion(newVersion) {
  var packageJson = path.join(process.cwd(), 'package.json'),
    raw = require(packageJson);

  raw.version = newVersion;

  fs.writeFileSync(packageJson, JSON.stringify(raw, null, 2));
}
322291
public static function unregisterPackage(PackageInterface $package, AssetsInstallerInterface $installer = null)
    {
        self::$__autoloader->unregisterPackage($package, $installer);
    }
773257
@Override
   public void writeImport(Definition def, Writer out) throws IOException
   {
      out.write("package " + def.getRaPackage() + ";\n\n");
      if (def.isSupportInbound())
      {
         out.write("import " + def.getRaPackage() + ".inflow." + def.getActivationClass() + ";\n");
         out.write("import " + def.getRaPackage() + ".inflow." + def.getAsClass() + ";\n\n");
         if (def.getVersion().equals("1.5"))
         {
            out.write("import java.util.Collections;\n");
            out.write("import java.util.HashMap;\n");
            out.write("import java.util.Map;\n");
            writeEol(out);
         }
         else if (def.getVersion().equals("1.6") || def.getVersion().equals("1.7"))
         {
            out.write("import java.util.concurrent.ConcurrentHashMap;\n");
            writeEol(out);
         }
      }
      importLogging(def, out);

      out.write("import javax.resource.ResourceException;\n");
      out.write("import javax.resource.spi.ActivationSpec;\n");
      if (def.isUseAnnotation() &&
            def.getAuthenMechanisms() != null && def.getAuthenMechanisms().size() > 0)
      {
         out.write("import javax.resource.spi.AuthenticationMechanism;\n");
         out.write("import javax.resource.spi.AuthenticationMechanism.CredentialInterface;\n");
      }
      out.write("import javax.resource.spi.BootstrapContext;\n");
      if (def.isUseAnnotation())
      {
         importConfigProperty(def, out);
         out.write("import javax.resource.spi.Connector;\n");
      }
      out.write("import javax.resource.spi.ResourceAdapter;\n");
      out.write("import javax.resource.spi.ResourceAdapterInternalException;\n");
      if (def.isUseAnnotation() &&
            def.getSecurityPermissions() != null && def.getSecurityPermissions().size() > 0)
      {
         out.write("import javax.resource.spi.SecurityPermission;\n");
      }
      if (def.isUseAnnotation() && def.isSupportOutbound())
      {
         out.write("import javax.resource.spi.TransactionSupport;\n");
      }
      out.write("import javax.resource.spi.endpoint.MessageEndpointFactory;\n\n");
      out.write("import javax.transaction.xa.XAResource;\n\n");

   }
792427
public function addPackageUsage(PackageInterface $package)
    {
        $usageData = $this->getPackageUsage($package);
        $packageName = $this->composer->getPackage()->getName();

        if (!in_array($packageName, $usageData)) {
            $usageData[] = $packageName;
        }

        $this->updatePackageUsageFile($package, $usageData);
    }
786628
public function onPostPackageInstall(PackageEvent $event)
    {
        $op = $event->getOperation();
        if ($op instanceof InstallOperation) {
            $package = $op->getPackage()->getName();
            if ($package === self::PACKAGE_NAME) {
                $this->logger->info('composer-merge-plugin installed');
                $this->state->setFirstInstall(true);
                $this->state->setLocked(
                    $event->getComposer()->getLocker()->isLocked()
                );
            }
        }
    }
230528
public static function enablePackage(PackageInterface $package)
    {
        $packageRepository = Factory::makePackageRepository($package);
        $bundleFactory = Factory::makeBundleFactory();
        $kernelManipulator = Factory::makeKernelManipulator();

        $composerPackage = $packageRepository->findOneByName($package->getName());
        $bundle = $bundleFactory->make($composerPackage->namespace);

        $kernelManipulator->addBundle($bundle->fullyQualifiedClassname);
    }
1370129
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        new Textpattern();
        parent::install($repo, $package);
        $plugin = new $this->textpatternPackager($this->getInstallPath($package), $package);
        $plugin->install();
    }
1243936
protected function deployActionDependOnDelivery(ActionInterface $action)
    {
        if ($this->deployer && $this->deployer->isDeliveryImmediate()) {
            $this->deployer->deploy($action, $this);
        }
    }
275392
public function updateEntry($package, $theme)
    {
        $this->verifyCommand($package);

        $lines  = file($this->config);
        $config = $this->compactConfig($package);

        $lines = $this->updateConfigDetails($theme, $lines, $config);

        $this->file->delete($this->config);
        $this->file->put($this->config, implode($lines));
    }
94416
public function onPostPackageEvent(PackageEvent $event) {
    $package = $this->getBltPackage($event->getOperation());
    if ($package) {
      // By explicitly setting the blt package, the onPostCmdEvent() will
      // process the update automatically.
      $this->bltPackage = $package;
    }
  }
187668
protected function printMeta(CompletePackageInterface $package, array $versions, RepositoryInterface $installedRepo)
    {
        $this->getIO()->write('<info>name</info>     : ' . $package->getPrettyName());
        $this->getIO()->write('<info>descrip.</info> : ' . $package->getDescription());
        $this->getIO()->write('<info>keywords</info> : ' . join(', ', $package->getKeywords() ?: array()));
        $this->printVersions($package, $versions, $installedRepo);
        $this->getIO()->write('<info>type</info>     : ' . $package->getType());
        $this->printLicenses($package);
        $this->getIO()->write('<info>source</info>   : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getSourceType(), $package->getSourceUrl(), $package->getSourceReference()));
        $this->getIO()->write('<info>dist</info>     : ' . sprintf('[%s] <comment>%s</comment> %s', $package->getDistType(), $package->getDistUrl(), $package->getDistReference()));
        $this->getIO()->write('<info>names</info>    : ' . implode(', ', $package->getNames()));

        if ($package->isAbandoned()) {
            $replacement = ($package->getReplacementPackage() !== null)
                ? ' The author suggests using the ' . $package->getReplacementPackage(). ' package instead.'
                : null;

            $this->getIO()->writeError(
                sprintf('<warning>Attention: This package is abandoned and no longer maintained.%s</warning>', $replacement)
            );
        }

        if ($package->getSupport()) {
            $this->getIO()->write("\n<info>support</info>");
            foreach ($package->getSupport() as $type => $value) {
                $this->getIO()->write('<comment>' . $type . '</comment> : '.$value);
            }
        }

        if ($package->getAutoload()) {
            $this->getIO()->write("\n<info>autoload</info>");
            foreach ($package->getAutoload() as $type => $autoloads) {
                $this->getIO()->write('<comment>' . $type . '</comment>');

                if ($type === 'psr-0') {
                    foreach ($autoloads as $name => $path) {
                        $this->getIO()->write(($name ?: '*') . ' => ' . (is_array($path) ? implode(', ', $path) : ($path ?: '.')));
                    }
                } elseif ($type === 'psr-4') {
                    foreach ($autoloads as $name => $path) {
                        $this->getIO()->write(($name ?: '*') . ' => ' . (is_array($path) ? implode(', ', $path) : ($path ?: '.')));
                    }
                } elseif ($type === 'classmap') {
                    $this->getIO()->write(implode(', ', $autoloads));
                }
            }
            if ($package->getIncludePaths()) {
                $this->getIO()->write('<comment>include-path</comment>');
                $this->getIO()->write(implode(', ', $package->getIncludePaths()));
            }
        }
    }
776894
public static function unregisterPackage(PackageInterface $package, AssetsInstallerInterface $installer = null)
    {
        $_this = self::getInstance($installer);
        $_this->removePackage($package);
    }
49584
protected function printLicenses(CompletePackageInterface $package)
    {
        $spdxLicense = new SpdxLicense;

        $licenses = $package->getLicense();

        foreach ($licenses as $licenseId) {
            $license = $spdxLicense->getLicenseByIdentifier($licenseId); // keys: 0 fullname, 1 osi, 2 url

            if (!$license) {
                $out = $licenseId;
            } else {
                // is license OSI approved?
                if ($license[1] === true) {
                    $out = sprintf('%s (%s) (OSI approved) %s', $license[0], $licenseId, $license[2]);
                } else {
                    $out = sprintf('%s (%s) %s', $license[0], $licenseId, $license[2]);
                }
            }

            $this->getIO()->write('<info>license</info>  : ' . $out);
        }
    }
569371
public function addPackage($package, $version)
    {
        $config = $this->getContent();
        $config['require'][$package] = $version;
        $this->setContent($config);
    }
144523
public function handleUninstall(PackageEvent $event): void
    {
        if (!$this->enabled) {
            return;
        }

        $operation = $event->getOperation();
        if ($operation instanceof UninstallOperation) {
            $package = $operation->getPackage();
            if (in_array($package->getName(), $this->excluded)) {
                $this->io->write(sprintf('<info>Rikudou installer: Package %s ignored in composer settings</info>', $package->getName()));

                return;
            }
            $this->projectType = ProjectTypeGetter::get($this->composer);
            if (is_null($this->projectType)) {
                return;
            }
            $handler = new PackageHandler($package, $this->projectType, $this->composer);
            if ($handler->canBeHandled()) {
                $this->io->write('<comment>=== [Rikudou Installer] ===</comment>');
                foreach ($handler->handleUninstall() as $operationResult) {
                    foreach ($operationResult->getMessagesCollection()->getGenerator() as $message) {
                        if ($message->isStatusMessage() || $message->isWarningMessage()) {
                            $this->io->write($message->getMessage());
                        } else {
                            $this->io->writeError($message->getMessage());
                        }
                    }
                }
                $this->io->write('<comment>=== [Rikudou Installer] ===</comment>');
            }
        }
    }
317999
public void addPackage(String packageName) throws IOException {
    if (this.packagePrefix != null) {
      throw new IllegalStateException();
    }
    out.write("package ");
    out.write(packageName);
    out.write(";\n");
    this.packagePrefix = packageName + ".";
  }