예제 #1
0
 public static function installFromExpanded($strExtractedFolderName)
 {
     $expandedDir = self::getExpandedPath($strExtractedFolderName);
     $objPlugin = QPluginConfigParser::parseNewPlugin($expandedDir . self::PLUGIN_CONFIG_FILE);
     $strStatus = "Installing plugin " . $objPlugin->strName . "\r\n\r\n";
     if (self::isPluginInstalled($objPlugin->strName)) {
         $strStatus .= "Plugin with the same name is already installed - aborting";
         return $strStatus;
     }
     $strStatus .= self::appendPluginConfigToMasterConfig($strExtractedFolderName);
     $strStatus .= self::deployFilesForNewPlugin($objPlugin, $strExtractedFolderName);
     $strStatus .= self::appendClassFileReferences($objPlugin, $strExtractedFolderName);
     $strStatus .= self::appendExampleFileReferences($objPlugin, $strExtractedFolderName);
     // When installation is done, clean up
     $strStatus .= self::cleanupExtractedFiles($strExtractedFolderName);
     $strStatus .= "\r\nInstallation completed successfully.";
     return $strStatus;
 }
예제 #2
0
 protected function Form_Create()
 {
     $strPluginName = QApplication::QueryString('strName');
     $this->strPluginType = QApplication::QueryString('strType');
     if (!isset($strPluginName) || !isset($this->strPluginType) || strlen($strPluginName) == 0 || strlen($this->strPluginType) == 0) {
         throw new Exception("Mandatory parameter was not set");
     }
     if ($this->strPluginType == self::TYPE_VIEWING_ALREADY_INSTALLED) {
         $installedPlugins = QPluginConfigParser::parseInstalledPlugins();
         foreach ($installedPlugins as $item) {
             if ($item->strName == $strPluginName) {
                 $this->objPlugin = $item;
             }
         }
     } else {
         if ($this->strPluginType == self::TYPE_INSTALLING_NEW) {
             $configFile = __INCLUDES__ . QPluginInstaller::PLUGIN_EXTRACTION_DIR . $strPluginName . '/' . QPluginInstaller::PLUGIN_CONFIG_FILE;
             $this->objPlugin = QPluginConfigParser::parseNewPlugin($configFile);
         } else {
             throw new Exception("Invalid value of the type URL parameter: " . $this->strPluginType);
         }
     }
     if ($this->objPlugin == null) {
         throw new Exception("Plugin not found: " . $strPluginName);
     }
     $this->lblName_Create();
     $this->lblDescription_Create();
     $this->lblPluginVersion_Create();
     $this->lblPlatformVersion_Create();
     $this->lblAuthorName_Create();
     $this->lblAuthorEmail_Create();
     $this->lblFiles_Create();
     $this->dlgStatus_Create();
     $this->btnInstall_Create();
     $this->btnCancelInstallation_Create();
     $this->btnUninstall_Create();
     $this->objDefaultWaitIcon = new QWaitIcon($this);
 }