summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2003-10-21 11:48:31 +0000
committerfoobar <sniper@php.net>2003-10-21 11:48:31 +0000
commit4dfbc210db80b83611c7239c6fa2e26feb06b790 (patch)
tree78b2e64d12d456f494d8ac0fbab71cfffbb1c623 /sapi
parentde8847fc74423b63c72c0fab12211cee496d90e8 (diff)
downloadphp-git-4dfbc210db80b83611c7239c6fa2e26feb06b790.tar.gz
Fixed bug #25768
Diffstat (limited to 'sapi')
-rw-r--r--sapi/apache2handler/config.m48
-rw-r--r--sapi/apache2handler/mod_php5.c43
-rw-r--r--sapi/apache2handler/php4apache2.dsp4
-rw-r--r--sapi/apache2handler/php_apache.h1
-rw-r--r--sapi/apache2handler/sapi_apache2.c14
5 files changed, 54 insertions, 16 deletions
diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4
index 8ea91ded3e..5b29914976 100644
--- a/sapi/apache2handler/config.m4
+++ b/sapi/apache2handler/config.m4
@@ -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
index 0000000000..3cf9945d13
--- /dev/null
+++ b/sapi/apache2handler/mod_php5.c
@@ -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
+ */
diff --git a/sapi/apache2handler/php4apache2.dsp b/sapi/apache2handler/php4apache2.dsp
index 6bb191e862..1d1b1f5114 100644
--- a/sapi/apache2handler/php4apache2.dsp
+++ b/sapi/apache2handler/php4apache2.dsp
@@ -123,6 +123,10 @@ SOURCE=.\apache_config.c
# End Source File
# Begin Source File
+SOURCE=.\mod_php5.c
+# End Source File
+# Begin Source File
+
SOURCE=.\php_functions.c
# End Source File
# Begin Source File
diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h
index 3761632d4a..47f706144d 100644
--- a/sapi/apache2handler/php_apache.h
+++ b/sapi/apache2handler/php_apache.h
@@ -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) \
{ \
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index b008fa2137..0de6c76eb4 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -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