function CheckDir($sourceDir) { $counter = 0; $sourceDir = FixDirSlash($sourceDir); // Copy files and directories. $sourceDirHandler = opendir($sourceDir); while ($file = readdir($sourceDirHandler)) { // Skip ".", ".." and hidden fields (Unix). if (substr($file, 0, 1) == '.') { continue; } $sourcefilePath = $sourceDir . $file; if (is_dir($sourcefilePath)) { $counter += CheckDir($sourcefilePath); } if (!is_file($sourcefilePath) || @GetFileExtension($sourcefilePath) != 'php' || !CheckUtf8Bom($sourcefilePath)) { continue; } echo $sourcefilePath, '<br />'; $counter++; } return $counter; }
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); } }