Interesting.
Well, the "quick&dirty" way would be to take any file in sources, themes and the root and require_once all of them.
Only thing to pay attention should be the order to avoid issues, but if you start instantiating the bootstrap class and loading the autoloader, that should do most of the work.
It may be something like:
<?php
$forum_path = '/path/to/forum';
$root_files = [
'index.php',
'bootstrap.php',
'email_imap_cron.php',
'emailpost.php',
'emailtopic.php',
'ssi_examples.php',
'SSI.php',
'subscriptions.php'
];
function getFilesRecursive($dir, $ext = '.php')
{
$full_paths = array();
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::SELF_FIRST,
RecursiveIteratorIterator::CATCH_GET_CHILD
);
$filter = new RegexIterator($iterator, '/' . preg_quote($ext) . '$/');
foreach ($filter as $path => $file)
{
if ($file->isDir() === false)
{
$full_paths[] = $path;
}
}
return $full_paths;
}
require_once($forum_path . '/bootstrap.php');
$source_files = getFilesRecursive($forum_path . '/sources');
$themes_files = getFilesRecursive($forum_path . '/themes');
foreach ($root_files as $k => $file)
{
$root_files[$k] = $forum_path . '/' . $root_files[$k];
}
foreach ([$source_files, $themes_files, $root_files] as $files)
{
foreach ($files as $file)
{
require_once($file);
}
}
No idea if it works or not.