Skip to content

Commit

Permalink
publish.php: put main file at bottom instead of top, to avoid Referen…
Browse files Browse the repository at this point in the history
…ceError
  • Loading branch information
NovemLinguae committed Feb 19, 2025
1 parent ed39e5c commit 432d5fb
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions DraftCleaner/publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_A
}

function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {
$wikitext = "// === Compiled with Novem Linguae's publish.php script ======================\n\n";
$wikitext .= "$(async function() {\n\n// === $MAIN_FILE_PATH ======================================================\n\n";

$wikitext .= file_get_contents($MAIN_FILE_PATH);
$wikitext = "// === Compiled with Novem Linguae's publish.php script ======================";

$files = scandir($CLASSES_FOLDER_PATH);
foreach ( $files as $fileName ) {
Expand All @@ -106,6 +103,9 @@ function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {
$wikitext .= "\n\n// === $path ======================================================\n\n" . $classText;
}

$wikitext .= "$(async function() {\n\n// === $MAIN_FILE_PATH ======================================================\n\n";
$wikitext .= file_get_contents($MAIN_FILE_PATH);

$wikitext .= "\n\n});";

$wikitext = deleteNoWikiTags($wikitext);
Expand Down
8 changes: 4 additions & 4 deletions GANReviewTool/publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_A
}

function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {
$wikitext = "// === Compiled with Novem Linguae's publish.php script ======================\n\n";
$wikitext .= "$(async function() {\n\n// === $MAIN_FILE_PATH ======================================================\n\n";

$wikitext .= file_get_contents($MAIN_FILE_PATH);
$wikitext = "// === Compiled with Novem Linguae's publish.php script ======================";

$files = scandir($CLASSES_FOLDER_PATH);
foreach ( $files as $fileName ) {
Expand All @@ -106,6 +103,9 @@ function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {
$wikitext .= "\n\n// === $path ======================================================\n\n" . $classText;
}

$wikitext .= "$(async function() {\n\n// === $MAIN_FILE_PATH ======================================================\n\n";
$wikitext .= file_get_contents($MAIN_FILE_PATH);

$wikitext .= "\n\n});";

$wikitext = deleteNoWikiTags($wikitext);
Expand Down
8 changes: 4 additions & 4 deletions SpeciesHelper/publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_A
}

function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {
$wikitext = "// === Compiled with Novem Linguae's publish.php script ======================\n\n";
$wikitext .= "$(async function() {\n\n// === $MAIN_FILE_PATH ======================================================\n\n";

$wikitext .= file_get_contents($MAIN_FILE_PATH);
$wikitext = "// === Compiled with Novem Linguae's publish.php script ======================";

$files = scandir($CLASSES_FOLDER_PATH);
foreach ( $files as $fileName ) {
Expand All @@ -106,6 +103,9 @@ function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {
$wikitext .= "\n\n// === $path ======================================================\n\n" . $classText;
}

$wikitext .= "$(async function() {\n\n// === $MAIN_FILE_PATH ======================================================\n\n";
$wikitext .= file_get_contents($MAIN_FILE_PATH);

$wikitext .= "\n\n});";

$wikitext = deleteNoWikiTags($wikitext);
Expand Down
8 changes: 4 additions & 4 deletions UnblockReview/publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_A
}

function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {
$wikitext = "// === Compiled with Novem Linguae's publish.php script ======================\n\n";
$wikitext .= "$(async function() {\n\n// === $MAIN_FILE_PATH ======================================================\n\n";

$wikitext .= file_get_contents($MAIN_FILE_PATH);
$wikitext = "// === Compiled with Novem Linguae's publish.php script ======================";

$files = scandir($CLASSES_FOLDER_PATH);
foreach ( $files as $fileName ) {
Expand All @@ -106,6 +103,9 @@ function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {
$wikitext .= "\n\n// === $path ======================================================\n\n" . $classText;
}

$wikitext .= "$(async function() {\n\n// === $MAIN_FILE_PATH ======================================================\n\n";
$wikitext .= file_get_contents($MAIN_FILE_PATH);

$wikitext .= "\n\n});";

$wikitext = deleteNoWikiTags($wikitext);
Expand Down
8 changes: 4 additions & 4 deletions VoteCounter/publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ function writeWikitextToWikipedia($ABSOLUTE_PATH_TO_TEMP_DIRECTORY, $WIKIPEDIA_A
}

function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {
$wikitext = "// === Compiled with Novem Linguae's publish.php script ======================\n\n";
$wikitext .= "$(async function() {\n\n// === $MAIN_FILE_PATH ======================================================\n\n";

$wikitext .= file_get_contents($MAIN_FILE_PATH);
$wikitext = "// === Compiled with Novem Linguae's publish.php script ======================";

$files = scandir($CLASSES_FOLDER_PATH);
foreach ( $files as $fileName ) {
Expand All @@ -106,6 +103,9 @@ function generateWikitext($MAIN_FILE_PATH, $CLASSES_FOLDER_PATH) {
$wikitext .= "\n\n// === $path ======================================================\n\n" . $classText;
}

$wikitext .= "$(async function() {\n\n// === $MAIN_FILE_PATH ======================================================\n\n";
$wikitext .= file_get_contents($MAIN_FILE_PATH);

$wikitext .= "\n\n});";

$wikitext = deleteNoWikiTags($wikitext);
Expand Down

0 comments on commit 432d5fb

Please sign in to comment.