本文整理匯總了PHP中History::restore方法的典型用法代碼示例。如果您正苦於以下問題:PHP History::restore方法的具體用法?PHP History::restore怎麽用?PHP History::restore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類History
的用法示例。
在下文中一共展示了History::restore方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Image
$originalSessionImageInfo = $history->getOriginalImage();
if (CONFIG_SYS_DEMO_ENABLE && sizeof($originalSessionImageInfo)) {
$originalImage = $session->getSessionDir() . $originalSessionImageInfo['info']['name'];
} else {
$originalImage = $_POST['file_path'];
}
include_once CLASS_IMAGE;
$image = new Image();
if ($image->loadImage($sessionImage)) {
$imageInfo = $image->getOriginalImageInfo();
if (!@copy($sessionImage, $originalImage)) {
$error = IMG_UNDO_COPY_FAILED;
} else {
//remove the session image
if (@unlink($sessionImage)) {
$history->restore();
}
//only one left, remove the session original if demo
if ($history->getNumRestorable() == 0 && CONFIG_SYS_DEMO_ENABLE && sizeof($originalSessionImageInfo)) {
@unlink($session->getSessionDir() . $originalSessionImageInfo['info']['name']);
$originalImage = $_POST['file_path'];
}
}
$imagePath = $originalImage;
} else {
$error = IMG_SAVE_IMG_OPEN_FAILED;
}
if (isset($imageInfo)) {
$info .= ",width:" . $imageInfo['width'] . "\n";
$info .= ",height:" . $imageInfo['height'] . "\n";
$info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n";