1999-09-29 15:17:02 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2004-01-08 08:18:22 +00:00
|
|
|
| PHP Version 5 |
|
1999-09-29 15:17:02 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 13:10:10 +00:00
|
|
|
| Copyright (c) 1997-2006 The PHP Group |
|
1999-09-29 15:17:02 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 13:10:10 +00:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
1999-09-29 15:17:02 +00:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-10 20:04:29 +00:00
|
|
|
| available through the world-wide-web at the following url: |
|
2006-01-01 13:10:10 +00:00
|
|
|
| http://www.php.net/license/3_01.txt |
|
1999-09-29 15:17:02 +00:00
|
|
|
| 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: Rasmus Lerdorf <rasmus@php.net> |
|
|
|
|
| (with helpful hints from Dean Gaudet <dgaudet@arctic.org> |
|
|
|
|
| PHP 4.0 patches by: |
|
|
|
|
| Zeev Suraski <zeev@zend.com> |
|
2003-03-18 12:06:09 +00:00
|
|
|
| Stig Bakken <ssb@php.net> |
|
1999-09-29 15:17:02 +00:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
/* $Id$ */
|
|
|
|
|
2002-04-23 03:01:30 +00:00
|
|
|
#include "php_apache_http.h"
|
1999-09-29 15:17:02 +00:00
|
|
|
|
2001-06-06 13:06:12 +00:00
|
|
|
/* {{{ apache_php_module_main
|
|
|
|
*/
|
2001-08-01 22:53:26 +00:00
|
|
|
int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
|
1999-09-29 15:17:02 +00:00
|
|
|
{
|
2003-05-16 23:08:23 +00:00
|
|
|
int retval = OK;
|
1999-09-29 15:17:02 +00:00
|
|
|
zend_file_handle file_handle;
|
|
|
|
|
2001-07-28 11:36:37 +00:00
|
|
|
if (php_request_startup(TSRMLS_C) == FAILURE) {
|
1999-09-29 15:17:02 +00:00
|
|
|
return FAILURE;
|
|
|
|
}
|
2000-05-04 03:28:34 +00:00
|
|
|
/* sending a file handle to another dll is not working
|
2005-04-19 11:41:04 +00:00
|
|
|
so let zend open it. */
|
2000-10-14 05:06:16 +00:00
|
|
|
|
1999-09-29 15:17:02 +00:00
|
|
|
if (display_source_mode) {
|
|
|
|
zend_syntax_highlighter_ini syntax_highlighter_ini;
|
|
|
|
|
2000-10-14 05:06:16 +00:00
|
|
|
php_get_highlight_struct(&syntax_highlighter_ini);
|
2003-05-16 23:08:23 +00:00
|
|
|
if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC) != SUCCESS) {
|
|
|
|
retval = NOT_FOUND;
|
1999-09-29 15:17:02 +00:00
|
|
|
}
|
|
|
|
} else {
|
2001-09-27 20:01:23 +00:00
|
|
|
file_handle.type = ZEND_HANDLE_FILENAME;
|
2000-10-14 05:06:16 +00:00
|
|
|
file_handle.handle.fd = 0;
|
|
|
|
file_handle.filename = SG(request_info).path_translated;
|
|
|
|
file_handle.opened_path = NULL;
|
|
|
|
file_handle.free_filename = 0;
|
|
|
|
|
2001-07-28 11:36:37 +00:00
|
|
|
(void) php_execute_script(&file_handle TSRMLS_CC);
|
1999-09-29 15:17:02 +00:00
|
|
|
}
|
2001-07-21 14:27:56 +00:00
|
|
|
|
2001-07-23 01:03:22 +00:00
|
|
|
AP(in_request) = 0;
|
|
|
|
|
2001-07-21 14:27:56 +00:00
|
|
|
zend_try {
|
2001-07-23 01:03:22 +00:00
|
|
|
php_request_shutdown(NULL);
|
2001-07-21 16:18:03 +00:00
|
|
|
} zend_end_try();
|
2001-07-23 01:03:22 +00:00
|
|
|
|
2003-05-16 23:08:23 +00:00
|
|
|
return retval;
|
1999-09-29 15:17:02 +00:00
|
|
|
}
|
2001-06-06 13:06:12 +00:00
|
|
|
/* }}} */
|
1999-09-29 15:17:02 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* tab-width: 4
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* End:
|
2001-09-09 13:29:31 +00:00
|
|
|
* vim600: sw=4 ts=4 fdm=marker
|
|
|
|
* vim<600: sw=4 ts=4
|
1999-09-29 15:17:02 +00:00
|
|
|
*/
|