cvs: php4 /sapi/apache mod_php4.c php_apache.c
| From: | Zeev Suraski | Date: | Mon, 07 May 2001 11:07:23 +0000 |
| Subject: | cvs: php4 /sapi/apache mod_php4.c php_apache.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-5583@lists.php.net to get a copy of this message | ||
zeev Mon May 7 04:07:23 2001 EDT
Modified files:
/php4/sapi/apache mod_php4.c php_apache.c
Log:
Allow virtual() of PHP files. We may have to improve the detection code a
bit, but it worked well on everything I tried.
Index: php4/sapi/apache/mod_php4.c
diff -u php4/sapi/apache/mod_php4.c:1.92 php4/sapi/apache/mod_php4.c:1.93
--- php4/sapi/apache/mod_php4.c:1.92 Tue Mar 13 10:39:38 2001
+++ php4/sapi/apache/mod_php4.c Mon May 7 04:07:22 2001
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php4.c,v 1.92 2001/03/13 18:39:38 stas Exp $ */
+/* $Id: mod_php4.c,v 1.93 2001/05/07 11:07:22 zeev Exp $ */
#define NO_REGEX_EXTRA_H
#ifdef WIN32
@@ -69,9 +69,9 @@
char *sapi_apache_read_cookies(SLS_D);
int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers
SLS_DC);
int sapi_apache_send_headers(sapi_headers_struct *sapi_headers SLS_DC);
-int send_php(request_rec *r, int display_source_mode, char *filename);
-int send_parsed_php(request_rec * r);
-int send_parsed_php_source(request_rec * r);
+static int send_php(request_rec *r, int display_source_mode, char *filename);
+static int send_parsed_php(request_rec * r);
+static int send_parsed_php_source(request_rec * r);
int php_xbithack_handler(request_rec * r);
void php_init_handler(server_rec *s, pool *p);
@@ -436,7 +436,7 @@
return mimetype;
}
-int send_php(request_rec *r, int display_source_mode, char *filename)
+static int send_php(request_rec *r, int display_source_mode, char *filename)
{
int retval;
HashTable *per_dir_conf;
@@ -446,6 +446,17 @@
PLS_FETCH();
APLS_FETCH();
+ if (r->assbackwards && r->protocol && !strcmp(r->protocol,
"INCLUDED")) {
+ zend_file_handle fh;
+
+ fh.filename = r->filename;
+ fh.opened_path = NULL;
+ fh.free_filename = 0;
+ fh.type = ZEND_HANDLE_FILENAME;
+ zend_execute_scripts(ZEND_INCLUDE CLS_CC ELS_CC, 1, &fh);
+ return OK;
+ }
+
if (setjmp(EG(bailout))!=0) {
return OK;
}
@@ -527,13 +538,13 @@
}
-int send_parsed_php(request_rec * r)
+static int send_parsed_php(request_rec * r)
{
return send_php(r, 0, NULL);
}
-int send_parsed_php_source(request_rec * r)
+static int send_parsed_php_source(request_rec * r)
{
return send_php(r, 1, NULL);
}
Index: php4/sapi/apache/php_apache.c
diff -u php4/sapi/apache/php_apache.c:1.28 php4/sapi/apache/php_apache.c:1.29
--- php4/sapi/apache/php_apache.c:1.28 Sun Feb 25 22:07:35 2001
+++ php4/sapi/apache/php_apache.c Mon May 7 04:07:22 2001
@@ -17,7 +17,7 @@
| David Sklar <sklar@student.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_apache.c,v 1.28 2001/02/26 06:07:35 andi Exp $ */
+/* $Id: php_apache.c,v 1.29 2001/05/07 11:07:22 zeev Exp $ */
#define NO_REGEX_EXTRA_H
@@ -312,15 +312,6 @@
RETURN_FALSE;
}
- /* Cannot include another PHP file because of global conflicts */
- if (rr->content_type &&
- !strcmp(rr->content_type, PHP_MIME_TYPE)) {
- php_error(E_WARNING, "Cannot include a PHP file "
- "(use <code><?include \"%s\"></code> instead)",
(*filename)->value.str.val);
- if (rr) destroy_sub_req (rr);
- RETURN_FALSE;
- }
-
php_end_ob_buffers(1);
php_header();