UserStorageHandler::getInstance()->shutdown();
}
catch (\Exception $exception) {
- die("WCF::destruct() Unhandled exception: ".$exception->getMessage()."\n".base64_encode($exception->getTraceAsString()));
+ die("<pre>WCF::destruct() Unhandled exception: ".$exception->getMessage()."\n\n".$exception->getTraceAsString());
}
}
self::handleException(new exception\SystemException($e->getMessage(), $e->getCode(), '', $e));
}
catch (\Exception $exception) {
- die("WCF::handleException() Unhandled exception: ".$exception->getMessage()."\n".base64_encode($exception->getTraceAsString()));
+ die("<pre>WCF::handleException() Unhandled exception: ".$exception->getMessage()."\n\n".$exception->getTraceAsString());
}
}
*/
public function shutdown() {
WCF::getDB()->beginTransaction();
+
// remove outdated entries
if (!empty($this->resetFields)) {
$sql = "DELETE FROM wcf".WCF_N."_user_storage
WHERE userID = ?
AND field = ?";
$statement = WCF::getDB()->prepareStatement($sql);
-
- foreach ($this->resetFields as $userID => $data) {
- foreach ($data as $fields) {
- foreach ($fields as $field) {
- $statement->execute(array(
- $userID,
- $field
- ));
- }
+ foreach ($this->resetFields as $userID => $fields) {
+ foreach ($fields as $field) {
+ $statement->execute(array(
+ $userID,
+ $field
+ ));
}
}
}
VALUES (?, ?, ?)";
$statement = WCF::getDB()->prepareStatement($sql);
- foreach ($this->updateFields as $userID => $data) {
- foreach ($data as $fieldValues) {
- foreach ($fieldValues as $field => $fieldValue) {
- $statement->execute(array(
- $userID,
- $field,
- $fieldValue
- ));
- }
+ foreach ($this->updateFields as $userID => $fieldValues) {
+ foreach ($fieldValues as $field => $fieldValue) {
+ $statement->execute(array(
+ $userID,
+ $field,
+ $fieldValue
+ ));
}
}
}
+
WCF::getDB()->commitTransaction();
$this->resetFields = $this->updateFields = array();