public function executeDelete() { $token = mfwRequest::param('token', null, 'POST'); if ($token !== mfwSession::get(self::SESKEY_TOKEN)) { return $this->buildErrorPage('Bad Request', array(self::HTTP_400_BADREQUEST)); } mfwSession::clear(self::SESKEY_TOKEN); $con = mfwDBConnection::getPDO(); $con->beginTransaction(); try { $this->app = ApplicationDb::retrieveByPKForUpdate($this->app->getId()); $this->package->delete($con); if ($this->app->getLastUpload() == $this->package->getCreated()) { // 最終アップデート時刻を前のものに戻す $pkg = PackageDb::selectNewestOneByAppId($this->app->getId()); $lastupload = $pkg ? $pkg->getCreated() : null; $this->app->updateLastUpload($lastupload, $con); } $con->commit(); } catch (Exception $e) { $con->rollback(); error_log(__METHOD__ . '(' . __LINE__ . '): ' . get_class($e) . ":{$e->getMessage()}"); throw $e; } apache_log('app_id', $this->app->getId()); apache_log('pkg_id', $this->package->getId()); apache_log('platform', $this->package->getPlatform()); try { $this->package->deleteFile(); } catch (Exception $e) { // S3から削除出来なくてもDBからは消えているので許容する } return $this->redirect("/app?id={$this->app->getId()}"); }
public static function logout() { mfwSession::clear(self::SESKEY); }
protected function clearUrlBeforelogin() { mfwSession::clear(self::SESKEY_URL_BEFORE_LOGIN); }