From 86d1ea20e4a367093a723be086a7e5cfdbb9d406 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Thu, 19 Dec 2013 11:01:46 -0800 Subject: [PATCH] Fixed reference to $this. --- flight/Engine.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flight/Engine.php b/flight/Engine.php index 72bead8..50a00a9 100644 --- a/flight/Engine.php +++ b/flight/Engine.php @@ -274,6 +274,7 @@ class Engine { */ public function _start() { $dispatched = false; + $self = $this; // Flush any existing output if (ob_get_length() > 0) { @@ -292,8 +293,8 @@ class Engine { } // Allow post-filters to run - $this->after('start', function() { - $this->stop(); + $this->after('start', function() use ($self) { + $self->stop(); }); // Route the request