version 1.1.1.1, 2012/02/21 23:47:59
|
version 1.1.1.2, 2012/05/29 12:34:41
|
Line 257 static void phar_mung_server_vars(char *fname, char *e
|
Line 257 static void phar_mung_server_vars(char *fname, char *e
|
|
|
static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, int entry_len, char *arch, char *basename, char *ru, int ru_len TSRMLS_DC) /* {{{ */ |
static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, int entry_len, char *arch, char *basename, char *ru, int ru_len TSRMLS_DC) /* {{{ */ |
{ |
{ |
char *name = NULL, buf[8192], *cwd; | char *name = NULL, buf[8192]; |
| const char *cwd; |
zend_syntax_highlighter_ini syntax_highlighter_ini; |
zend_syntax_highlighter_ini syntax_highlighter_ini; |
sapi_header_line ctr = {0}; |
sapi_header_line ctr = {0}; |
size_t got; |
size_t got; |
Line 427 static void phar_do_403(char *entry, int entry_len TSR
|
Line 428 static void phar_do_403(char *entry, int entry_len TSR
|
sapi_header_line ctr = {0}; |
sapi_header_line ctr = {0}; |
|
|
ctr.response_code = 403; |
ctr.response_code = 403; |
ctr.line_len = sizeof("HTTP/1.0 403 Access Denied"); | ctr.line_len = sizeof("HTTP/1.0 403 Access Denied")-1; |
ctr.line = "HTTP/1.0 403 Access Denied"; |
ctr.line = "HTTP/1.0 403 Access Denied"; |
sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); |
sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); |
sapi_send_headers(TSRMLS_C); |
sapi_send_headers(TSRMLS_C); |
Line 452 static void phar_do_404(phar_archive_data *phar, char
|
Line 453 static void phar_do_404(phar_archive_data *phar, char
|
} |
} |
|
|
ctr.response_code = 404; |
ctr.response_code = 404; |
ctr.line_len = sizeof("HTTP/1.0 404 Not Found")+1; | ctr.line_len = sizeof("HTTP/1.0 404 Not Found")-1; |
ctr.line = "HTTP/1.0 404 Not Found"; |
ctr.line = "HTTP/1.0 404 Not Found"; |
sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); |
sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); |
sapi_send_headers(TSRMLS_C); |
sapi_send_headers(TSRMLS_C); |
Line 540 PHP_METHOD(Phar, running)
|
Line 541 PHP_METHOD(Phar, running)
|
return; |
return; |
} |
} |
|
|
fname = zend_get_executed_filename(TSRMLS_C); | fname = (char*)zend_get_executed_filename(TSRMLS_C); |
fname_len = strlen(fname); |
fname_len = strlen(fname); |
|
|
if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) { |
if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) { |
Line 574 PHP_METHOD(Phar, mount)
|
Line 575 PHP_METHOD(Phar, mount)
|
return; |
return; |
} |
} |
|
|
fname = zend_get_executed_filename(TSRMLS_C); | fname = (char*)zend_get_executed_filename(TSRMLS_C); |
fname_len = strlen(fname); |
fname_len = strlen(fname); |
|
|
#ifdef PHP_WIN32 |
#ifdef PHP_WIN32 |
Line 658 PHP_METHOD(Phar, webPhar)
|
Line 659 PHP_METHOD(Phar, webPhar)
|
zval *mimeoverride = NULL, *rewrite = NULL; |
zval *mimeoverride = NULL, *rewrite = NULL; |
char *alias = NULL, *error, *index_php = NULL, *f404 = NULL, *ru = NULL; |
char *alias = NULL, *error, *index_php = NULL, *f404 = NULL, *ru = NULL; |
int alias_len = 0, ret, f404_len = 0, free_pathinfo = 0, ru_len = 0; |
int alias_len = 0, ret, f404_len = 0, free_pathinfo = 0, ru_len = 0; |
char *fname, *basename, *path_info, *mime_type = NULL, *entry, *pt; | char *fname, *path_info, *mime_type = NULL, *entry, *pt; |
| const char *basename; |
int fname_len, entry_len, code, index_php_len = 0, not_cgi; |
int fname_len, entry_len, code, index_php_len = 0, not_cgi; |
phar_archive_data *phar = NULL; |
phar_archive_data *phar = NULL; |
phar_entry_info *info = NULL; |
phar_entry_info *info = NULL; |
Line 668 PHP_METHOD(Phar, webPhar)
|
Line 670 PHP_METHOD(Phar, webPhar)
|
} |
} |
|
|
phar_request_initialize(TSRMLS_C); |
phar_request_initialize(TSRMLS_C); |
fname = zend_get_executed_filename(TSRMLS_C); | fname = (char*)zend_get_executed_filename(TSRMLS_C); |
fname_len = strlen(fname); |
fname_len = strlen(fname); |
|
|
if (phar_open_executed_filename(alias, alias_len, &error TSRMLS_CC) != SUCCESS) { |
if (phar_open_executed_filename(alias, alias_len, &error TSRMLS_CC) != SUCCESS) { |
Line 891 PHP_METHOD(Phar, webPhar)
|
Line 893 PHP_METHOD(Phar, webPhar)
|
char *tmp = NULL, sa = '\0'; |
char *tmp = NULL, sa = '\0'; |
sapi_header_line ctr = {0}; |
sapi_header_line ctr = {0}; |
ctr.response_code = 301; |
ctr.response_code = 301; |
ctr.line_len = sizeof("HTTP/1.1 301 Moved Permanently")+1; | ctr.line_len = sizeof("HTTP/1.1 301 Moved Permanently")-1; |
ctr.line = "HTTP/1.1 301 Moved Permanently"; |
ctr.line = "HTTP/1.1 301 Moved Permanently"; |
sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); |
sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC); |
|
|
Line 934 PHP_METHOD(Phar, webPhar)
|
Line 936 PHP_METHOD(Phar, webPhar)
|
} |
} |
|
|
if (mimeoverride && zend_hash_num_elements(Z_ARRVAL_P(mimeoverride))) { |
if (mimeoverride && zend_hash_num_elements(Z_ARRVAL_P(mimeoverride))) { |
char *ext = zend_memrchr(entry, '.', entry_len); | const char *ext = zend_memrchr(entry, '.', entry_len); |
zval **val; |
zval **val; |
|
|
if (ext) { |
if (ext) { |
Line 1480 PHP_METHOD(Phar, unlinkArchive)
|
Line 1482 PHP_METHOD(Phar, unlinkArchive)
|
return; |
return; |
} |
} |
|
|
zname = zend_get_executed_filename(TSRMLS_C); | zname = (char*)zend_get_executed_filename(TSRMLS_C); |
zname_len = strlen(zname); |
zname_len = strlen(zname); |
|
|
if (zname_len > 7 && !memcmp(zname, "phar://", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) { |
if (zname_len > 7 && !memcmp(zname, "phar://", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) { |
Line 2201 static int phar_copy_file_contents(phar_entry_info *en
|
Line 2203 static int phar_copy_file_contents(phar_entry_info *en
|
|
|
static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool compress TSRMLS_DC) /* {{{ */ |
static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool compress TSRMLS_DC) /* {{{ */ |
{ |
{ |
char *oldname = NULL, *oldpath = NULL; | const char *oldname = NULL; |
| char *oldpath = NULL; |
char *basename = NULL, *basepath = NULL; |
char *basename = NULL, *basepath = NULL; |
char *newname = NULL, *newpath = NULL; |
char *newname = NULL, *newpath = NULL; |
zval *ret, arg1; |
zval *ret, arg1; |
Line 4296 static int phar_extract_file(zend_bool overwrite, phar
|
Line 4299 static int phar_extract_file(zend_bool overwrite, phar
|
php_stream_statbuf ssb; |
php_stream_statbuf ssb; |
int len; |
int len; |
php_stream *fp; |
php_stream *fp; |
char *fullpath, *slash; | char *fullpath; |
| const char *slash; |
mode_t mode; |
mode_t mode; |
|
|
if (entry->is_mounted) { |
if (entry->is_mounted) { |