php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59221 Globals like $_SERVER/$_ENV should be available
Submitted: 2010-05-19 14:34 UTC Modified: 2017-01-10 07:57 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: danhen at web dot de Assigned:
Status: Suspended Package: bcompiler (PECL)
PHP Version: Irrelevant OS: Windows/Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: danhen at web dot de
New email:
PHP Version: OS:

 

 [2010-05-19 14:34 UTC] danhen at web dot de
Description:
------------
Completely "bcompiled" projects via bcompiler_write_file() doesn't provide globals like $_SERVER at runtime. If an uncompiled file is included which references one of these vars they are available.
Currently I'am dealing with this problem by placing the following lines in bcompiler_read:

zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC);
zend_is_auto_global("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC);
zend_is_auto_global("_ENV", sizeof("_ENV")-1 TSRMLS_CC);

but I think there exists a cleaner solution for it.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-03 08:49 UTC] val@php.net
Need more info on this ticket. Which version of PHP and bcompiler you're using? Which SAPI?

I've just tested latest bcompiler with PHP 5.3 and Apache 1.3 with the following code:
<?
function gl($arr) {
  $s = "\$$arr";
  echo "<p>$s:<br>";
  if ($arr == '_GET') print_r($_GET);
  elseif ($arr == '_SERVER') print_r($_SERVER);
  elseif ($arr == '_ENV') print_r($_ENV);
  else echo "unsupported";
  echo "</p>\n";
}

 echo '<P>FILE=', __FILE__;
 gl('_GET');
 gl('_SERVER');
 gl('_ENV');
?>
both $_GET, $_SERVER and $_ENV arrays were ok, no zend_is_auto_global() calls are in the latest sources.
 [2010-12-03 09:51 UTC] danhen at web dot de
PHP-Versions 5.1.x up to 5.3.0; apache2-module; bcompiler based on 0.8 (in the time nothing was done on the code);latest release of bcompiler

GET/POST/COOKIE are always available,
ENV/SERVER are not
 [2017-01-10 07:57 UTC] kalle@php.net
-Status: Open +Status: Suspended
 [2017-01-10 07:57 UTC] kalle@php.net
Suspending this report as the extension have not had a release for almost 6 years.  Please revive this if the extension once again shows life
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC