当前位置: 首页>>代码示例>>PHP>>正文


PHP BxDolCmts::onModuleUninstall方法代码示例

本文整理汇总了PHP中BxDolCmts::onModuleUninstall方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolCmts::onModuleUninstall方法的具体用法?PHP BxDolCmts::onModuleUninstall怎么用?PHP BxDolCmts::onModuleUninstall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BxDolCmts的用法示例。


在下文中一共展示了BxDolCmts::onModuleUninstall方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uninstall

 function uninstall($aParams, $bDisable = false)
 {
     // check if module is already waiting while files are deleting
     bx_import('BxDolInstallerUtils');
     if (BxDolInstallerUtils::isModulePendingUninstall($this->_aConfig['home_uri'])) {
         return array('message' => _t('_adm_err_modules_pending_uninstall_already'), 'result' => false);
     }
     // queue for deletion storage files
     $bSetModulePendingUninstall = false;
     foreach ($this->_aStorages as $s) {
         if (($o = BxDolStorage::getObjectInstance($s)) && $o->queueFilesForDeletionFromObject()) {
             $bSetModulePendingUninstall = true;
         }
     }
     // delete comments and queue for deletion comments attachments
     bx_import('BxDolCmts');
     $iFiles = 0;
     BxDolCmts::onModuleUninstall($this->_aConfig['name'], $iFiles);
     if ($iFiles) {
         $bSetModulePendingUninstall = true;
     }
     // if some files were added to the queue, set module as pending uninstall
     if ($bSetModulePendingUninstall) {
         BxDolInstallerUtils::setModulePendingUninstall($this->_aConfig['home_uri']);
         return array('message' => _t('_adm_err_modules_pending_uninstall'), 'result' => false);
     }
     // delete associated connections
     if ($this->_aConnections) {
         bx_import('BxDolConnection');
         foreach ($this->_aConnections as $sObjectConnections => $a) {
             $o = BxDolConnection::getObjectInstance($sObjectConnections);
             if (!$o) {
                 continue;
             }
             $sFuncSuffix = 'DeleteInitiatorAndContent';
             if (isset($a['conn']) && 'initiator' == $a['conn']) {
                 $sFuncSuffix = 'DeleteInitiator';
             } elseif (isset($a['conn']) && 'content' == $a['conn']) {
                 $sFuncSuffix = 'DeleteContent';
             }
             if (isset($a['type']) && 'profiles' == $a['type']) {
                 $sFunc = 'onModuleProfile' . $sFuncSuffix;
                 $o->{$sFunc}($this->_aConfig['name']);
             } else {
                 $sFunc = 'onModule' . $sFuncSuffix;
                 $o->{$sFunc}($a['table'], $a['field_id']);
             }
         }
     }
     return parent::uninstall($aParams, $bDisable);
 }
开发者ID:Baloo7super,项目名称:dolphin,代码行数:51,代码来源:BxBaseModGeneralInstaller.php

示例2: actionProcessStorages

 /**
  * 
  * Storage objects to automatically delete files from upon module uninstallation.
  * Note. Don't add storage objects used in transcoder objects.
  * @param string $sOperation - operation type.
  */
 protected function actionProcessStorages($sOperation)
 {
     if (empty($this->_aConfig['storages'])) {
         return BX_DOL_STUDIO_INSTALLER_FAILED;
     }
     // check if module is already waiting while files are deleting
     if (self::isModulePendingUninstall($this->_aConfig['home_uri'])) {
         return array('code' => BX_DOL_STUDIO_INSTALLER_FAILED, 'content' => _t('_adm_err_modules_pending_uninstall_already'));
     }
     $bSetModulePendingUninstall = false;
     // queue for deletion storage files
     foreach ($this->_aConfig['storages'] as $s) {
         if (($o = BxDolStorage::getObjectInstance($s)) && $o->queueFilesForDeletionFromObject()) {
             $bSetModulePendingUninstall = true;
         }
     }
     // delete comments and queue for deletion comments attachments
     $iFiles = 0;
     BxDolCmts::onModuleUninstall($this->_aConfig['name'], $iFiles);
     if ($iFiles) {
         $bSetModulePendingUninstall = true;
     }
     // if some files were added to the queue, set module as pending uninstall
     if ($bSetModulePendingUninstall) {
         self::setModulePendingUninstall($this->_aConfig['home_uri']);
         return array('code' => BX_DOL_STUDIO_INSTALLER_FAILED, 'content' => _t('_adm_err_modules_pending_uninstall'));
     }
     return BX_DOL_STUDIO_INSTALLER_SUCCESS;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:35,代码来源:BxDolStudioInstaller.php


注:本文中的BxDolCmts::onModuleUninstall方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。