diff --git a/README.md b/README.md index 55afbc8..d0de6f4 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ All this middleware does is check if there is a GET or a POST variable by the na * `Rack::insert_before($target, $name, $file = null)` — Same as `Rack::add()`, except that instead of placing the new middleware at the end of the stack, it is inserted before the middleware `$name`. * `Rack::insert_after($target, $name, $file = null)` — Same as `Rack::insert_before()`, except new middleware is inserted after `$target`. * `Rack::swap($target, $name, $file = null)` — Replace `$target` middleware with `$name`. -* `Rack::init($middleware = array())` — Can optionally be used as a simpler way to start Rack, as it takes an array of strings representing the stack classes. It also starts output buffering, so anything echoed within a stack class, will not be output till after Rack has output it's headers. Is also automatically called to start output buffering if needed the first time you call `Rack::add()`, `Rack::insert_before()`, or `Rack::insert_after()`. +* `Rack::init($middleware = array())` — Can optionally be used as a simpler way to start Rack, as it takes an array of strings representing the stack classes. It also starts output buffering, so anything echoed within a stack class, will not be output till after Rack has output it's headers. Is also automatically called to start output buffering if needed the first time you call `Rack::add()`. * `Rack::not_found()` — A shortcut method you can use when you want to return a 404 Not Found error status/page. It simply returns `array(404, array("Content-Type" => "text/html"), "Not Found")`. * `Rack::run()` — Initiate and execute the Rack stack. diff --git a/lib/rack.php b/lib/rack.php index 9eaa716..3520c2e 100644 --- a/lib/rack.php +++ b/lib/rack.php @@ -62,7 +62,6 @@ class Rack { public static function insert_before ($target, $name, $file = null) { - if ( !self::$ob_started ) self::init(); if ( !self::$constructed ) { if ( array_key_exists($target, self::$middleware) ) { $keys = array_keys(self::$middleware); @@ -84,7 +83,6 @@ class Rack { public static function insert_after ($target, $name, $file = null) { - if ( !self::$ob_started ) self::init(); if ( !self::$constructed ) { if ( array_key_exists($target, self::$middleware) ) { $keys = array_keys(self::$middleware);