- Prevent phars with empty manifests flushing to disk

- This would've fixed that test... removing clean section

@Greg: I commented out the call that breaks the Windows build, pending a decision about its future.
This commit is contained in:
Steph Fox 2008-04-29 12:06:54 +00:00
parent 7d3e9ef952
commit 8559a2dbde
3 changed files with 6 additions and 5 deletions

View file

@ -2092,6 +2092,10 @@ int phar_flush(phar_archive_data *phar, char *user_stub, long len, int convert,
return EOF;
}
if (!zend_hash_num_elements(&phar->manifest)) {
return EOF;
}
if (phar->is_zip) {
return phar_zip_flush(phar, user_stub, len, convert, error TSRMLS_CC);
}

View file

@ -320,9 +320,10 @@ static int phar_file_action(phar_entry_data *phar, char *mime_type, int code, ch
if (EG(return_value_ptr_ptr) && *EG(return_value_ptr_ptr)) {
zval_ptr_dtor(EG(return_value_ptr_ptr));
}
/*
if (EG(exception)) {
zend_throw_exception_internal(NULL TSRMLS_CC);
}
} */
zend_bailout();
}
return PHAR_MIME_PHP;

View file

@ -143,10 +143,6 @@ echo $e->getMessage() . "\n";
}
?>
===DONE===
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/whatever.tar');
?>
--EXPECTF--
Warning: Phar::mungServer() expects parameter 1 to be array, string given in %sbadparameters.php on line %d