Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
From 145a467befceccdfb862432cd018de6bedaa4f41 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 21 Oct 2010 08:24:36 -0400 Subject: [PATCH] Make the argv array a paramter to the CLIDispatcher's ctor. --- events/cli_dispatcher.php | 10 +++++++++- testing/tests/events/cli_dispatcher_test.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/events/cli_dispatcher.php b/events/cli_dispatcher.php index 31ab5ae..a3e0899 100644 --- a/events/cli_dispatcher.php +++ b/events/cli_dispatcher.php @@ -27,10 +27,18 @@ class CLIDispatcher extends Dispatcher // The input parsed from the command line arguments. protected $cli_input; + // The raw array of unparsed arguments. + protected $argv = array(); + + public function __construct($argv) + { + $this->argv = $argv; + } + // Override Start() in order to parse the arguments. public function Start() { - $this->cli_input = $this->_ParseArguments($argv); + $this->cli_input = $this->_ParseArguments($this->argv); parent::Start(); } diff --git a/testing/tests/events/cli_dispatcher_test.php b/testing/tests/events/cli_dispatcher_test.php index 409d7a8..144095d 100644 --- a/testing/tests/events/cli_dispatcher_test.php +++ b/testing/tests/events/cli_dispatcher_test.php @@ -56,7 +56,7 @@ class CLIDispatcherTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->dispatcher = new TestCLIDispatcher(); + $this->dispatcher = new TestCLIDispatcher(array()); } public function testParseNoArguments() -- 1.7.11.3