Merge "Selenium: replace UserLoginPage with BlankPage where possible"
[lhc/web/wiklou.git] / includes / libs / services / DestructibleService.php
1 <?php
2
3 namespace Wikimedia\Services;
4
5 /**
6 * Interface for destructible services.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * http://www.gnu.org/copyleft/gpl.html
22 *
23 * @file
24 *
25 * @since 1.27
26 */
27
28 /**
29 * DestructibleService defines a standard interface for shutting down a service instance.
30 * The intended use is for a service container to be able to shut down services that should
31 * no longer be used, and allow such services to release any system resources.
32 *
33 * @note There is no expectation that services will be destroyed when the process (or web request)
34 * terminates.
35 */
36 interface DestructibleService {
37
38 /**
39 * Notifies the service object that it should expect to no longer be used, and should release
40 * any system resources it may own. The behavior of all service methods becomes undefined after
41 * destroy() has been called. It is recommended that implementing classes should throw an
42 * exception when service methods are accessed after destroy() has been called.
43 */
44 public function destroy();
45
46 }
47
48 /**
49 * Retain the old class name for backwards compatibility.
50 * @deprecated since 1.33
51 */
52 class_alias( DestructibleService::class, 'MediaWiki\Services\DestructibleService' );