Skip to content
Snippets Groups Projects
Commit 56538424 authored by Jared Hancock's avatar Jared Hancock
Browse files

Fix runtime issues surrounding packaging

parent cdb6ea20
Branches
No related tags found
No related merge requests found
<?php <?php
require_once('class.test.php'); require_once('class.test.php');
$super_globals = array_fill_keys(
array('$_SERVER', '$_FILES', '$_SESSION', '$_GET', '$_POST',
'$_REQUEST', '$_ENV'), 1);
class SourceAnalyzer extends Test { class SourceAnalyzer extends Test {
static $super_globals = array(
'$_SERVER'=>1, '$_FILES'=>1, '$_SESSION'=>1, '$_GET'=>1,
'$_POST'=>1, '$_REQUEST'=>1, '$_ENV'=>1, '$_COOKIE'=>1);
var $bugs = array(); var $bugs = array();
var $globals = array(); var $globals = array();
var $file = ''; var $file = '';
...@@ -16,7 +16,6 @@ class SourceAnalyzer extends Test { ...@@ -16,7 +16,6 @@ class SourceAnalyzer extends Test {
} }
function parseFile() { function parseFile() {
$this->checkVariableUsage( $this->checkVariableUsage(
array('line'=>array(0, $this->file), 'name'=>'(main)'), array('line'=>array(0, $this->file), 'name'=>'(main)'),
array(), array(),
...@@ -80,8 +79,6 @@ class SourceAnalyzer extends Test { ...@@ -80,8 +79,6 @@ class SourceAnalyzer extends Test {
function checkVariableUsage($function, $scope=array(), $blocks=0, function checkVariableUsage($function, $scope=array(), $blocks=0,
$options=array()) { $options=array()) {
global $super_globals;
// Merge in defaults to the options array // Merge in defaults to the options array
$options = array_merge(array( $options = array_merge(array(
'allow_this' => false, 'allow_this' => false,
...@@ -142,7 +139,7 @@ class SourceAnalyzer extends Test { ...@@ -142,7 +139,7 @@ class SourceAnalyzer extends Test {
// TODO: Determine if this function is defined in a class // TODO: Determine if this function is defined in a class
break; break;
} }
elseif (isset($super_globals[$token[1]])) elseif (isset(static::$super_globals[$token[1]]))
// Super globals are always in scope // Super globals are always in scope
break; break;
elseif (!isset($function['name']) || $function['name'] == '(main)') elseif (!isset($function['name']) || $function['name'] == '(main)')
......
...@@ -12,6 +12,9 @@ class Test { ...@@ -12,6 +12,9 @@ class Test {
'/include/pear/', '/include/pear/',
'/include/Spyc.php', '/include/Spyc.php',
'/setup/cli/stage/', '/setup/cli/stage/',
'/include/plugins/',
'/include/h2o/',
'/include/fpdf/',
); );
function Test() { function Test() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment