1 | <?php |
||
18 | class RepositoryFiller |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Database. |
||
23 | * |
||
24 | * @var ExtendedPdoInterface |
||
25 | */ |
||
26 | protected $database; |
||
27 | |||
28 | /** |
||
29 | * Database cache. |
||
30 | * |
||
31 | * @var DatabaseCache |
||
32 | */ |
||
33 | protected $databaseCache; |
||
34 | |||
35 | /** |
||
36 | * RepositoryFiller constructor. |
||
37 | * |
||
38 | * @param ExtendedPdoInterface $database Database. |
||
39 | * @param DatabaseCache $database_cache Database cache. |
||
40 | */ |
||
41 | 132 | public function __construct(ExtendedPdoInterface $database, DatabaseCache $database_cache) |
|
48 | |||
49 | /** |
||
50 | * Creates a project. |
||
51 | * |
||
52 | * @param string $path Path. |
||
53 | * @param integer $is_deleted Is Deleted. |
||
54 | * @param string|null $bug_regexp Bug regexp. |
||
55 | * |
||
56 | * @return integer |
||
57 | */ |
||
58 | 54 | public function addProject($path, $is_deleted = 0, $bug_regexp = null) |
|
70 | |||
71 | /** |
||
72 | * Changes project status. |
||
73 | * |
||
74 | * @param integer $project_id Project ID. |
||
75 | * @param integer $is_deleted Is deleted flag. |
||
76 | * |
||
77 | * @return void |
||
78 | */ |
||
79 | 7 | public function setProjectStatus($project_id, $is_deleted) |
|
89 | |||
90 | /** |
||
91 | * Changes project bug regexp. |
||
92 | * |
||
93 | * @param integer $project_id Project ID. |
||
94 | * @param string|null $bug_regexp Bug regexp. |
||
95 | * |
||
96 | * @return void |
||
97 | */ |
||
98 | 9 | public function setProjectBugRegexp($project_id, $bug_regexp) |
|
108 | |||
109 | /** |
||
110 | * Adds commit. |
||
111 | * |
||
112 | * @param integer $revision Revision. |
||
113 | * @param string $author Author. |
||
114 | * @param integer $date Date. |
||
115 | * @param string $message Message. |
||
116 | * |
||
117 | * @return void |
||
118 | */ |
||
119 | 50 | public function addCommit($revision, $author, $date, $message) |
|
130 | |||
131 | /** |
||
132 | * Adds commit to project. |
||
133 | * |
||
134 | * @param integer $revision Revision. |
||
135 | * @param integer $project_id Project ID. |
||
136 | * |
||
137 | * @return void |
||
138 | */ |
||
139 | 46 | public function addCommitToProject($revision, $project_id) |
|
145 | |||
146 | /** |
||
147 | * Adds path. |
||
148 | * |
||
149 | * @param string $path Path. |
||
150 | * @param string $ref Ref. |
||
151 | * @param string $project_path Project path. |
||
152 | * @param integer $revision Revision. |
||
153 | * |
||
154 | * @return integer |
||
155 | */ |
||
156 | 63 | public function addPath($path, $ref, $project_path, $revision) |
|
176 | |||
177 | /** |
||
178 | * Adds path to commit. |
||
179 | * |
||
180 | * @param integer $revision Revision. |
||
181 | * @param string $action Action. |
||
182 | * @param string $kind Kind. |
||
183 | * @param integer $path_id Path ID. |
||
184 | * @param integer|null $copy_revision Copy revision. |
||
185 | * @param integer|null $copy_path_id Copy path ID. |
||
186 | * |
||
187 | * @return void |
||
188 | */ |
||
189 | 58 | public function addPathToCommit($revision, $action, $kind, $path_id, $copy_revision = null, $copy_path_id = null) |
|
202 | |||
203 | /** |
||
204 | * Touches given path. |
||
205 | * |
||
206 | * @param string $path Path. |
||
207 | * @param integer $revision Revision. |
||
208 | * @param array $fields_hash Fields hash. |
||
209 | * |
||
210 | * @return array |
||
211 | * @throws \InvalidArgumentException When "$fields_hash" is empty. |
||
212 | */ |
||
213 | 22 | public function touchPath($path, $revision, array $fields_hash) |
|
233 | |||
234 | /** |
||
235 | * Propagates revision last seen. |
||
236 | * |
||
237 | * @param string $path Path. |
||
238 | * @param string $revision Revision. |
||
239 | * |
||
240 | * @return array |
||
241 | */ |
||
242 | 63 | protected function propagateRevisionLastSeen($path, $revision) |
|
283 | |||
284 | /** |
||
285 | * Returns fields, that needs to be changed for given path. |
||
286 | * |
||
287 | * @param string $action Action. |
||
288 | * @param integer $revision Revision. |
||
289 | * @param array $path_data Path data. |
||
290 | * |
||
291 | * @return array |
||
292 | */ |
||
293 | 27 | public function getPathTouchFields($action, $revision, array $path_data) |
|
316 | |||
317 | /** |
||
318 | * Sets project path for given paths. |
||
319 | * |
||
320 | * @param array $path_ids Path IDs. |
||
321 | * @param string $project_path Project path. |
||
322 | * |
||
323 | * @return void |
||
324 | */ |
||
325 | 3 | public function movePathsIntoProject(array $path_ids, $project_path) |
|
335 | |||
336 | /** |
||
337 | * Adds commit with bugs. |
||
338 | * |
||
339 | * @param array $bugs Bugs. |
||
340 | * @param integer $revision Revision. |
||
341 | * |
||
342 | * @return void |
||
343 | */ |
||
344 | 42 | public function addBugsToCommit(array $bugs, $revision) |
|
355 | |||
356 | /** |
||
357 | * Adds merge commit. |
||
358 | * |
||
359 | * @param integer $revision Revision. |
||
360 | * @param array $merged_revisions Merged revisions. |
||
361 | * |
||
362 | * @return void |
||
363 | */ |
||
364 | 44 | public function addMergeCommit($revision, array $merged_revisions) |
|
375 | |||
376 | /** |
||
377 | * Adds ref to project. |
||
378 | * |
||
379 | * @param string $ref Ref. |
||
380 | * @param integer $project_id Project ID. |
||
381 | * |
||
382 | * @return integer |
||
383 | */ |
||
384 | 25 | public function addRefToProject($ref, $project_id) |
|
392 | |||
393 | /** |
||
394 | * Adds ref to commit and commit to project. |
||
395 | * |
||
396 | * @param integer $revision Revision. |
||
397 | * @param integer $ref_id Ref ID. |
||
398 | * |
||
399 | * @return void |
||
400 | */ |
||
401 | 24 | public function addCommitToRef($revision, $ref_id) |
|
407 | |||
408 | } |
||
409 |