public static function installPluginFromZip($strFileName) { $entropy = substr(md5(uniqid()), 0, 6); $expandedDir = __INCLUDES__ . self::PLUGIN_EXTRACTION_DIR . $entropy . '/'; $extractionResult = QArchive::extractZip($strFileName, $expandedDir); if (!$extractionResult) { self::$strLastError = QArchive::getLastError(); return null; } // Check to see if plugin config is defined as a PHP file, // not XML file - and if so, run the PHP file to generate an XML config // file. if (file_exists($expandedDir . self::PLUGIN_CONFIG_GENERATION_FILE)) { // we'll need this constant to know where to save the XML config file global $__PLUGIN_FILES_DIR__; $__PLUGIN_FILES_DIR__ = $expandedDir; // execute the configuration file from the plugin - it will create a plugin // config file in the XML format which we will process include $expandedDir . self::PLUGIN_CONFIG_GENERATION_FILE; } return $entropy; }