1
0
Fork 0

Only check phar validity if phar.readonly is false

pull/2931/head
Jordi Boggiano 2014-04-16 10:23:45 +02:00
parent ab4ecb9471
commit 3251f9f1aa
1 changed files with 6 additions and 5 deletions

View File

@ -174,17 +174,18 @@ EOT
{ {
try { try {
@chmod($newFilename, 0777 & ~umask()); @chmod($newFilename, 0777 & ~umask());
// test the phar validity if (!ini_get('phar.readonly')) {
$phar = new \Phar($newFilename); // test the phar validity
// free the variable to unlock the file $phar = new \Phar($newFilename);
unset($phar); // free the variable to unlock the file
unset($phar);
}
// copy current file into installations dir // copy current file into installations dir
if ($backupTarget && file_exists($localFilename)) { if ($backupTarget && file_exists($localFilename)) {
@copy($localFilename, $backupTarget); @copy($localFilename, $backupTarget);
} }
unset($phar);
rename($newFilename, $localFilename); rename($newFilename, $localFilename);
} catch (\Exception $e) { } catch (\Exception $e) {
if ($backupTarget) { if ($backupTarget) {