/** * @access public * @todo deal with the package including some plugins. */ function perform() { $args =& $this->_parseArgList(); if (Ethna::isError($args)) { return $args; } $pear =& new Ethna_PearWrapper(); if (isset($args['pearopt'])) { $pear->setPearOpt($args['pearopt']); } if (isset($args['type']) && isset($args['name'])) { // install from repository. $target = isset($args['target']) ? $args['target'] : null; $channel = isset($args['channel']) ? $args['channel'] : null; $basedir = isset($args['basedir']) ? realpath($args['basedir']) : getcwd(); if ($target == 'master') { $pkg_name = sprintf('Ethna_Plugin_%s_%s', $args['type'], $args['name']); } else { $pkg_name = sprintf('App_Plugin_%s_%s', $args['type'], $args['name']); } $r =& $pear->init($target, $basedir, $channel); if (Ethna::isError($r)) { return $r; } $pkg_name = $pear->getCanonicalPackageName($pkg_name); if (Ethna::isError($pkg_name)) { return $pkg_name; } $r =& $pear->doUninstall($pkg_name); if (Ethna::isError($r)) { return $r; } } else { return Ethna::raiseError('invalid number of arguments', 'usage'); } if ($target != 'master') { list(, , $ctype, $cname) = explode('_', $pkg_name, 4); $r = Ethna_Generator::remove('Plugin', $basedir, $ctype, $cname); if (Ethna::isError($r)) { return $r; } } return true; }