CatPreLocalSettingsFiles.php

From Freephile Wiki
Revision as of 21:41, 28 March 2023 by Admin (talk | contribs) (POST local settings files)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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  POST LOCAL SETTINGS content\n\n";

#    (1) Load all PHP files in postLocalSettings.d for all wikis
echo "// dumping contents of global postLocalSettings.d\n\n";
foreach ( glob("$m_deploy/public/postLocalSettings.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 postLocalSettings.d for this wiki
echo "// dumping contents of postLocalSettings.d for $wikiId\n\n";
foreach ( glob("$m_deploy/public/wikis/$wikiId/postLocalSettings.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  POST LOCAL SETTINGS\n";