You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.1 KiB

23 years ago
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2017 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: Sascha Schumann <sascha@schumann.cx> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #ifndef PHP_APACHE_H
  20. #define PHP_APACHE_H
  21. #include "httpd.h"
  22. #include "http_config.h"
  23. #include "http_core.h"
  24. #include "http_log.h"
  25. #include "php.h"
  26. #include "main/php_streams.h"
  27. /* Enable per-module logging in Apache 2.4+ */
  28. #ifdef APLOG_USE_MODULE
  29. APLOG_USE_MODULE(php7);
  30. #endif
  31. /* Declare this so we can get to it from outside the sapi_apache2.c file */
  32. extern module AP_MODULE_DECLARE_DATA php7_module;
  33. /* A way to specify the location of the php.ini dir in an apache directive */
  34. extern char *apache2_php_ini_path_override;
  35. /* The server_context used by PHP */
  36. typedef struct php_struct {
  37. int state;
  38. request_rec *r;
  39. apr_bucket_brigade *brigade;
  40. /* stat structure of the current file */
  41. zend_stat_t finfo;
  42. /* Whether or not we've processed PHP in the output filters yet. */
  43. int request_processed;
  44. /* final content type */
  45. char *content_type;
  46. } php_struct;
  47. void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf);
  48. void *create_php_config(apr_pool_t *p, char *dummy);
  49. char *get_php_config(void *conf, char *name, size_t name_len);
  50. void apply_config(void *);
  51. extern const command_rec php_dir_cmds[];
  52. void php_ap2_register_hook(apr_pool_t *p);
  53. #define APR_ARRAY_FOREACH_OPEN(arr, key, val) \
  54. { \
  55. apr_table_entry_t *elts; \
  56. int i; \
  57. elts = (apr_table_entry_t *) arr->elts; \
  58. for (i = 0; i < arr->nelts; i++) { \
  59. key = elts[i].key; \
  60. val = elts[i].val;
  61. #define APR_ARRAY_FOREACH_CLOSE() }}
  62. typedef struct {
  63. zend_bool engine;
  64. zend_bool xbithack;
  65. zend_bool last_modified;
  66. } php_apache2_info_struct;
  67. extern zend_module_entry apache2_module_entry;
  68. #ifdef ZTS
  69. extern int php_apache2_info_id;
  70. #define AP2(v) ZEND_TSRMG(php_apache2_info_id, php_apache2_info_struct *, v)
  71. ZEND_TSRMLS_CACHE_EXTERN()
  72. #else
  73. extern php_apache2_info_struct php_apache2_info;
  74. #define AP2(v) (php_apache2_info.v)
  75. #endif
  76. /* fix for gcc4 visibility patch */
  77. #ifndef PHP_WIN32
  78. # undef AP_MODULE_DECLARE_DATA
  79. # define AP_MODULE_DECLARE_DATA PHPAPI
  80. #endif
  81. #endif /* PHP_APACHE_H */