本文整理汇总了PHP中FileUtils::deleteAlbumDirOnServer方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUtils::deleteAlbumDirOnServer方法的具体用法?PHP FileUtils::deleteAlbumDirOnServer怎么用?PHP FileUtils::deleteAlbumDirOnServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtils
的用法示例。
在下文中一共展示了FileUtils::deleteAlbumDirOnServer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteAlbumModel
function deleteAlbumModel($albumId)
{
$responseDTO = new ResponseDTO(DELETE_ALBUM_FORM);
try {
$userLogged = SessionUtils::getUserLogged();
$defaultAlbumId = $userLogged->getDefaultAlbumId();
if ($defaultAlbumId == $albumId) {
$responseDTO->setErrField(ERROR_RESPONSE, "Non puoi eliminare il tuo album di default");
return $responseDTO;
}
$albumDAO = new AlbumDAO();
$deletePhotoInAlbum = $albumDAO->deletePhotoInAlbum($albumId);
$deletedAlbum = $albumDAO->deleteAlbumById($albumId);
if ($deletedAlbum != 1) {
$responseDTO->setErrField(ERROR_RESPONSE, "Errore durante l'eliminazione dell'album");
$responseDTO->setSubElementId($albumId);
} else {
$userLogged = SessionUtils::getUserLogged();
FileUtils::deleteAlbumDirOnServer($userLogged->getUserId(), $albumId);
if (isset($_POST[JAVASCRIPT_ON]) && $_POST[JAVASCRIPT_ON] === "Y") {
$responseDTO->setResponseSucc("#album" . $albumId);
} else {
$responseDTO->setResponseSucc("Album eliminato con successo!");
}
}
return $responseDTO;
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
throw $authExp;
} catch (Exception $e) {
throw $e;
}
}
示例2: deleteUser
public function deleteUser($userId)
{
try {
$model = $this->getModel();
$deletedUser = $model->deleteUserModel($userId);
FileUtils::deleteAlbumDirOnServer($userId, NULL);
if (isset($_POST[JAVASCRIPT_ON]) && $_POST[JAVASCRIPT_ON] === "Y") {
echo json_encode($deletedUser->jsonSerialize());
} else {
$responseDTO = new ResponseDTO(DELETE_USER_FORM);
$responseDTO->setResponseSucc("Utente eliminato con successo");
SessionUtils::setError($responseDTO);
header("Location: " . URL . USERLIST_CONTROLLER);
exit;
}
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
parent::userNotLogged($authExp);
} catch (Exception $e) {
throw $e;
}
}
示例3: deleteUserForm
public function deleteUserForm()
{
try {
$model = $this->getModel();
$deletedUser = $model->deleteUserModel();
$userLogged = SessionUtils::getUserLogged();
FileUtils::deleteAlbumDirOnServer($userLogged->getUserId(), NULL);
SessionUtils::logout();
if (isset($_POST[JAVASCRIPT_ON]) && $_POST[JAVASCRIPT_ON] === "Y") {
echo json_encode($deletedUser->jsonSerialize());
} else {
header("Location: " . URL . LOGIN_CONTROLLER);
exit;
}
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
parent::userNotLogged($authExp);
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (Exception $e) {
throw $e;
}
}