xref: /PHP-5.3/sapi/fpm/fpm/fpm_conf.h (revision 851a04bb)
1 
2 	/* $Id: fpm_conf.h,v 1.12.2.2 2008/12/13 03:46:49 anight Exp $ */
3 	/* (c) 2007,2008 Andrei Nigmatulin */
4 
5 #ifndef FPM_CONF_H
6 #define FPM_CONF_H 1
7 
8 #include <stdint.h>
9 #include "php.h"
10 
11 #define PM2STR(a) (a == PM_STYLE_STATIC ? "static" : (a == PM_STYLE_DYNAMIC ? "dynamic" : "ondemand"))
12 
13 #define FPM_CONF_MAX_PONG_LENGTH 64
14 
15 struct key_value_s;
16 
17 struct key_value_s {
18 	struct key_value_s *next;
19 	char *key;
20 	char *value;
21 };
22 
23 /*
24  * Please keep the same order as in fpm_conf.c and in php-fpm.conf.in
25  */
26 struct fpm_global_config_s {
27 	char *pid_file;
28 	char *error_log;
29 #ifdef HAVE_SYSLOG_H
30 	char *syslog_ident;
31 	int syslog_facility;
32 #endif
33 	int log_level;
34 	int emergency_restart_threshold;
35 	int emergency_restart_interval;
36 	int process_control_timeout;
37 	int process_max;
38 	int process_priority;
39 	int daemonize;
40 	int rlimit_files;
41 	int rlimit_core;
42 	char *events_mechanism;
43 };
44 
45 extern struct fpm_global_config_s fpm_global_config;
46 
47 /*
48  * Please keep the same order as in fpm_conf.c and in php-fpm.conf.in
49  */
50 struct fpm_worker_pool_config_s {
51 	char *name;
52 	char *prefix;
53 	char *user;
54 	char *group;
55 	char *listen_address;
56 	int listen_backlog;
57 	char *listen_owner;
58 	char *listen_group;
59 	char *listen_mode;
60 	char *listen_allowed_clients;
61 	int process_priority;
62 	int pm;
63 	int pm_max_children;
64 	int pm_start_servers;
65 	int pm_min_spare_servers;
66 	int pm_max_spare_servers;
67 	int pm_process_idle_timeout;
68 	int pm_max_requests;
69 	char *pm_status_path;
70 	char *ping_path;
71 	char *ping_response;
72 	char *access_log;
73 	char *access_format;
74 	char *slowlog;
75 	int request_slowlog_timeout;
76 	int request_terminate_timeout;
77 	int rlimit_files;
78 	int rlimit_core;
79 	char *chroot;
80 	char *chdir;
81 	int catch_workers_output;
82 	char *security_limit_extensions;
83 	struct key_value_s *env;
84 	struct key_value_s *php_admin_values;
85 	struct key_value_s *php_values;
86 };
87 
88 struct ini_value_parser_s {
89 	char *name;
90 	char *(*parser)(zval *, void **, intptr_t);
91 	intptr_t offset;
92 };
93 
94 enum {
95 	PM_STYLE_STATIC = 1,
96 	PM_STYLE_DYNAMIC = 2,
97 	PM_STYLE_ONDEMAND = 3
98 };
99 
100 int fpm_conf_init_main(int test_conf, int force_daemon);
101 int fpm_worker_pool_config_free(struct fpm_worker_pool_config_s *wpc);
102 int fpm_conf_write_pid();
103 int fpm_conf_unlink_pid();
104 
105 #endif
106 
107