コード例 #1
0
{
    global $studio;
    $studio->loadFile($file);
    $studio->curText = $studio->replaceH4Slots($studio->curText);
    $studio->parseSlots($studio->curText);
    $studio->cleanUpSlots();
    $newSlots = $studio->upgradeSlots();
    copy($file, $file . '.sbk');
    $studio->saveFile($file, $newSlots);
}
$htmlFiles = array();
function findHTMLFiles($path)
{
    $dir = dir($path);
    while ($entry = $dir->read()) {
        if (file_exists('modules/' . $entry . '/metadata/studio.php')) {
            require_once 'modules/' . $entry . '/metadata/studio.php';
            echo "Upgrading {$entry} for studio ... \n";
            foreach ($GLOBALS['studioDefs'][$entry] as $label => $def) {
                if (!empty($def['template_file']) && substr_count($def['template_file'], '.html') > 0) {
                    upgradeHTML($def['template_file']);
                }
            }
        }
    }
}
findHTMLFiles('modules');
StudioParser::clearWorkingDirectory();
require_once 'modules/Versions/Version.php';
Version::mark_upgraded('Studio Files', '4.5.0', '4.5.0');