24
24
$ announce = !empty ( $ _POST ['announce ' ] );
25
25
$ language = trim ( $ _POST ['language ' ] );
26
26
27
- $ namePath = substr ( md5 ( $ branch . $ patches . time () ), 0 , 10 );
27
+ $ wiki = substr ( md5 ( $ branch . $ patches . time () ), 0 , 10 );
28
28
$ server = detectProtocol () . ':// ' . $ _SERVER ['HTTP_HOST ' ];
29
29
$ serverPath = preg_replace ( '`/[^/]*$` ' , '' , $ _SERVER ['REQUEST_URI ' ] );
30
30
@@ -57,10 +57,10 @@ function check_connection() {
57
57
58
58
// Create an entry for the wiki before we have resolved patches.
59
59
// Will be updated later.
60
- insert_wiki_data ( $ namePath , $ creator , $ created , $ branchDesc );
60
+ insert_wiki_data ( $ wiki , $ creator , $ created , $ branchDesc );
61
61
62
62
function abandon ( string $ errHtml ) {
63
- global $ namePath ;
63
+ global $ wiki ;
64
64
$ errJson = json_encode ( $ errHtml );
65
65
echo <<<EOT
66
66
<script>
@@ -70,7 +70,7 @@ function abandon( string $errHtml ) {
70
70
pd.notify( 'Your PatchDemo wiki failed to build', $ errJson );
71
71
</script>
72
72
EOT ;
73
- delete_wiki ( $ namePath );
73
+ delete_wiki ( $ wiki );
74
74
die ( $ errHtml );
75
75
}
76
76
@@ -113,15 +113,15 @@ function set_progress( float $pc, string $label ) {
113
113
new OOUI \ButtonWidget ( [
114
114
'label ' => 'Open wiki ' ,
115
115
'flags ' => [ 'progressive ' , 'primary ' ],
116
- 'href ' => "wikis/ $ namePath /w/ " ,
116
+ 'href ' => "wikis/ $ wiki /w/ " ,
117
117
'disabled ' => true ,
118
118
'classes ' => [ 'openWiki ' ],
119
119
'infusable ' => true ,
120
120
] ),
121
121
[
122
122
'align ' => 'inline ' ,
123
123
'classes ' => [ 'openWikiField ' ],
124
- 'label ' => "When complete, use this button to open your wiki ( $ namePath ) " ,
124
+ 'label ' => "When complete, use this button to open your wiki ( $ wiki ) " ,
125
125
'help ' => new OOUI \HtmlSnippet ( <<<EOT
126
126
You can log in as the following users using the password <code>patchdemo1</code>
127
127
<ul class="userList">
@@ -314,7 +314,7 @@ function set_progress( float $pc, string $label ) {
314
314
) . ") " ;
315
315
316
316
// Update DB record with patches applied
317
- wiki_add_patches ( $ namePath , $ patchesApplied );
317
+ wiki_add_patches ( $ wiki , $ patchesApplied );
318
318
319
319
// Choose repositories to enable
320
320
$ repos = get_repo_data ();
@@ -406,7 +406,7 @@ function set_progress( float $pc, string $label ) {
406
406
407
407
$ baseEnv = [
408
408
'PATCHDEMO ' => __DIR__ ,
409
- 'NAME ' => $ namePath ,
409
+ 'NAME ' => $ wiki ,
410
410
];
411
411
412
412
$ start = 5 ;
@@ -560,21 +560,21 @@ static function ( string $repo ) use ( $repos ): bool {
560
560
'T ' . $ task ,
561
561
"Test wiki **created** on [[ $ server$ serverPath | Patch demo ]] " . ( $ creator ? ' by ' . $ creator : '' ) . " using patch(es) linked to this task: " .
562
562
"\n" .
563
- "$ server$ serverPath/wikis/ $ namePath /w/ " .
563
+ "$ server$ serverPath/wikis/ $ wiki /w/ " .
564
564
( $ hasOOUI ?
565
565
"\n\n" .
566
566
"Also created an **OOUI Demos** page: " .
567
567
"\n" .
568
- "$ server$ serverPath/wikis/ $ namePath /w/build/ooui/demos "
568
+ "$ server$ serverPath/wikis/ $ wiki /w/build/ooui/demos "
569
569
: ""
570
570
)
571
571
);
572
572
}
573
- wiki_add_announced_tasks ( $ namePath , $ linkedTasks );
573
+ wiki_add_announced_tasks ( $ wiki , $ linkedTasks );
574
574
}
575
575
576
576
$ timeToCreate = time () - $ startTime ;
577
- wiki_set_time_to_create ( $ namePath , $ timeToCreate );
577
+ wiki_set_time_to_create ( $ wiki , $ timeToCreate );
578
578
579
579
set_progress ( 100 , 'All done! Wiki created in ' . $ timeToCreate . 's. ' );
580
580
0 commit comments