]> git.pld-linux.org Git - packages/php.git/blob - php-fpm-zts.patch
- for latest libevent (by Andrei Nigmatulin <andrei.nigmatulin#gmail.com>)
[packages/php.git] / php-fpm-zts.patch
1 Index: fpm_php.c
2 ===================================================================
3 RCS file: /home/anight/cvsroot/fpm/fpm_php.c,v
4 retrieving revision 1.22
5 diff -u -r1.22 fpm_php.c
6 --- fpm_php.c   19 Jul 2008 01:27:04 -0000      1.22
7 +++ fpm_php.c   14 Nov 2008 21:30:26 -0000
8 @@ -19,7 +19,7 @@
9  #include "fpm_cleanup.h"
10  #include "fpm_worker_pool.h"
11  
12 -static int zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int stage)
13 +static int zend_ini_alter_master(char *name, int name_length, char *new_value, int new_value_length, int stage TSRMLS_DC)
14  {
15         zend_ini_entry *ini_entry;
16         char *duplicate;
17 @@ -32,7 +32,7 @@
18  
19         if (!ini_entry->on_modify
20                 || ini_entry->on_modify(ini_entry, duplicate, new_value_length,
21 -                       ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage) == SUCCESS) {
22 +                       ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) {
23                 ini_entry->value = duplicate;
24                 ini_entry->value_length = new_value_length;
25         } else {
26 @@ -42,7 +42,7 @@
27         return SUCCESS;
28  }
29  
30 -static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint))
31 +static void fpm_php_disable(char *value, int (*zend_disable)(char *, uint TSRMLS_DC) TSRMLS_DC)
32  {
33         char *s = 0, *e = value;
34  
35 @@ -52,7 +52,7 @@
36                         case ',':
37                                 if (s) {
38                                         *e = '\0';
39 -                                       zend_disable(s, e - s);
40 +                                       zend_disable(s, e - s TSRMLS_CC);
41                                         s = 0;
42                                 }
43                                 break;
44 @@ -66,12 +66,13 @@
45         }
46  
47         if (s) {
48 -               zend_disable(s, e - s);
49 +               zend_disable(s, e - s TSRMLS_CC);
50         }
51  }
52  
53  static int fpm_php_apply_defines(struct fpm_worker_pool_s *wp)
54  {
55 +       TSRMLS_FETCH();
56         struct key_value_s *kv;
57  
58         for (kv = wp->config->php_defines; kv; kv = kv->next) {
59 @@ -84,34 +85,34 @@
60                         zval zv;
61  
62  #if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50300)
63 -                       php_dl(value, MODULE_PERSISTENT, &zv, 1);
64 +                       php_dl(value, MODULE_PERSISTENT, &zv, 1 TSRMLS_CC);
65  #else
66                         zval filename;
67                         ZVAL_STRINGL(&filename, value, value_len, 0);
68  #if (PHP_MAJOR_VERSION >= 5)
69 -                       php_dl(&filename, MODULE_PERSISTENT, &zv, 1);
70 +                       php_dl(&filename, MODULE_PERSISTENT, &zv, 1 TSRMLS_CC);
71  #else
72 -                       php_dl(&filename, MODULE_PERSISTENT, &zv);
73 +                       php_dl(&filename, MODULE_PERSISTENT, &zv TSRMLS_CC);
74  #endif
75  #endif
76                         continue;
77                 }
78  
79 -               zend_ini_alter_master(name, name_len + 1, value, value_len, PHP_INI_STAGE_ACTIVATE);
80 +               zend_ini_alter_master(name, name_len + 1, value, value_len, PHP_INI_STAGE_ACTIVATE TSRMLS_CC);
81  
82                 if (!strcmp(name, "disable_functions") && *value) {
83                         char *v = strdup(value);
84  #if (PHP_MAJOR_VERSION >= 5)
85                         PG(disable_functions) = v;
86  #endif
87 -                       fpm_php_disable(v, zend_disable_function);
88 +                       fpm_php_disable(v, zend_disable_function TSRMLS_CC);
89                 }
90                 else if (!strcmp(name, "disable_classes") && *value) {
91                         char *v = strdup(value);
92  #if (PHP_MAJOR_VERSION >= 5)
93                         PG(disable_classes) = v;
94  #endif
95 -                       fpm_php_disable(v, zend_disable_class);
96 +                       fpm_php_disable(v, zend_disable_class TSRMLS_CC);
97                 }
98         }
99  
100 @@ -127,24 +128,25 @@
101         return 0;
102  }
103  
104 -char *fpm_php_script_filename()
105 +char *fpm_php_script_filename(TSRMLS_D)
106  {
107         return SG(request_info).path_translated;
108  }
109  
110 -char *fpm_php_request_method()
111 +char *fpm_php_request_method(TSRMLS_D)
112  {
113         return (char *) SG(request_info).request_method;
114  }
115  
116 -size_t fpm_php_content_length()
117 +size_t fpm_php_content_length(TSRMLS_D)
118  {
119         return SG(request_info).content_length;
120  }
121  
122  static void fpm_php_cleanup(int which, void *arg)
123  {
124 -       php_module_shutdown();
125 +       TSRMLS_FETCH();
126 +       php_module_shutdown(TSRMLS_C);
127         sapi_shutdown();
128  }
129  
130 Index: fpm_php.h
131 ===================================================================
132 RCS file: /home/anight/cvsroot/fpm/fpm_php.h,v
133 retrieving revision 1.10
134 diff -u -r1.10 fpm_php.h
135 --- fpm_php.h   24 May 2008 17:38:47 -0000      1.10
136 +++ fpm_php.h   14 Nov 2008 21:36:00 -0000
137 @@ -5,14 +5,16 @@
138  #ifndef FPM_PHP_H
139  #define FPM_PHP_H 1
140  
141 -#include "fpm_worker_pool.h"
142 +#include <TSRM.h>
143  
144  #include "build-defs.h" /* for PHP_ defines */
145  
146 +struct fpm_worker_pool_s;
147 +
148  int fpm_php_init_child(struct fpm_worker_pool_s *wp);
149 -char *fpm_php_script_filename();
150 -char *fpm_php_request_method();
151 -size_t fpm_php_content_length();
152 +char *fpm_php_script_filename(TSRMLS_D);
153 +char *fpm_php_request_method(TSRMLS_D);
154 +size_t fpm_php_content_length(TSRMLS_D);
155  void fpm_php_soft_quit();
156  int fpm_php_init_main();
157  
158 Index: fpm_php_trace.c
159 ===================================================================
160 RCS file: /home/anight/cvsroot/fpm/fpm_php_trace.c,v
161 retrieving revision 1.27
162 diff -u -r1.27 fpm_php_trace.c
163 --- fpm_php_trace.c     26 Aug 2008 15:09:15 -0000      1.27
164 +++ fpm_php_trace.c     14 Nov 2008 21:33:49 -0000
165 @@ -35,7 +35,7 @@
166  #endif
167  
168  
169 -static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog)
170 +static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC)
171  {
172         int callers_limit = 20;
173         pid_t pid = child->pid;
174 @@ -133,6 +133,7 @@
175  
176  void fpm_php_trace(struct fpm_child_s *child)
177  {
178 +       TSRMLS_FETCH();
179         FILE *slowlog;
180  
181         zlog(ZLOG_STUFF, ZLOG_NOTICE, "about to trace %d", (int) child->pid);
182 @@ -148,7 +149,7 @@
183                 goto done1;
184         }
185  
186 -       if (0 > fpm_php_trace_dump(child, slowlog)) {
187 +       if (0 > fpm_php_trace_dump(child, slowlog TSRMLS_CC)) {
188                 fprintf(slowlog, "+++ dump failed\n");
189         }
190  
191 Index: fpm_request.c
192 ===================================================================
193 RCS file: /home/anight/cvsroot/fpm/fpm_request.c,v
194 retrieving revision 1.9
195 diff -u -r1.9 fpm_request.c
196 --- fpm_request.c       31 Aug 2008 23:34:36 -0000      1.9
197 +++ fpm_request.c       14 Nov 2008 21:18:38 -0000
198 @@ -49,9 +49,10 @@
199  
200  void fpm_request_info()
201  {
202 +       TSRMLS_FETCH();
203         struct fpm_shm_slot_s *slot;
204 -       char *request_method = fpm_php_request_method();
205 -       char *script_filename = fpm_php_script_filename();
206 +       char *request_method = fpm_php_request_method(TSRMLS_C);
207 +       char *script_filename = fpm_php_script_filename(TSRMLS_C);
208  
209         slot = fpm_shm_slots_acquire(0, 0);
210  
211 @@ -63,7 +64,7 @@
212                 cpystrn(slot->request_method, request_method, sizeof(slot->request_method));
213         }
214  
215 -       slot->content_length = fpm_php_content_length();
216 +       slot->content_length = fpm_php_content_length(TSRMLS_C);
217  
218         /* if cgi.fix_pathinfo is set to "1" and script cannot be found (404)
219                 the sapi_globals.request_info.path_translated is set to NULL */
This page took 0.117813 seconds and 3 git commands to generate.