Skip to content

Commit dc5b22a

Browse files
committed
Cleaning up driver for php7. WIP
1 parent 7cb0c48 commit dc5b22a

12 files changed

+967
-1004
lines changed

php_memcached.c

+545-596
Large diffs are not rendered by default.

php_memcached_private.h

+42-41
Original file line numberDiff line numberDiff line change
@@ -129,46 +129,60 @@ typedef struct {
129129
#endif
130130

131131
ZEND_BEGIN_MODULE_GLOBALS(php_memcached)
132+
132133
#ifdef HAVE_MEMCACHED_SESSION
133-
zend_bool sess_locking_enabled;
134-
long sess_lock_wait;
135-
long sess_lock_max_wait;
136-
long sess_lock_expire;
137-
char* sess_prefix;
138-
zend_bool sess_locked;
139-
char* sess_lock_key;
140-
int sess_lock_key_len;
141-
142-
int sess_number_of_replicas;
143-
zend_bool sess_randomize_replica_read;
144-
zend_bool sess_remove_failed_enabled;
145-
long sess_connect_timeout;
146-
zend_bool sess_consistent_hash_enabled;
147-
zend_bool sess_binary_enabled;
134+
/* Session related variables */
135+
struct {
136+
zend_bool lock_enabled;
137+
zend_long lock_wait_max;
138+
zend_long lock_wait_min;
139+
zend_long lock_retries;
140+
zend_long lock_expiration;
141+
142+
zend_bool compression_enabled;
143+
zend_bool binary_protocol_enabled;
144+
zend_bool consistent_hash_enabled;
145+
146+
zend_long server_failure_limit;
147+
zend_long number_of_replicas;
148+
zend_bool randomize_replica_read_enabled;
149+
zend_bool remove_failed_servers_enabled;
150+
151+
zend_long connect_timeout;
152+
153+
char *prefix;
154+
zend_bool persistent_enabled;
155+
156+
char *sasl_username;
157+
char *sasl_password;
158+
} session_ini;
148159

149-
#if HAVE_MEMCACHED_SASL
150-
char *sess_sasl_username;
151-
char *sess_sasl_password;
152-
zend_bool sess_sasl_data;
153-
#endif
154160
#endif
155-
char *serializer_name;
156-
enum memcached_serializer serializer;
157161

158-
char *compression_type;
159-
int compression_type_real;
160-
int compression_threshold;
162+
struct {
163+
char *serializer_name;
164+
char *compression_type;
165+
zend_long compression_threshold;
166+
double compression_factor;
167+
zend_long store_retry_count;
161168

162-
double compression_factor;
163169
#if HAVE_MEMCACHED_SASL
164-
zend_bool use_sasl;
170+
zend_bool sasl_enabled;
165171
#endif
172+
173+
/* Converted values*/
174+
enum memcached_serializer serializer;
175+
zend_long compression_type_real;
176+
} memc_ini;
177+
178+
179+
166180
#ifdef HAVE_MEMCACHED_PROTOCOL
167181
struct {
168182
php_memc_server_cb_t callbacks [MEMC_SERVER_ON_MAX];
169183
} server;
170184
#endif
171-
long store_retry_count;
185+
172186
ZEND_END_MODULE_GLOBALS(php_memcached)
173187

174188
PHP_RINIT_FUNCTION(memcached);
@@ -177,19 +191,6 @@ PHP_MINIT_FUNCTION(memcached);
177191
PHP_MSHUTDOWN_FUNCTION(memcached);
178192
PHP_MINFO_FUNCTION(memcached);
179193

180-
#ifdef ZTS
181-
#define MEMC_G(v) TSRMG(php_memcached_globals_id, zend_php_memcached_globals *, v)
182-
#else
183-
#define MEMC_G(v) (php_memcached_globals.v)
184-
#endif
185-
186-
typedef struct {
187-
memcached_st *memc_sess;
188-
zend_bool is_persistent;
189-
} memcached_sess;
190-
191-
int php_memc_sess_list_entry(void);
192-
193194
char *php_memc_printable_func (zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC);
194195

195196
memcached_return php_memcached_exist (memcached_st *memc, zend_string *key);

0 commit comments

Comments
 (0)