php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"alias \"%s\" is already used for archive \"%s\" cannot be overloaded with \"%s\"",alias,(*fd_ptr)->fname,fname);
returnNULL;
if(error){
spprintf(error,0,"alias \"%s\" is already used for archive \"%s\" cannot be overloaded with \"%s\"",alias,(*fd_ptr)->fname,fname);
@ -517,7 +528,11 @@ static int phar_open_loaded(char *fname, int fname_len, char *alias, int alias_l
*pphar=NULL;
}
if(phar&&alias&&(options&REPORT_ERRORS)){
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"alias \"%s\" is already used for archive \"%s\" cannot be overloaded with \"%s\"",alias,phar->fname,fname);
if(error){
if(*error){
spprintf(error,0,"alias \"%s\" is already used for archive \"%s\" cannot be overloaded with \"%s\"",alias,phar->fname,fname);
}
}
}
returnFAILURE;
}
@ -566,7 +581,7 @@ static int phar_parse_metadata(php_stream *fp, char **buffer, char *endbuffer, z
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"phar \"%s\" is API version %1.u.%1.u.%1.u, and cannot be processed",fname,manifest_ver>>12,(manifest_ver>>8)&0xF,(manifest_ver>>4)&0x0F);
if(error){
spprintf(error,0,"phar \"%s\" is API version %1.u.%1.u.%1.u, and cannot be processed",fname,manifest_ver>>12,(manifest_ver>>8)&0xF,(manifest_ver>>4)&0x0F);
}
returnFAILURE;
}
@ -666,7 +686,9 @@ int phar_open_file(php_stream *fp, char *fname, int fname_len, char *alias, int
||memcmp(sig_buf+4,"GBMB",4)){
efree(savebuf);
php_stream_close(fp);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"phar \"%s\" has a broken signature",fname);
if(error){
spprintf(error,0,"phar \"%s\" has a broken signature",fname);
}
returnFAILURE;
}
PHAR_GET_32(sig_ptr,sig_flags);
@ -697,7 +719,9 @@ int phar_open_file(php_stream *fp, char *fname, int fname_len, char *alias, int
||memcmp(digest,saved,sizeof(digest))){
efree(savebuf);
php_stream_close(fp);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"phar \"%s\" has a broken signature",fname);
if(error){
spprintf(error,0,"phar \"%s\" has a broken signature",fname);
}
returnFAILURE;
}
@ -736,7 +760,9 @@ int phar_open_file(php_stream *fp, char *fname, int fname_len, char *alias, int
||memcmp(digest,saved,sizeof(digest))){
efree(savebuf);
php_stream_close(fp);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"phar \"%s\" has a broken signature",fname);
if(error){
spprintf(error,0,"phar \"%s\" has a broken signature",fname);
}
returnFAILURE;
}
@ -752,13 +778,17 @@ int phar_open_file(php_stream *fp, char *fname, int fname_len, char *alias, int
default:
efree(savebuf);
php_stream_close(fp);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"phar \"%s\" has a broken signature",fname);
if(error){
spprintf(error,0,"phar \"%s\" has a broken signature",fname);
}
returnFAILURE;
}
}elseif(PHAR_G(require_hash)){
efree(savebuf);
php_stream_close(fp);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"phar \"%s\" does not have a signature",fname);
if(error){
spprintf(error,0,"phar \"%s\" does not have a signature",fname);
}
returnFAILURE;
}else{
sig_flags=0;
@ -784,7 +814,9 @@ int phar_open_file(php_stream *fp, char *fname, int fname_len, char *alias, int
if(signature){
efree(signature);
}
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"cannot load phar \"%s\" with implicit alias \"%s\" under different alias \"%s\"",fname,buffer,alias);
if(error){
spprintf(error,0,"cannot load phar \"%s\" with implicit alias \"%s\" under different alias \"%s\"",fname,buffer,alias);
}
returnFAILURE;
}
alias_len=tmp_len;
@ -914,7 +946,7 @@ int phar_open_file(php_stream *fp, char *fname, int fname_len, char *alias, int
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"phar error: Could not write %d characters to \"%s\" in phar \"%s\"",(int)count,data->internal_file->filename,data->phar->fname);
php_stream_wrapper_log_error(stream->wrapper,stream->flagsTSRMLS_CC,"phar error: Could not write %d characters to \"%s\" in phar \"%s\"",(int)count,data->internal_file->filename,data->phar->fname);
@ -1790,6 +1855,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
returnEOF;
}
if(error){
*error=NULL;
}
if(archive->fp&&!archive->is_brandnew){
oldfile=archive->fp;
closeoldfile=0;
@ -1808,7 +1876,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
php_stream_close(oldfile);
}
php_stream_close(newfile);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to read resource to copy stub to new phar \"%s\"",archive->fname);
if(error){
spprintf(error,0,"unable to read resource to copy stub to new phar \"%s\"",archive->fname);
}
returnEOF;
}
if(len==-1){
@ -1822,7 +1892,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
php_stream_close(oldfile);
}
php_stream_close(newfile);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to copy stub from resource to new phar \"%s\"",archive->fname);
if(error){
spprintf(error,0,"unable to copy stub from resource to new phar \"%s\"",archive->fname);
}
returnEOF;
}
archive->halt_offset=offset;
@ -1832,7 +1904,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
php_stream_close(oldfile);
}
php_stream_close(newfile);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to create stub from string in new phar \"%s\"",archive->fname);
if(error){
spprintf(error,0,"unable to create stub from string in new phar \"%s\"",archive->fname);
}
returnEOF;
}
archive->halt_offset=len;
@ -1844,7 +1918,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
php_stream_close(oldfile);
}
php_stream_close(newfile);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to copy stub of old phar to new phar \"%s\"",archive->fname);
if(error){
spprintf(error,0,"unable to copy stub of old phar to new phar \"%s\"",archive->fname);
}
returnEOF;
}
}else{
@ -1855,7 +1931,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
php_stream_close(oldfile);
}
php_stream_close(newfile);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to create stub in new phar \"%s\"",archive->fname);
if(error){
spprintf(error,0,"unable to create stub in new phar \"%s\"",archive->fname);
}
returnEOF;
}
}
@ -1928,9 +2006,13 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
}
php_stream_close(newfile);
if(entry->flags&PHAR_ENT_COMPRESSED_GZ){
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to gzip compress file \"%s\" to new phar \"%s\"",entry->filename,archive->fname);
if(error){
spprintf(error,0,"unable to gzip compress file \"%s\" to new phar \"%s\"",entry->filename,archive->fname);
}
}else{
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to bzip2 compress file \"%s\" to new phar \"%s\"",entry->filename,archive->fname);
if(error){
spprintf(error,0,"unable to bzip2 compress file \"%s\" to new phar \"%s\"",entry->filename,archive->fname);
}
}
efree(buf);
returnEOF;
@ -1946,7 +2028,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
read=php_stream_read(file,buf,8192);
if(read){
if(read!=php_stream_write(entry->cfp,buf,read)){
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to write to file \"%s\" while creating new phar \"%s\"",entry->filename,archive->fname);
if(error){
spprintf(error,0,"unable to write to file \"%s\" while creating new phar \"%s\"",entry->filename,archive->fname);
}
efree(buf);
php_stream_filter_remove(filter,1TSRMLS_CC);
php_stream_close(entry->cfp);
@ -2000,7 +2084,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
}
php_stream_close(newfile);
archive->alias_len=restore_alias_len;
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to write manifest header of new phar \"%s\"",archive->fname);
if(error){
spprintf(error,0,"unable to write manifest header of new phar \"%s\"",archive->fname);
}
returnEOF;
}
@ -2017,7 +2103,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
}
php_stream_close(newfile);
archive->alias_len=restore_alias_len;
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to write manifest meta-data of new phar \"%s\"",archive->fname);
if(error){
spprintf(error,0,"unable to write manifest meta-data of new phar \"%s\"",archive->fname);
}
returnEOF;
}
}else{
@ -2028,7 +2116,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
}
php_stream_close(newfile);
archive->alias_len=restore_alias_len;
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to write manifest header of new phar \"%s\"",archive->fname);
if(error){
spprintf(error,0,"unable to write manifest header of new phar \"%s\"",archive->fname);
}
returnEOF;
}
}
@ -2055,7 +2145,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
php_stream_close(oldfile);
}
php_stream_close(newfile);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to write filename of file \"%s\" to manifest of new phar \"%s\"",entry->filename,archive->fname);
if(error){
spprintf(error,0,"unable to write filename of file \"%s\" to manifest of new phar \"%s\"",entry->filename,archive->fname);
}
returnEOF;
}
/* set the manifest meta-data:
@ -2087,7 +2179,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
php_stream_close(oldfile);
}
php_stream_close(newfile);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to write temporary manifest of file \"%s\" to manifest of new phar \"%s\"",entry->filename,archive->fname);
if(error){
spprintf(error,0,"unable to write temporary manifest of file \"%s\" to manifest of new phar \"%s\"",entry->filename,archive->fname);
}
returnEOF;
}
smart_str_free(&metadata_str);
@ -2116,7 +2210,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
php_stream_close(oldfile);
}
php_stream_close(newfile);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to seek to start of file \"%s\" while creating new phar \"%s\"",entry->filename,archive->fname);
if(error){
spprintf(error,0,"unable to seek to start of file \"%s\" while creating new phar \"%s\"",entry->filename,archive->fname);
}
returnEOF;
}
file=oldfile;
@ -2131,7 +2227,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
php_stream_close(oldfile);
}
php_stream_close(newfile);
php_error_docref(NULLTSRMLS_CC,E_RECOVERABLE_ERROR,"unable to write contents of file \"%s\" to new phar \"%s\"",entry->filename,archive->fname);
if(error){
spprintf(error,0,"unable to write contents of file \"%s\" to new phar \"%s\"",entry->filename,archive->fname);
}
returnEOF;
}
entry->is_modified=0;
@ -2226,7 +2324,9 @@ int phar_flush(phar_archive_data *archive, char *user_stub, long len TSRMLS_DC)
%satal error: Phar::mapPhar(): internal corruption of phar "%s" (compressed and uncompressed size does not match for uncompressed entry) in %s on line %d
internal corruption of phar "%s" (compressed and uncompressed size does not match for uncompressed entry)
%satal error: Phar::loadPhar(): alias "copy" is already used for archive "%s029.1.phar.php" cannot be overloaded with "%s029.2.phar.php" in %s029.php on line %d
alias "copy" is already used for archive "%s029.1.phar.php" cannot be overloaded with "%s029.2.phar.php"===DONE===