/** * Constructor * * @param Engine_Package_Manager_Operation_Abstract $operation * @param Zend_Db_Adapter_Abstract $db * @param array $options */ public final function __construct(Engine_Package_Manager_Operation_Abstract $operation, array $options = null) { $this->_operation = $operation; $this->_name = $operation->getPrimaryPackage()->getName(); if (is_array($options)) { $this->setOptions($options); } $this->init(); }
public function execute(Engine_Package_Manager_Operation_Abstract $operation, $type, array $params = null) { $package = $operation->getPrimaryPackage(); $callback = $package->getCallback(); if (!$callback || !$callback instanceof Engine_Package_Manifest_Entity_Callback || !$callback->getClass()) { return false; } // Include the path, if set if ($callback->getPath()) { include_once $package->getBasePath() . '/' . $callback->getPath(); } try { $instance = $this->getInstaller($callback->getClass(), $operation, $params); $instance->notify($type); $errors = $instance->getErrors(); $messages = $instance->getMessages(); $instance->clearErrors()->clearMessages(); } catch (Exception $e) { $errors = array($e->getMessage()); $messages = array(); } return array('errors' => $errors, 'messages' => $messages); }