Skip to content

Commit

Permalink
Fix issue pyrus#12 - Lack of file_exists handling
Browse files Browse the repository at this point in the history
  • Loading branch information
helgi committed May 27, 2011
1 parent c511d1a commit 5ee1a38
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/PEAR2/Pyrus/Developer/PackageFile/Commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -792,14 +792,24 @@ function processFile($ext, $source, $dest, $replace)

function saveConfigM4($ext)
{
$m4 = file_get_contents(dirname($this->skeleton) . '/config.m4');
$filename = dirname($this->skeleton) . '/config.m4';
if (!file_exists($filename)) {
return false; // FIXME proper handling
}

$m4 = file_get_contents($filename);
file_put_contents($ext . '/config.m4', str_replace(array('@EXTNAME@', '@extname@'),
array(strtoupper($ext), $ext), $m4));
}

function saveConfigW32($ext)
{
$w32 = file_get_contents(dirname($this->skeleton) . '/config.w32');
$filename = dirname($this->skeleton) . '/config.w32';
if (!file_exists($filename)) {
return false; // FIXME proper handling
}

$w32 = file_get_contents($filename);
file_put_contents($ext . '/config.w32', str_replace(array('@EXTNAME@', '@extname@'),
array(strtoupper($ext), $ext), $w32));
}
Expand Down

0 comments on commit 5ee1a38

Please sign in to comment.