Example #1
0
 public static function install_pear_package($package, $channel = 'pear.php.net')
 {
     if (!class_exists('PEAR_Config')) {
         @(include 'PEAR/Registry.php');
         // loads config, among other things
         if (!class_exists('PEAR_Config')) {
             throw new pakeException('PEAR subsystem is unavailable (not in include_path?)');
         }
     }
     $cfg = PEAR_Config::singleton();
     $registry = $cfg->getRegistry();
     // 1. check if package is installed
     if ($registry->_packageExists($package, $channel)) {
         return true;
     }
     $need_sudo = (!is_writable($cfg->get('download_dir')) or !is_writable($cfg->get('php_dir')));
     // 2. if not installed, discover channel
     if (!$registry->_channelExists($channel, true)) {
         // sudo discover channel
         pake_echo_action('pear', 'discovering channel ' . $channel);
         if ($need_sudo) {
             pake_superuser_sh('pear channel-discover ' . escapeshellarg($channel));
         } else {
             $this->nativePearDiscover($channel);
         }
     }
     // 3. install package
     pake_echo_action('pear', 'installing ' . $channel . '/' . $package);
     if ($need_sudo) {
         pake_superuser_sh('pear install ' . escapeshellarg($channel . '/' . $package), true);
     } else {
         $this->nativePearInstall($package, $channel);
     }
 }
 public static function run_install()
 {
     pake_superuser_sh('make install');
 }
Example #3
0
function run_install()
{
    pake_superuser_sh('pear install -f AppServer-0.2.2.tgz');
}
 public static function install_from_file($file, $package_name, $channel = '__uri')
 {
     if (self::isInstalled($package_name, $channel)) {
         return true;
     }
     // otherwise, let's install it!
     $pear = escapeshellarg(pake_which('pear'));
     pake_superuser_sh($pear . ' install ' . escapeshellarg($file));
 }