php_apache.h 2.9 KB

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