Пример #1
0
 /**
  * Set a configuration option.
  *
  * @param array $args
  */
 function set($args, $options)
 {
     $conf = $current = \PEAR2\Pyrus\Config::current();
     if ($options['plugin']) {
         $conf = \PEAR2\Pyrus\Config::singleton(\PEAR2\Pyrus\Config::current()->plugins_dir);
     }
     if (in_array($args['variable'], $conf->uservars)) {
         echo "Setting {$args['variable']} in " . $conf->userfile . "\n";
         $conf->{$args['variable']} = $args['value'];
     } elseif (in_array($args['variable'], $conf->systemvars)) {
         echo "Setting {$args['variable']} in system paths\n";
         $conf->{$args['variable']} = $args['value'];
     } else {
         echo "Unknown config variable: {$args['variable']}\n";
         exit(1);
     }
     $conf->saveConfig();
     if ($options['plugin']) {
         \PEAR2\Pyrus\Config::setCurrent($current->path);
     }
 }
Пример #2
0
<?php

/**
 * This file generates the pyrus.phar file and PEAR2 package for Pyrus.
 */
$current = \PEAR2\Pyrus\Config::current();
$config = \PEAR2\Pyrus\Config::singleton(__DIR__ . '/vendor');
$extrafiles = array($config->registry->toPackage('PEAR2_HTTP_Request', 'pear2.php.net'), $config->registry->toPackage('PEAR2_Console_CommandLine', 'pear2.php.net'), $config->registry->toPackage('PEAR2_Exception', 'pear2.php.net'), $config->registry->toPackage('PEAR2_MultiErrors', 'pear2.php.net'));
\PEAR2\Pyrus\Config::setCurrent($current->path);