/** * ページ名を変更する(ソースコードを移動する)。 * * @param Page $page 変更前ページ * @param Page $newpage 変更後ページ * @return bool 成功すればtrue。 */ protected function _rename($page, $newpage) { if ($newpage->isexist()) { return false; } $db = DataBase::getinstance(); $db->begin(); $mail = Mail::getinstance(); $old = $mail->setsending(false); $newpage->write($page->getsource()); $page->write(''); $mail->setsending($old); try { Attach::getinstance($page)->move($newpage); } catch (DBException $e) { $db->rollback(); return false; } $this->notify(array($page, $newpage)); $this->mail($page, $newpage); $db->commit(); return true; }