Skip to content

Commit

Permalink
Do a file_exists check before assuming it is there with a file_get_co…
Browse files Browse the repository at this point in the history
…ntents()
  • Loading branch information
helgi committed May 31, 2011
1 parent 5ee1a38 commit 428f28b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/PEAR2/Pyrus/Developer/PackageFile/Commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,12 @@ function postProcessProtos($options, $ext, $protos)

function processFile($ext, $source, $dest, $replace)
{
$s = file_get_contents($this->skeleton . '/' . $source);
$filename = $this->skeleton . '/' . $source;
if (!file_exists($filename)) {
return false; // FIXME proper handling
}

$s = file_get_contents($filename);
file_put_contents($ext . '/' . $dest, str_replace(array_keys($replace), array_values($replace), $s));
}

Expand Down

0 comments on commit 428f28b

Please sign in to comment.