本文整理匯總了PHP中MailSo\Base\Utils::RecRmDir方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utils::RecRmDir方法的具體用法?PHP Utils::RecRmDir怎麽用?PHP Utils::RecRmDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MailSo\Base\Utils
的用法示例。
在下文中一共展示了Utils::RecRmDir方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DoAdminPackageInstall
/**
* @return array
*/
public function DoAdminPackageInstall()
{
$this->IsAdminLoggined();
$sType = $this->GetActionParam('Type', '');
$sId = $this->GetActionParam('Id', '');
$sFile = $this->GetActionParam('File', '');
$this->Logger()->Write('Start package install: ' . $sFile . ' (' . $sType . ')', \MailSo\Log\Enumerations\Type::INFO, 'INSTALLER');
$sRealFile = '';
$bReal = false;
$bRainLoopUpdatable = false;
$aList = $this->getRepositoryData($bReal, $bRainLoopUpdatable);
if ('plugin' === $sType) {
foreach ($aList as $oItem) {
if ($oItem && $sFile === $oItem['file'] && $sId === $oItem['id']) {
$sRealFile = $sFile;
break;
}
}
}
$sTmp = '';
$bResult = false;
if ('' !== $sRealFile) {
$sUrl = $this->rainLoopRepo() . $sRealFile;
$sTmp = $this->downloadRemotePackageByUrl($sUrl);
}
if ('' !== $sTmp) {
include_once APP_VERSION_ROOT_PATH . 'app/libraries/pclzip/pclzip.lib.php';
$oArchive = new \PclZip($sTmp);
if ('plugin' === $sType) {
$bResult = true;
if (\is_dir(APP_PLUGINS_PATH . $sId)) {
$bResult = \MailSo\Base\Utils::RecRmDir(APP_PLUGINS_PATH . $sId);
if (!$bResult) {
$this->Logger()->Write('Cannot remove previous plugin folder: ' . $sId, \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER');
}
}
if ($bResult) {
$bResult = 0 !== $oArchive->extract(PCLZIP_OPT_PATH, APP_PLUGINS_PATH);
if (!$bResult) {
$this->Logger()->Write('Cannot extract package files: ' . $oArchive->errorInfo(), \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER');
}
}
}
@\unlink($sTmp);
}
return $this->DefaultResponse(__FUNCTION__, $bResult ? 'plugin' !== $sType ? array('Reload' => true) : true : false);
}
示例2: DeleteStorage
/**
* @param \RainLoop\Model\Account|string $oAccount
*
* @return bool
*/
public function DeleteStorage($oAccount)
{
$sPath = $this->generateFileName($oAccount, \RainLoop\Providers\Storage\Enumerations\StorageType::USER, 'xxx', false, true);
if (!empty($sPath) && \is_dir($sPath)) {
\MailSo\Base\Utils::RecRmDir($sPath);
}
$sPath = $this->generateFileName($oAccount, \RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG, 'xxx', false, true);
if (!empty($sPath) && \is_dir($sPath)) {
\MailSo\Base\Utils::RecRmDir($sPath);
}
return true;
}