Difference between revisions of "CatPreLocalSettingsFiles.php"

From Freephile Wiki
Jump to navigation Jump to search
(POST local settings files)
 
(PRE LocalSettings.php)
 
Line 8: Line 8:
 
$wikiId = 'wiki'; // wiki or meta
 
$wikiId = 'wiki'; // wiki or meta
  
echo "// begin  POST LOCAL SETTINGS content\n\n";
+
echo "// begin  PRE LOCAL SETTINGS content\n\n";
  
#    (1) Load all PHP files in postLocalSettings.d for all wikis
+
#    (1) Load all PHP files in preLocalSettings.d for all wikis
echo "// dumping contents of global postLocalSettings.d\n\n";
+
echo "// dumping contents of global preLocalSettings.d\n\n";
foreach ( glob("$m_deploy/public/postLocalSettings.d/*.php") as $filename) {
+
foreach ( glob("$m_deploy/public/preLocalSettings.d/*.php") as $filename) {
 
     echo "// begin contents of  $filename\n";
 
     echo "// begin contents of  $filename\n";
 
print file_get_contents($filename);
 
print file_get_contents($filename);
 
echo "// end contents of  $filename\n\n";
 
echo "// end contents of  $filename\n\n";
 
}
 
}
#    (2) Load all PHP files in postLocalSettings.d for this wiki
+
#    (2) Load all PHP files in preLocalSettings.d for this wiki
echo "// dumping contents of postLocalSettings.d for $wikiId\n\n";
+
echo "// dumping contents of preLocalSettings.d for $wikiId\n\n";
foreach ( glob("$m_deploy/public/wikis/$wikiId/postLocalSettings.d/*.php") as $filename) {
+
foreach ( glob("$m_deploy/public/wikis/$wikiId/preLocalSettings.d/*.php") as $filename) {
 
     echo "// begin contents of  $filename\n";
 
     echo "// begin contents of  $filename\n";
 
print file_get_contents($filename);
 
print file_get_contents($filename);
Line 25: Line 25:
 
}
 
}
  
echo "// end of  POST LOCAL SETTINGS\n";
+
echo "// end of  PRE LOCAL SETTINGS\n";
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 21:43, 28 March 2023

This simple script was used to merge all the settings files for my wiki in Meza


<?php

$m_deploy = '/opt/.deploy-meza';
$wikiId = 'wiki'; // wiki or meta

echo "// begin  PRE LOCAL SETTINGS content\n\n";

#    (1) Load all PHP files in preLocalSettings.d for all wikis
echo "// dumping contents of global preLocalSettings.d\n\n";
foreach ( glob("$m_deploy/public/preLocalSettings.d/*.php") as $filename) {
    echo "// begin contents of  $filename\n";
	print file_get_contents($filename);
	echo "// end contents of  $filename\n\n";
}
#    (2) Load all PHP files in preLocalSettings.d for this wiki
echo "// dumping contents of preLocalSettings.d for $wikiId\n\n";
foreach ( glob("$m_deploy/public/wikis/$wikiId/preLocalSettings.d/*.php") as $filename) {
    echo "// begin contents of  $filename\n";
	print file_get_contents($filename);
	echo "// end contents of  $filename\n\n";
}

echo "// end of  PRE LOCAL SETTINGS\n";