Skip to content

Commit

Permalink
Attempt to fix issue laruence#194
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Sep 10, 2015
1 parent 272ffed commit 40c3412
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion php_yaf.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ZEND_BEGIN_MODULE_GLOBALS(yaf)
zend_string *default_action;
zend_string *bootstrap;
char *global_library;
char *environ;
char *environ_name;
char *name_separator;
size_t name_separator_len;
zend_bool lowcase_path;
Expand Down
6 changes: 3 additions & 3 deletions yaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ PHP_INI_BEGIN()
/* {{{ This only effects internally */
STD_PHP_INI_BOOLEAN("yaf.st_compatible", "0", PHP_INI_ALL, OnUpdateBool, st_compatible, zend_yaf_globals, yaf_globals)
/* }}} */
STD_PHP_INI_ENTRY("yaf.environ", "product", PHP_INI_SYSTEM, OnUpdateString, environ, zend_yaf_globals, yaf_globals)
STD_PHP_INI_ENTRY("yaf.environ", "product", PHP_INI_SYSTEM, OnUpdateString, environ_name, zend_yaf_globals, yaf_globals)
STD_PHP_INI_BOOLEAN("yaf.use_namespace", "0", PHP_INI_SYSTEM, OnUpdateBool, use_namespace, zend_yaf_globals, yaf_globals)
PHP_INI_END();
/* }}} */
Expand All @@ -96,7 +96,7 @@ PHP_MINIT_FUNCTION(yaf)
if (YAF_G(use_namespace)) {

REGISTER_STRINGL_CONSTANT("YAF\\VERSION", PHP_YAF_VERSION, sizeof(PHP_YAF_VERSION) - 1, CONST_PERSISTENT | CONST_CS);
REGISTER_STRINGL_CONSTANT("YAF\\ENVIRON", YAF_G(environ), strlen(YAF_G(environ)), CONST_PERSISTENT | CONST_CS);
REGISTER_STRINGL_CONSTANT("YAF\\ENVIRON", YAF_G(environ_name), strlen(YAF_G(environ_name)), CONST_PERSISTENT | CONST_CS);

REGISTER_LONG_CONSTANT("YAF\\ERR\\STARTUP_FAILED", YAF_ERR_STARTUP_FAILED, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("YAF\\ERR\\ROUTE_FAILED", YAF_ERR_ROUTE_FAILED, CONST_PERSISTENT | CONST_CS);
Expand All @@ -111,7 +111,7 @@ PHP_MINIT_FUNCTION(yaf)

} else {
REGISTER_STRINGL_CONSTANT("YAF_VERSION", PHP_YAF_VERSION, sizeof(PHP_YAF_VERSION) - 1, CONST_PERSISTENT | CONST_CS);
REGISTER_STRINGL_CONSTANT("YAF_ENVIRON", YAF_G(environ),strlen(YAF_G(environ)), CONST_PERSISTENT | CONST_CS);
REGISTER_STRINGL_CONSTANT("YAF_ENVIRON", YAF_G(environ_name),strlen(YAF_G(environ_name)), CONST_PERSISTENT | CONST_CS);

REGISTER_LONG_CONSTANT("YAF_ERR_STARTUP_FAILED", YAF_ERR_STARTUP_FAILED, CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT("YAF_ERR_ROUTE_FAILED", YAF_ERR_ROUTE_FAILED, CONST_PERSISTENT | CONST_CS);
Expand Down
8 changes: 4 additions & 4 deletions yaf_application.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static int yaf_application_parse_option(zval *options) /* {{{ */ {
}
/* }}} */

/** {{{ proto Yaf_Application::__construct(mixed $config, string $environ = YAF_G(environ))
/** {{{ proto Yaf_Application::__construct(mixed $config, string $environ = YAF_G(environ_name))
*/
PHP_METHOD(yaf_application, __construct) {
zval *config;
Expand Down Expand Up @@ -321,7 +321,7 @@ PHP_METHOD(yaf_application, __construct) {

self = getThis();
if (!section || Z_TYPE_P(section) != IS_STRING || !Z_STRLEN_P(section)) {
ZVAL_STRING(&zsection, YAF_G(environ));
ZVAL_STRING(&zsection, YAF_G(environ_name));
(void)yaf_config_instance(&zconfig, config, &zsection);
zval_ptr_dtor(&zsection);
} else {
Expand Down Expand Up @@ -382,7 +382,7 @@ PHP_METHOD(yaf_application, __construct) {
}

zend_update_property_bool(yaf_application_ce, self, ZEND_STRL(YAF_APPLICATION_PROPERTY_NAME_RUN), 0);
zend_update_property_string(yaf_application_ce, self, ZEND_STRL(YAF_APPLICATION_PROPERTY_NAME_ENV), YAF_G(environ));
zend_update_property_string(yaf_application_ce, self, ZEND_STRL(YAF_APPLICATION_PROPERTY_NAME_ENV), YAF_G(environ_name));

if (Z_TYPE(YAF_G(modules)) == IS_ARRAY) {
zend_update_property(yaf_application_ce,
Expand Down Expand Up @@ -683,7 +683,7 @@ YAF_STARTUP_FUNCTION(application) {
zend_declare_property_bool(yaf_application_ce,
ZEND_STRL(YAF_APPLICATION_PROPERTY_NAME_RUN), 0, ZEND_ACC_PROTECTED);
zend_declare_property_string(yaf_application_ce,
ZEND_STRL(YAF_APPLICATION_PROPERTY_NAME_ENV), YAF_G(environ), ZEND_ACC_PROTECTED);
ZEND_STRL(YAF_APPLICATION_PROPERTY_NAME_ENV), YAF_G(environ_name), ZEND_ACC_PROTECTED);

zend_declare_property_long(yaf_application_ce,
ZEND_STRL(YAF_APPLICATION_PROPERTY_NAME_ERRNO), 0, ZEND_ACC_PROTECTED);
Expand Down

0 comments on commit 40c3412

Please sign in to comment.