Components_Component::install PHP Method

install() public method

Install a component.
public install ( Components_Pear_Environment $env, array $options = [], string $reason = '' ) : null
$env Components_Pear_Environment The environment to install into.
$options array Install options.
$reason string Optional reason for adding the package.
return null
    public function install(Components_Pear_Environment $env, $options = array(), $reason = '');

Usage Example

Ejemplo n.º 1
0
 /**
  * Ensure that the component is available within the installation
  * environment.
  *
  * @param Components_Pear_Environment $environment The environment we
  *                                                 install into.
  * @param Components_Component        $component   The component that
  *                                                 should be installed.
  * @param array                       $options     Install options.
  * @param string                      $reason      Optional reason for
  *                                                 adding the package.
  *
  * @return NULL
  */
 private function _installComponent(Components_Pear_Environment $environment, Components_Component $component, $options = array(), $reason = '')
 {
     if (empty($options['pretend'])) {
         $component->install($environment, $this->_getPerComponentOptions($component, $options), $reason);
     } else {
         $this->_output->ok(sprintf('Would install component %s%s.', $component->getName(), $reason));
     }
 }