-
-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathCreateWikiHookRunner.php
More file actions
196 lines (175 loc) · 4.55 KB
/
Copy pathCreateWikiHookRunner.php
File metadata and controls
196 lines (175 loc) · 4.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?php
namespace Miraheze\CreateWiki\Hooks;
use MediaWiki\HookContainer\HookContainer;
use MediaWiki\User\User;
use Miraheze\CreateWiki\Services\WikiRequestManager;
use Wikimedia\Rdbms\DBConnRef;
class CreateWikiHookRunner implements
CreateWikiAfterCreationWithExtraDataHook,
CreateWikiCreationExtraFieldsHook,
CreateWikiCreationHook,
CreateWikiDeletionHook,
CreateWikiGenerateDatabaseListsHook,
CreateWikiReadPersistentModelHook,
CreateWikiRemoteWikiCommitHook,
CreateWikiRenameHook,
CreateWikiSetContainersAccessFailedHook,
CreateWikiStateClosedHook,
CreateWikiStateOpenHook,
CreateWikiStatePrivateHook,
CreateWikiStatePublicHook,
CreateWikiTablesHook,
CreateWikiWritePersistentModelHook,
RequestWikiFormDescriptorModifyHook,
RequestWikiQueueFormDescriptorModifyHook
{
public function __construct(
private readonly HookContainer $hookContainer,
) {
}
/** @inheritDoc */
public function onCreateWikiAfterCreationWithExtraData( array $extraData, string $dbname ): void {
$this->hookContainer->run(
'CreateWikiAfterCreationWithExtraData',
[ $extraData, $dbname ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiCreationExtraFields( array &$extraFields ): void {
$this->hookContainer->run(
'CreateWikiCreationExtraFields',
[ &$extraFields ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiCreation( string $dbname, bool $private ): void {
$this->hookContainer->run(
'CreateWikiCreation',
[ $dbname, $private ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiDeletion(
DBConnRef $cwdb,
string $dbname
): void {
$this->hookContainer->run(
'CreateWikiDeletion',
[ $cwdb, $dbname ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiGenerateDatabaseLists( array &$databaseLists ): void {
$this->hookContainer->run(
'CreateWikiGenerateDatabaseLists',
[ &$databaseLists ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiReadPersistentModel( string &$pipeline ): void {
$this->hookContainer->run(
'CreateWikiReadPersistentModel',
[ &$pipeline ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiRemoteWikiCommit( string $dbname ): void {
$this->hookContainer->run(
'CreateWikiRemoteWikiCommit',
[ $dbname ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiRename(
DBConnRef $cwdb,
string $oldDbName,
string $newDbName
): void {
$this->hookContainer->run(
'CreateWikiRename',
[ $cwdb, $oldDbName, $newDbName ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiSetContainersAccessFailed( string $dir, string $zone ): bool {
return $this->hookContainer->run(
'CreateWikiSetContainersAccessFailed',
[ $dir, $zone ]
);
}
/** @inheritDoc */
public function onCreateWikiStateClosed( string $dbname ): void {
$this->hookContainer->run(
'CreateWikiStateClosed',
[ $dbname ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiStateOpen( string $dbname ): void {
$this->hookContainer->run(
'CreateWikiStateOpen',
[ $dbname ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiStatePrivate( string $dbname ): void {
$this->hookContainer->run(
'CreateWikiStatePrivate',
[ $dbname ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiStatePublic( string $dbname ): void {
$this->hookContainer->run(
'CreateWikiStatePublic',
[ $dbname ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiTables( array &$tables ): void {
$this->hookContainer->run(
'CreateWikiTables',
[ &$tables ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onCreateWikiWritePersistentModel( string $pipeline ): bool {
return $this->hookContainer->run(
'CreateWikiWritePersistentModel',
[ $pipeline ]
);
}
/** @inheritDoc */
public function onRequestWikiFormDescriptorModify( array &$formDescriptor ): void {
$this->hookContainer->run(
'RequestWikiFormDescriptorModify',
[ &$formDescriptor ],
[ 'abortable' => false ]
);
}
/** @inheritDoc */
public function onRequestWikiQueueFormDescriptorModify(
array &$formDescriptor,
User $user,
WikiRequestManager $wikiRequestManager
): void {
$this->hookContainer->run(
'RequestWikiQueueFormDescriptorModify',
[ &$formDescriptor, $user, $wikiRequestManager ],
[ 'abortable' => false ]
);
}
}