Skip to content

Commit

Permalink
fix build issues on windows, use ini api to change session settings
Browse files Browse the repository at this point in the history
  • Loading branch information
krakjoe committed May 10, 2014
1 parent 9e4fdbf commit 56f411f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ struct _pthreads_globals {
extern struct _pthreads_globals pthreads_globals;

ZEND_EXTERN_MODULE_GLOBALS(pthreads)
ZEND_EXTERN_MODULE_GLOBALS(ps)

/* {{{ PTHREADS_G */
#define PTHREADS_G(v) pthreads_globals.v
Expand Down
22 changes: 13 additions & 9 deletions src/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,13 +856,16 @@ static void * pthreads_routine(void *arg) {
PG(expose_php) = 0;
PG(auto_globals_jit) = 0;

#ifdef HAVE_PHP_SESSION
/* fixup sessions for compatibility */
if (!(thread->options & PTHREADS_ALLOW_HEADERS)) {
PS(cache_limiter) = nothing;
PS(use_cookies) = 0;
}
#endif
zend_alter_ini_entry(
"session.cache_limiter",
sizeof("session.cache_limiter"),
"nocache", sizeof("nocache")-1,
PHP_INI_USER, PHP_INI_STAGE_ACTIVATE);
zend_alter_ini_entry(
"session.use_cookies",
sizeof("session.cache_limiter"),
"0", sizeof("0")-1,
PHP_INI_USER, PHP_INI_STAGE_ACTIVATE);

/* fix php-fpm compatibility */
SG(sapi_started) = 0;
Expand Down Expand Up @@ -933,6 +936,9 @@ static void * pthreads_routine(void *arg) {
pthreads_state_set(current->state, PTHREADS_ST_RUNNING TSRMLS_CC);
{
zend_bool terminated = 0;

EG(current_execute_data) = NULL;

/* graceful fatalities */
zend_try {
/* ::run */
Expand Down Expand Up @@ -976,8 +982,6 @@ static void * pthreads_routine(void *arg) {
}
} while(worker && pthreads_stack_next(thread, this_ptr TSRMLS_CC));
}
} zend_catch {
/* do something, it's all gone wrong */
} zend_end_try();

/**
Expand Down
3 changes: 0 additions & 3 deletions src/pthreads.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
#include <php_globals.h>
#include <php_main.h>
#include <php_ticks.h>
#ifdef HAVE_PHP_SESSION
# include <ext/session/php_session.h>
#endif
#include <ext/standard/info.h>
#include <ext/standard/basic_functions.h>
#include <ext/standard/php_smart_str.h>
Expand Down

0 comments on commit 56f411f

Please sign in to comment.