]> granicus.if.org Git - php/commitdiff
Fixed bug #25768
authorfoobar <sniper@php.net>
Tue, 21 Oct 2003 11:48:31 +0000 (11:48 +0000)
committerfoobar <sniper@php.net>
Tue, 21 Oct 2003 11:48:31 +0000 (11:48 +0000)
sapi/apache2handler/config.m4
sapi/apache2handler/mod_php5.c [new file with mode: 0644]
sapi/apache2handler/php4apache2.dsp
sapi/apache2handler/php_apache.h
sapi/apache2handler/sapi_apache2.c

index 8ea91ded3e7a3810d0bb4c27eb34390313b104e6..5b29914976146c7f0c92bef486ebd1d621a1f0be 100644 (file)
@@ -75,7 +75,7 @@ AC_ARG_WITH(apxs2,
   case $host_alias in
   *aix*)
     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
-    PHP_SELECT_SAPI(apache2handler, shared, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
+    PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
     INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" 
     ;;
   *darwin*)
@@ -91,7 +91,7 @@ AC_ARG_WITH(apxs2,
     fi
     MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"
     PHP_SUBST(MH_BUNDLE_FLAGS)
-    PHP_SELECT_SAPI(apache2handler, bundle, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
+    PHP_SELECT_SAPI(apache2handler, bundle, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
     SAPI_SHARED=libs/libphp5.so
     INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
     ;;
@@ -99,11 +99,11 @@ AC_ARG_WITH(apxs2,
     if test -f _APP_; then `rm _APP_`; fi
     `ln -s $APXS_BINDIR/httpd _APP_`
     EXTRA_LIBS="$EXTRA_LIBS _APP_"
-    PHP_SELECT_SAPI(apache2handler, shared, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
+    PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
     INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL" 
     ;;
   *)
-    PHP_SELECT_SAPI(apache2handler, shared, sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) 
+    PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS) 
     INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
     ;;
   esac
diff --git a/sapi/apache2handler/mod_php5.c b/sapi/apache2handler/mod_php5.c
new file mode 100644 (file)
index 0000000..3cf9945
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+   +----------------------------------------------------------------------+
+   | PHP Version 5                                                        |
+   +----------------------------------------------------------------------+
+   | Copyright (c) 1997-2003 The PHP Group                                |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.0 of the PHP license,       |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available through the world-wide-web at the following url:           |
+   | http://www.php.net/license/3_0.txt.                                  |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license@php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Sascha Schumann <sascha@schumann.cx>                        |
+   |          Parts based on Apache 1.3 SAPI module by                    |
+   |          Rasmus Lerdorf and Zeev Suraski                             |
+   +----------------------------------------------------------------------+
+ */
+
+/* $Id$ */
+
+#include "php.h"
+#include "php_apache.h"
+
+AP_MODULE_DECLARE_DATA module php5_module = {
+       STANDARD20_MODULE_STUFF,
+       create_php_config,              /* create per-directory config structure */
+       merge_php_config,               /* merge per-directory config structures */
+       NULL,                                   /* create per-server config structure */
+       NULL,                                   /* merge per-server config structures */
+       php_dir_cmds,                   /* command apr_table_t */
+       php_ap2_register_hook   /* register hooks */
+};
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: sw=4 ts=4 fdm=marker
+ * vim<600: sw=4 ts=4
+ */
index 6bb191e86288db369d4e95758f2ff7a291e40daa..1d1b1f51148618470f58f6e764d21ca945417c1d 100644 (file)
@@ -123,6 +123,10 @@ SOURCE=.\apache_config.c
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=.\mod_php5.c\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\php_functions.c\r
 # End Source File\r
 # Begin Source File\r
index 3761632d4a1cac2ce173bb7740f7c486eb27ef5d..47f706144daac1fe33e5a43559dfd1a6b65292c5 100644 (file)
@@ -51,6 +51,7 @@ void *create_php_config(apr_pool_t *p, char *dummy);
 char *get_php_config(void *conf, char *name, size_t name_len);
 void apply_config(void *);
 extern const command_rec php_dir_cmds[];
+void php_ap2_register_hook(apr_pool_t *p);
 
 #define APR_ARRAY_FOREACH_OPEN(arr, key, val)          \
 {                                                                                                      \
index b008fa213759eb9a7c5b90275d8aa3c98bcc3039..0de6c76eb4d1700e1d503ac6a051b7c018d51953 100644 (file)
@@ -61,7 +61,7 @@
  
 #define PHP_MAGIC_TYPE "application/x-httpd-php"
 #define PHP_SOURCE_MAGIC_TYPE "application/x-httpd-php-source"
-#define PHP_SCRIPT "php-script"
+#define PHP_SCRIPT "php5-script"
 
 /* A way to specify the location of the php.ini dir in an apache directive */
 char *apache2_php_ini_path_override = NULL;
@@ -564,23 +564,13 @@ zend_first_try {
        return OK;
 }
 
-static void php_register_hook(apr_pool_t *p)
+void php_ap2_register_hook(apr_pool_t *p)
 {
        ap_hook_pre_config(php_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
        ap_hook_post_config(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE);
        ap_hook_handler(php_handler, NULL, NULL, APR_HOOK_MIDDLE);
 }
 
-AP_MODULE_DECLARE_DATA module php5_module = {
-       STANDARD20_MODULE_STUFF,
-       create_php_config,              /* create per-directory config structure */
-       merge_php_config,               /* merge per-directory config structures */
-       NULL,                           /* create per-server config structure */
-       NULL,                           /* merge per-server config structures */
-       php_dir_cmds,                   /* command apr_table_t */
-       php_register_hook               /* register hooks */
-};
-
 /*
  * Local variables:
  * tab-width: 4