コード例 #1
0
ファイル: script.php プロジェクト: BetterBetterBetter/B3App
 public function preflight($type, $parent)
 {
     //check if php version is supported before proceed with installation.
     $temp = self::_validateEasyDiscussVersion();
     if (!$temp) {
         $mainframe = JFactory::getApplication();
         $mainframe->enqueueMessage('WARNING: PLEASE REMEMBER TO BACKUP THE ATTACHMENTS FOLDER OR IT WILL BE DELETED.You can find it at JOOMLA/media/com_easydiscuss/attachments.<br /><br />', 'message');
         $mainframe->enqueueMessage('Older version of EasyDiscuss detected. You will need to first perform the uninstall-and-reinstall steps to upgrade your older version of EasyDiscuss to version 3.0.x. Please be rest assured that uninstalling EasyDiscuss will not remove any data and all your records and configuration will remain intact.', 'message');
         return false;
     }
     if ($temp === 'warning') {
         $mainframe = JFactory::getApplication();
         $mainframe->enqueueMessage('WARNING: Please install the latest patch 3.0.8598 (Bug: Attachments folder will be deleted if perform uninstallation prior of this patch), then only install EasyDiscuss 3.1.<br /><br />', 'message');
         return false;
     }
     //get source path and version number from manifest file.
     $installer = JInstaller::getInstance();
     $manifest = $installer->getManifest();
     $sourcePath = $installer->getPath('source');
     $this->message = array();
     $this->status = true;
     $this->sourcePath = $sourcePath;
     // if this is a uninstallation process, do not execute anything, just return true.
     if ($type == 'install' || $type == 'update' || $type == 'discover_install') {
         require_once $this->sourcePath . '/admin/install.default.php';
         //this is needed as joomla failed to remove it themselve during uninstallation or failed attempt of installation
         EasyDiscussInstaller::removeAdminMenu();
     }
     return true;
 }