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