4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 * http://www.gnu.org/copyleft/gpl.html
22 namespace MediaWiki\Page
;
24 use MediaWiki\Config\ServiceOptions
;
25 use MediaWiki\Permissions\PermissionManager
;
31 use Wikimedia\Rdbms\LoadBalancer
;
36 class MovePageFactory
{
37 /** @var ServiceOptions */
40 /** @var LoadBalancer */
41 private $loadBalancer;
43 /** @var NamespaceInfo */
46 /** @var WatchedItemStore */
47 private $watchedItems;
49 /** @var PermissionManager */
56 * @todo Make this a const when we drop HHVM support (T192166)
59 public static $constructorOptions = [
61 'ContentHandlerUseDB',
64 public function __construct(
65 ServiceOptions
$options,
66 LoadBalancer
$loadBalancer,
67 NamespaceInfo
$nsInfo,
68 WatchedItemStore
$watchedItems,
69 PermissionManager
$permMgr,
72 $options->assertRequiredOptions( self
::$constructorOptions );
74 $this->options
= $options;
75 $this->loadBalancer
= $loadBalancer;
76 $this->nsInfo
= $nsInfo;
77 $this->watchedItems
= $watchedItems;
78 $this->permMgr
= $permMgr;
79 $this->repoGroup
= $repoGroup;
87 public function newMovePage( Title
$from, Title
$to ) : MovePage
{
88 return new MovePage( $from, $to, $this->options
, $this->loadBalancer
, $this->nsInfo
,
89 $this->watchedItems
, $this->permMgr
, $this->repoGroup
);