Example #1
0
 function uninstallItem($item, &$uninstallParameters)
 {
     $type = $item['type'];
     $name = $item['name'];
     $os = $item['os'];
     $filename = $item['filename'];
     $subdirectory = $item['sub-directory'];
     $content = false;
     if (isset($item['content'])) {
         $content = $item['content'];
     }
     $handler = $this->packageHandler($type);
     if ($handler) {
         if ($handler->extractInstallContent()) {
             if (!$content and $filename) {
                 if ($subdirectory) {
                     $filepath = $subdirectory . '/' . $filename . '.xml';
                 } else {
                     $filepath = $filename . '.xml';
                 }
                 $filepath = $this->path() . '/' . $filepath;
                 $dom = eZPackage::fetchDOMFromFile($filepath);
                 if ($dom) {
                     $content = $dom->documentElement;
                 } else {
                     eZDebug::writeError("Failed fetching dom from file {$filepath}", __METHOD__);
                 }
             }
         }
         if (isset($this->InstallData[$type])) {
             $installData =& $this->InstallData[$type];
         } else {
             unset($installData);
             $installData = array();
         }
         $uninstallResult = $handler->uninstall($this, $type, $item, $name, $os, $filename, $subdirectory, $content, $uninstallParameters, $installData);
     }
     return $uninstallResult;
 }