Skip to content
Browse files

Check for front controller in constructor

  • Loading branch information...
1 parent c5996b6 commit e22b487ebbdb1197612710207a89ec8d9b9edd53 @marcguyer committed Jul 27, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 Http/ZendAdapter.php
View
7 Http/ZendAdapter.php
@@ -19,16 +19,15 @@ class CheddarGetter_Http_ZendAdapter extends CheddarGetter_Http_NativeAdapter {
private $_request;
public function __construct() {
-
+ if (!class_exists('Zend_Controller_Front')) {
+ throw new CheddarGetter_Client_Exception('The Zend front controller is not available.', CheddarGetter_Client_Exception::USAGE_INVALID);
+ }
}
private function _request() {
if ($this->_request) {
return $this->_request;
}
- if (!class_exists('Zend_Controller_Front')) {
- throw new CheddarGetter_Client_Exception('The Zend front controller is not available.', CheddarGetter_Client_Exception::USAGE_INVALID);
- }
$this->_request = Zend_Controller_Front::getInstance()->getRequest();
return $this->_request;
}

0 comments on commit e22b487

Please sign in to comment.
Something went wrong with that request. Please try again.