From 56538424f4f55c25d8a5497e30eb277ba2b383e1 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Fri, 25 Oct 2013 19:47:23 +0000 Subject: [PATCH] Fix runtime issues surrounding packaging --- setup/test/tests/class.php_analyze.php | 13 +++++-------- setup/test/tests/class.test.php | 3 +++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/setup/test/tests/class.php_analyze.php b/setup/test/tests/class.php_analyze.php index 5ebcb37d5..f06684664 100644 --- a/setup/test/tests/class.php_analyze.php +++ b/setup/test/tests/class.php_analyze.php @@ -1,11 +1,11 @@ <?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)') diff --git a/setup/test/tests/class.test.php b/setup/test/tests/class.test.php index de9c4f7e9..44842b3fe 100644 --- a/setup/test/tests/class.test.php +++ b/setup/test/tests/class.test.php @@ -12,6 +12,9 @@ class Test { '/include/pear/', '/include/Spyc.php', '/setup/cli/stage/', + '/include/plugins/', + '/include/h2o/', + '/include/fpdf/', ); function Test() { -- GitLab