Skip to content
This repository was archived by the owner on Sep 23, 2023. It is now read-only.

Commit c174876

Browse files
edg2sMatmaRex
authored andcommitted
Rename $namePath to $wiki
Consistent with how this variable is named elsewhere
1 parent d11ebd5 commit c174876

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

new.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
$announce = !empty( $_POST['announce'] );
2525
$language = trim( $_POST['language'] );
2626

27-
$namePath = substr( md5( $branch . $patches . time() ), 0, 10 );
27+
$wiki = substr( md5( $branch . $patches . time() ), 0, 10 );
2828
$server = detectProtocol() . '://' . $_SERVER['HTTP_HOST'];
2929
$serverPath = preg_replace( '`/[^/]*$`', '', $_SERVER['REQUEST_URI'] );
3030

@@ -57,10 +57,10 @@ function check_connection() {
5757

5858
// Create an entry for the wiki before we have resolved patches.
5959
// Will be updated later.
60-
insert_wiki_data( $namePath, $creator, $created, $branchDesc );
60+
insert_wiki_data( $wiki, $creator, $created, $branchDesc );
6161

6262
function abandon( string $errHtml ) {
63-
global $namePath;
63+
global $wiki;
6464
$errJson = json_encode( $errHtml );
6565
echo <<<EOT
6666
<script>
@@ -70,7 +70,7 @@ function abandon( string $errHtml ) {
7070
pd.notify( 'Your PatchDemo wiki failed to build', $errJson );
7171
</script>
7272
EOT;
73-
delete_wiki( $namePath );
73+
delete_wiki( $wiki );
7474
die( $errHtml );
7575
}
7676

@@ -113,15 +113,15 @@ function set_progress( float $pc, string $label ) {
113113
new OOUI\ButtonWidget( [
114114
'label' => 'Open wiki',
115115
'flags' => [ 'progressive', 'primary' ],
116-
'href' => "wikis/$namePath/w/",
116+
'href' => "wikis/$wiki/w/",
117117
'disabled' => true,
118118
'classes' => [ 'openWiki' ],
119119
'infusable' => true,
120120
] ),
121121
[
122122
'align' => 'inline',
123123
'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)",
125125
'help' => new OOUI\HtmlSnippet( <<<EOT
126126
You can log in as the following users using the password <code>patchdemo1</code>
127127
<ul class="userList">
@@ -314,7 +314,7 @@ function set_progress( float $pc, string $label ) {
314314
) . ")";
315315

316316
// Update DB record with patches applied
317-
wiki_add_patches( $namePath, $patchesApplied );
317+
wiki_add_patches( $wiki, $patchesApplied );
318318

319319
// Choose repositories to enable
320320
$repos = get_repo_data();
@@ -406,7 +406,7 @@ function set_progress( float $pc, string $label ) {
406406

407407
$baseEnv = [
408408
'PATCHDEMO' => __DIR__,
409-
'NAME' => $namePath,
409+
'NAME' => $wiki,
410410
];
411411

412412
$start = 5;
@@ -560,21 +560,21 @@ static function ( string $repo ) use ( $repos ): bool {
560560
'T' . $task,
561561
"Test wiki **created** on [[ $server$serverPath | Patch demo ]]" . ( $creator ? ' by ' . $creator : '' ) . " using patch(es) linked to this task:" .
562562
"\n" .
563-
"$server$serverPath/wikis/$namePath/w/" .
563+
"$server$serverPath/wikis/$wiki/w/" .
564564
( $hasOOUI ?
565565
"\n\n" .
566566
"Also created an **OOUI Demos** page:" .
567567
"\n" .
568-
"$server$serverPath/wikis/$namePath/w/build/ooui/demos"
568+
"$server$serverPath/wikis/$wiki/w/build/ooui/demos"
569569
: ""
570570
)
571571
);
572572
}
573-
wiki_add_announced_tasks( $namePath, $linkedTasks );
573+
wiki_add_announced_tasks( $wiki, $linkedTasks );
574574
}
575575

576576
$timeToCreate = time() - $startTime;
577-
wiki_set_time_to_create( $namePath, $timeToCreate );
577+
wiki_set_time_to_create( $wiki, $timeToCreate );
578578

579579
set_progress( 100, 'All done! Wiki created in ' . $timeToCreate . 's.' );
580580

0 commit comments

Comments
 (0)