Variables global to a single request need special treatment
as some server APIs may run several PHP requests in different
threads at the same time.
Request global variables are declared using the <global>
tag and its name and type attributes.
Simple default values can be given with the value attribute, else you
can always initialize request globals within the RINIT internal function.
To access your request global variables you have to use the the EXTNAME_G
macro (replace EXTNAME with the uppercased name of your extension).
<extension name="foobar">
<global name="foo" type="long" value="42"/>
<function name="get_foo">
<proto>int get_foo(void)</proto>
<code>
RETURN_LONG( FOOBAR_G(foo) );
</code>
</function>
<function name="set_foo">
<proto>void set_foo(int newfoo)</proto>
<code>
FOOBAR_G(foo) = newfoo;
</code>
</function>
</extension>