php_apache.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 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. /* Declare this so we can get to it from outside the sapi_apache2.c file */
  25. extern module AP_MODULE_DECLARE_DATA php5_module;
  26. /* A way to specify the location of the php.ini dir in an apache directive */
  27. extern char *apache2_php_ini_path_override;
  28. /* The server_context used by PHP */
  29. typedef struct php_struct {
  30. int state;
  31. request_rec *r;
  32. apr_bucket_brigade *brigade;
  33. /* stat structure of the current file */
  34. #if defined(NETWARE) && defined(CLIB_STAT_PATCH)
  35. struct stat_libc finfo;
  36. #else
  37. struct stat finfo;
  38. #endif
  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. long engine;
  61. long xbithack;
  62. long 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) TSRMG(php_apache2_info_id, php_apache2_info_struct *, v)
  68. #else
  69. extern php_apache2_info_struct php_apache2_info;
  70. #define AP2(v) (php_apache2_info.v)
  71. #endif
  72. /* fix for gcc4 visibility patch */
  73. #ifndef PHP_WIN32
  74. # undef AP_MODULE_DECLARE_DATA
  75. # define AP_MODULE_DECLARE_DATA PHPAPI
  76. #endif
  77. #endif /* PHP_APACHE_H */