示例#1
0
function upgradeDCEFiles($argv, $instanceUpgradePath)
{
    //copy and update following files from upgrade package
    $upgradeTheseFiles = array('cron.php', 'download.php', 'index.php', 'install.php', 'soap.php', 'sugar_version.php', 'vcal_server.php');
    foreach ($upgradeTheseFiles as $file) {
        $srcFile = clean_path("{$instanceUpgradePath}/{$file}");
        $destFile = clean_path("{$argv[3]}/{$file}");
        if (file_exists($srcFile)) {
            if (!is_dir(dirname($destFile))) {
                mkdir_recursive(dirname($destFile));
                // make sure the directory exists
            }
            copy_recursive($srcFile, $destFile);
            $_GET['TEMPLATE_PATH'] = $destFile;
            $_GET['CONVERT_FILE_ONLY'] = true;
            if (!class_exists('TemplateConverter')) {
                include $argv[7] . 'templateConverter.php';
            } else {
                TemplateConverter::convertFile($_GET['TEMPLATE_PATH']);
            }
        }
    }
}