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 {