CatPreLocalSettingsFiles.php

From Freephile Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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";