function Mark($targetDir, $version) { echo "\n", 'Marking with version "', $version, '"', "\n"; $targetDir = FixDirSlash($targetDir); $files = array('fckeditor.js', 'editor/_source/fckeditorapi.js', 'editor/dialog/fck_about.html'); $build = FCKVersionMarker::CalculateBuild(); foreach ($files as $file) { $data = file_get_contents($targetDir . $file); $data = str_replace('[Development]', $version, $data); $data = str_replace('[DEV]', $build, $data); SaveStringToFile($data, $targetDir . $file); } }
} if (count($argv) < 4) { ExitError('Please specify the source and the target directories and the version number.'); } $sourceDir = $argv[1]; $targetDir = $argv[2]; $version = $argv[3]; // Get the package definition file. $xmlFileName = 'fckreleaser.xml'; if (isset($argv[4])) { $xmlFileName = $argv[4]; } echo '### Release started', "\n\n"; // ### Copy the files. $releaser = new FCKReleaser($sourceDir, $targetDir, $xmlFileName); $releaser->Run(); // ### Set version and build information. FCKVersionMarker::Mark($targetDir, $version); echo "\n", '### Compress source', "\n\n"; // ### Run the packager in the target directory. // Save the current directory. $curDir = getcwd(); // Move to the target ; chdir($targetDir); // Run the packager. $packager = new FCKPackager(); $packager->LoadDefinitionFile('fckpackager.xml'); $packager->Run(); // Move back to the startup dir. chdir($curDir); echo "\n\n", '### Release finished (version "', $version, '")', "\n";