2019-03-24 21:44:46 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 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 General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
*/
|
|
|
|
|
|
2023-12-15 15:52:25 +00:00
|
|
|
namespace MediaWiki\PoolCounter;
|
|
|
|
|
|
2023-08-25 12:29:41 +00:00
|
|
|
use MediaWiki\Status\Status;
|
|
|
|
|
|
2019-03-24 21:44:46 +00:00
|
|
|
/**
|
|
|
|
|
* A default PoolCounter, which provides no locking.
|
2022-09-22 23:47:42 +00:00
|
|
|
*
|
|
|
|
|
* @internal
|
|
|
|
|
* @since 1.33
|
2019-03-24 21:44:46 +00:00
|
|
|
*/
|
|
|
|
|
class PoolCounterNull extends PoolCounter {
|
|
|
|
|
|
|
|
|
|
public function __construct() {
|
2022-09-22 23:21:34 +00:00
|
|
|
// No parameters needed
|
2019-03-24 21:44:46 +00:00
|
|
|
}
|
|
|
|
|
|
2020-06-04 07:49:25 +00:00
|
|
|
public function acquireForMe( $timeout = null ) {
|
2019-03-24 21:44:46 +00:00
|
|
|
return Status::newGood( PoolCounter::LOCKED );
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-04 07:49:25 +00:00
|
|
|
public function acquireForAnyone( $timeout = null ) {
|
2019-03-24 21:44:46 +00:00
|
|
|
return Status::newGood( PoolCounter::LOCKED );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function release() {
|
|
|
|
|
return Status::newGood( PoolCounter::RELEASED );
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-12-15 15:52:25 +00:00
|
|
|
|
2024-07-05 16:16:27 +00:00
|
|
|
/** @deprecated class alias since 1.42 */
|
2023-12-15 15:52:25 +00:00
|
|
|
class_alias( PoolCounterNull::class, 'PoolCounterNull' );
|