From: Diogo Cordeiro Date: Fri, 7 Jun 2019 21:04:02 +0000 (+0100) Subject: [SESSION] Add backwards compatibility for third party plugins depending on old Sessio... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=08b6cfde666f0d4822b8515730cc48784413db77;p=quix0rs-gnu-social.git [SESSION] Add backwards compatibility for third party plugins depending on old Session::cleanup() Namely Qvitter --- diff --git a/classes/Session.php b/classes/Session.php index c6df9d12ff..d3a64ec75d 100644 --- a/classes/Session.php +++ b/classes/Session.php @@ -1,36 +1,41 @@ . + /** * Table Definition for session * - * StatusNet - the distributed open-source microblogging tool - * Copyright (C) 2009, StatusNet, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * @package GNUsocial + * @author Evan Prodromou + * @author Brion Vibber + * @author Mikael Nordfeldth + * @author Sorokin Alexei + * @author Diogo Cordeiro + * @copyright 2019 Free Software Foundation, Inc http://www.fsf.org + * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} +defined('GNUSOCIAL') || die(); require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; /** - * Table definition for Session - * * Superclass representing a saved session as it exists in the database. * - * @author GNU social + * @copyright 2019 Free Software Foundation, Inc http://www.fsf.org + * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ class Session extends Managed_DataObject { @@ -48,6 +53,8 @@ class Session extends Managed_DataObject /** * Returns an array describing how the session is stored in the database. + * + * @return array */ public static function schemaDef() { @@ -64,4 +71,16 @@ class Session extends Managed_DataObject ], ]; } + + /** + * New code should NOT call this function. + * Dummy function for backwards compatibility with older plugins like Qvitter. + * Stuff to do before the request teardown. + * + * @return void + */ + public static function cleanup() + { + session_write_close(); + } } diff --git a/lib/internalsessionhandler.php b/lib/internalsessionhandler.php index 91a1b3bf67..981adf29ad 100644 --- a/lib/internalsessionhandler.php +++ b/lib/internalsessionhandler.php @@ -1,32 +1,39 @@ . + /** * GNU social's implementation of SessionHandler * - * StatusNet - the distributed open-source microblogging tool - * Copyright (C) 2009, StatusNet, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * @package GNUsocial + * @author Evan Prodromou + * @author Brion Vibber + * @author Mikael Nordfeldth + * @author Sorokin Alexei + * @author Diogo Cordeiro + * @copyright 2019 Free Software Foundation, Inc http://www.fsf.org + * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ -if (!defined('GNUSOCIAL')) { - exit(1); -} +defined('GNUSOCIAL') || die(); /** * Superclass representing the associated interfaces of session handling. * - * @author GNU social + * @copyright 2019 Free Software Foundation, Inc http://www.fsf.org + * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later */ class InternalSessionHandler implements SessionHandlerInterface {