Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#88 closed defect (fixed)

[patch] add a hack/option to disable variable cache authentication

Reported by: judas_iscariote Owned by: moo
Priority: major Milestone: 1.2.1
Component: cacher Version: 1.2-dev
Keywords: Cc:
Application: PHP Version:
Other Exts: SAPI: Irrelevant
Probability: Blocked By:


as discussed on irc, here is a hack/patch to disable variable cache authentication, not very nice but works for me

ndex: xcache_globals.h
--- xcache_globals.h    (revisión: 366)
+++ xcache_globals.h    (copia de trabajo)
@@ -14,6 +14,7 @@
        xc_stack_t *var_holds;
        time_t request_time;
        long   var_ttl;
+       zend_bool auth_enabled;
Index: xcache.c
--- xcache.c    (revisión: 366)
+++ xcache.c    (copia de trabajo)
@@ -1527,20 +1527,23 @@
        char *admin_user = NULL;
        char *admin_pass = NULL;
        HashTable *ht;
+       /* auth disabled, nothing to do.. */
+       if (!XG(auth_enabled)) {
+               return 1;
+       }
@@ -2334,6 +2343,7 @@
        STD_PHP_INI_BOOLEAN("xcache.cacher",                 "1", PHP_INI_ALL,    OnUpdateBool,        cacher,            zend_xcache_globals, xcache_globals)
        STD_PHP_INI_BOOLEAN("xcache.stat",                   "1", PHP_INI_ALL,    OnUpdateBool,        stat,              zend_xcache_globals, xcache_globals)
+       STD_PHP_INI_BOOLEAN("xcache.enable_auth",            "1", PHP_INI_SYSTEM,  OnUpdateBool,        auth_enabled, zend_xcache_globals, xcache_globals)
        STD_PHP_INI_BOOLEAN("xcache.optimizer",              "0", PHP_INI_ALL,    OnUpdateBool,        optimizer,         zend_xcache_globals, xcache_globals)


Change History (5)

comment:1 follow-up: Changed 13 years ago by Nneel

what it does exactly?
whats the benefit ?

comment:2 in reply to: ↑ 1 Changed 13 years ago by judas_iscariote

Replying to Nneel:

what it does exactly?
whats the benefit ?

it adds a new ini directive called xcache.enable_auth that defaults to On, if you set it to off, it disables the variable cache authentication (used with some xcache_* php api fucntions) so you can clean the cache or other operations without the requirement of username and password from applications (like a Symfony framework).

comment:3 Changed 13 years ago by moo

  • Resolution set to fixed
  • Status changed from new to closed

applied in [367]

comment:4 Changed 13 years ago by moo

updated in [368] to use xcache.admin.auth

comment:5 Changed 12 years ago by moo

  • pending set to 0
  • SAPI set to Irrelevant

note for those misread this ticket: it's "xcache.admin.enable_auth"!

Note: See TracTickets for help on using tickets.