當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JInstaller::_isManifest方法代碼示例

本文整理匯總了PHP中JInstaller::_isManifest方法的典型用法代碼示例。如果您正苦於以下問題:PHP JInstaller::_isManifest方法的具體用法?PHP JInstaller::_isManifest怎麽用?PHP JInstaller::_isManifest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在JInstaller的用法示例。


在下文中一共展示了JInstaller::_isManifest方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getComponentManifestFile

 function getComponentManifestFile($com)
 {
     $short_element = str_replace('com_', '', $com);
     $manifestPath = JPATH_ADMINISTRATOR . '/components/' . $com . '/' . 'manifest.xml';
     $shortElementManifestPath = JPATH_ADMINISTRATOR . '/components/' . $com . '/' . $short_element . '.xml';
     if (JFile::exists($manifestPath)) {
         $file = $manifestPath;
     }
     if (JFile::exists($shortElementManifestPath)) {
         $file = $shortElementManifestPath;
     }
     if (empty($file)) {
         return false;
     }
     $installer = new JInstaller();
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         // Joomla! 1.6+ code here
         $manifest = $installer->isManifest($file);
     } else {
         // Joomla! 1.5 code here
         $manifest = $installer->_isManifest($file);
     }
     return $manifest;
 }
開發者ID:joomlacorner,項目名稱:citruscart,代碼行數:24,代碼來源:installer.php

示例2: uninstallExtension

 /**
  * Attempts to uninstall the specified extension
  * 
  * @param array $pkg the paket package information
  * @return Boolean True if successful, false otherwise
  */
 function uninstallExtension($package)
 {
     //Get an installer instance, always get a new one
     $installer = new JInstaller();
     //attemp to load the manifest file
     $file = $this->findManifest($package);
     //check to see if the manifest was found
     if (isset($file)) {
         // Is it a valid joomla installation manifest file?
         $manifest = $installer->_isManifest($file);
         if (!is_null($manifest)) {
             // If the root method attribute is set to upgrade, allow file overwrite
             $root = $manifest->document;
             if ($root->attributes('method') == 'upgrade') {
                 $installer->_overwrite = true;
             }
             // Set the manifest object and path
             $installer->_manifest = $manifest;
             $installer->setPath('manifest', $file);
             // Set the installation source path to that of the manifest file
             $installer->setPath('source', dirname($file));
         }
     } else {
         $this->setError(JText::_('COM_TIENDA_UNABLE_TO_LOCATE_MANIFEST_FILE'));
         return false;
     }
     //check if the extension is installed already and if so uninstall it
     //$manifestInformation = $this->paketItemToManifest($package);
     $manifestInformation = $package;
     $elementID = $this->checkIfInstalledAlready($manifestInformation);
     if (!empty($elementID)) {
         $clientid = 0;
         if ($package['client'] == 'administrator') {
             $clientid = '1';
         }
         //uninstall the extension using the joomla uninstaller
         if ($installer->uninstall($manifestInformation["type"], $elementID, $clientid)) {
             $this->setError(JText::_('COM_TIENDA_ELEMENT_UNINSTALLED'));
             return true;
         } else {
             $this->setError(JText::_('COM_TIENDA_ELEMENT_UNINSTALL_FAILED') . " :: " . $installer->getError());
             return false;
         }
     }
     $this->setError(JText::_('COM_TIENDA_ELEMENT_NOT_UNINSTALLED'));
     return false;
 }
開發者ID:annggeel,項目名稱:tienda,代碼行數:53,代碼來源:dscinstaller.php


注:本文中的JInstaller::_isManifest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。