BUGFIX Use "wb" argument in ManifestBuilder fopen() calls for better cross-platform compatibility

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100862 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-03-11 03:06:39 +00:00 committed by Sam Minnee
parent 12d1ea9edb
commit 6cf5a055e6

View File

@ -83,7 +83,7 @@ class ManifestBuilder {
// Build the manifest, including the tests/ folders // Build the manifest, including the tests/ folders
$manifestInfo = self::get_manifest_info(BASE_PATH); $manifestInfo = self::get_manifest_info(BASE_PATH);
$manifest = self::generate_php_file($manifestInfo); $manifest = self::generate_php_file($manifestInfo);
if($fh = fopen($testManifestFile, "w")) { if($fh = fopen($testManifestFile, 'wb')) {
fwrite($fh, $manifest); fwrite($fh, $manifest);
fclose($fh); fclose($fh);
} else { } else {
@ -110,7 +110,7 @@ class ManifestBuilder {
$manifestInfo = self::get_manifest_info(BASE_PATH, array("tests")); $manifestInfo = self::get_manifest_info(BASE_PATH, array("tests"));
$manifest = self::generate_php_file($manifestInfo); $manifest = self::generate_php_file($manifestInfo);
if($fh = fopen(MANIFEST_FILE, "w")) { if($fh = fopen(MANIFEST_FILE, 'wb')) {
fwrite($fh, $manifest); fwrite($fh, $manifest);
fclose($fh); fclose($fh);
} else { } else {
@ -427,8 +427,8 @@ class ManifestBuilder {
$cacheContent = '<?php $cacheContent = '<?php
$classes = ' . var_export($classes,true) . '; $classes = ' . var_export($classes,true) . ';
$interfaces = ' . var_export($interfaces,true) . ';'; $interfaces = ' . var_export($interfaces,true) . ';';
if($fh = fopen($parseCacheFile,'wb')) { if($fh = fopen($parseCacheFile, 'wb')) {
fwrite($fh, $cacheContent); fwrite($fh, $cacheContent);
fclose($fh); fclose($fh);
} }