-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
midgard.superglobals_compat On has no effect on gjallarhorn #107
Comments
This directive only sets superglobals named variables, without any properties or array values registered. It should work exactly the same as it works in ratatoskr. |
Yes, I know. My problem is the following: echo ini_get('midgard.superglobals_compat'); //outputs "On"
var_dump(isset($_MIDCOM)); // outputs false So the variables are not there, and if I set $_MIDCOM in some script, it has the normal script scope, not the superglobal scope |
What PHP version do you use? Can not confirm right now but it seems to be related to 5.4. |
It's 5.3.3 from Debian stable |
It seems both superglobals are just set to reserve variable name. If one of these is NULL or FALSE it means there's no variable associated with the name. You can still set some data though:
And $_MIDGARD['key'] will be available as global variable. |
OK, I think I figured it out now: If I set
In
In Apache virtual host config, then it doesn't work. Here is the script I use for testing: echo ini_get('midgard.superglobals_compat'); //outputs "On" in both cases
$_MIDCOM = 'test';
function test_midcom()
{
var_dump(isset($_MIDCOM)); // outputs true whehn set in midgard2.ini, and false when set in vhost
}
test_midcom(); |
P.S.: If it turns out that enabling superglobals_compat is impossible with a php_admin_value, could mgd throw a warning in this case? |
Did you try php_admin_flag instead of value? Also try to set it to "On" in ini and "Off" in vhost config if that should be disabled for some hosts or requests. Ini registration should be done in module loading phase, so we can not conditionally set it to On in vhost. |
I just tried enabling superglobals_compat in PHP's midgard2.ini file, and when I query the setting in my script with
ini_get('midgard.superglobals_compat')
, it returnsOn
. But neither$_MIDGARD
nor$_MIDCOM
are available. Am I doing somethig wrong or is this a general problem?The text was updated successfully, but these errors were encountered: