diff --git a/fproject/Zend/Amf/Adobe/Auth.php b/fproject/Zend/Amf/Adobe/Auth.php index 1aa0337..0f6ed04 100644 --- a/fproject/Zend/Amf/Adobe/Auth.php +++ b/fproject/Zend/Amf/Adobe/Auth.php @@ -98,7 +98,7 @@ public function getAcl() /** * Perform authentication * - * @throws Zend_Auth_Adapter_Exception + * @throws \fproject\amf\AmfException * @return Zend_Auth_Result * @see Zend_Auth_Adapter_Interface#authenticate() */ @@ -106,11 +106,7 @@ public function authenticate() { if (empty($this->_username) || empty($this->_password)) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Username/password should be set'); + throw new \fproject\amf\AmfException('Username/password should be set'); } if(!isset($this->_users[$this->_username])) { diff --git a/fproject/Zend/Auth/Adapter/DbTable.php b/fproject/Zend/Auth/Adapter/DbTable.php index 26bf2c7..136441e 100644 --- a/fproject/Zend/Auth/Adapter/DbTable.php +++ b/fproject/Zend/Auth/Adapter/DbTable.php @@ -160,7 +160,7 @@ public function __construct(Zend_Db_Adapter_Abstract $zendDb = null, $tableName * _setDbAdapter() - set the database adapter to be used for quering * * @param Zend_Db_Adapter_Abstract - * @throws Zend_Auth_Adapter_Exception + * @throws \fproject\amf\AmfException * @return Zend_Auth_Adapter_DbTable */ protected function _setDbAdapter(Zend_Db_Adapter_Abstract $zendDb = null) @@ -174,8 +174,7 @@ protected function _setDbAdapter(Zend_Db_Adapter_Abstract $zendDb = null) require_once 'Zend/Db/Table/Abstract.php'; $this->_zendDb = Zend_Db_Table_Abstract::getDefaultAdapter(); if (null === $this->_zendDb) { - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('No database adapter present'); + throw new \fproject\amf\AmfException('No database adapter present'); } } @@ -359,7 +358,7 @@ public function getResultRowObject($returnColumns = null, $omitColumns = null) * been configured with all necessary information to successfully connect to a database * table and attempt to find a record matching the provided identity. * - * @throws Zend_Auth_Adapter_Exception if answering the authentication query is impossible + * @throws \fproject\amf\AmfException if answering the authentication query is impossible * @return Zend_Auth_Result */ public function authenticate() @@ -392,7 +391,7 @@ public function authenticate() * making sure that this adapter was indeed setup properly with all * required pieces of information. * - * @throws Zend_Auth_Adapter_Exception - in the event that setup was not done properly + * @throws \fproject\amf\AmfException - in the event that setup was not done properly * @return true */ protected function _authenticateSetup() @@ -412,11 +411,7 @@ protected function _authenticateSetup() } if (null !== $exception) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception($exception); + throw new \fproject\amf\AmfException($exception); } $this->_authenticateResultInfo = array( @@ -466,7 +461,7 @@ protected function _authenticateCreateSelect() * performs a query against the database with that object. * * @param Zend_Db_Select $dbSelect - * @throws Zend_Auth_Adapter_Exception - when an invalid select + * @throws \fproject\amf\AmfException - when an invalid select * object is encountered * @return array */ @@ -483,11 +478,7 @@ protected function _authenticateQuerySelect(Zend_Db_Select $dbSelect) unset($origDbFetchMode); } } catch (Exception $e) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('The supplied parameters to Zend_Auth_Adapter_DbTable failed to ' + throw new \fproject\amf\AmfException('The supplied parameters to Zend_Auth_Adapter_DbTable failed to ' . 'produce a valid sql statement, please check table and column names ' . 'for validity.', 0, $e); } diff --git a/fproject/Zend/Auth/Adapter/Digest.php b/fproject/Zend/Auth/Adapter/Digest.php index 6a78a8e..be4321d 100644 --- a/fproject/Zend/Auth/Adapter/Digest.php +++ b/fproject/Zend/Auth/Adapter/Digest.php @@ -175,7 +175,7 @@ public function setPassword($password) /** * Defined by Zend_Auth_Adapter_Interface * - * @throws Zend_Auth_Adapter_Exception + * @throws \fproject\amf\AmfException * @return Zend_Auth_Result */ public function authenticate() @@ -183,20 +183,12 @@ public function authenticate() $optionsRequired = array('filename', 'realm', 'username', 'password'); foreach ($optionsRequired as $optionRequired) { if (null === $this->{"_$optionRequired"}) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception("Option '$optionRequired' must be set before authentication"); + throw new \fproject\amf\AmfException("Option '$optionRequired' must be set before authentication"); } } if (false === ($fileHandle = @fopen($this->_filename, 'r'))) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception("Cannot open '$this->_filename' for reading"); + throw new \fproject\amf\AmfException("Cannot open '$this->_filename' for reading"); } $id = "$this->_username:$this->_realm"; diff --git a/fproject/Zend/Auth/Adapter/Exception.php b/fproject/Zend/Auth/Adapter/Exception.php deleted file mode 100644 index 23cdf99..0000000 --- a/fproject/Zend/Auth/Adapter/Exception.php +++ /dev/null @@ -1,38 +0,0 @@ - Whether to send the opaque value in the header * 'alogrithm' => See $_supportedAlgos. Default: MD5 * 'proxy_auth' => Whether to do authentication as a Proxy - * @throws Zend_Auth_Adapter_Exception + * @throws \fproject\amf\AmfException * @return void */ public function __construct(array $config) { if (!extension_loaded('hash')) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception(__CLASS__ . ' requires the \'hash\' extension'); + throw new \fproject\amf\AmfException(__CLASS__ . ' requires the \'hash\' extension'); } $this->_request = null; @@ -181,21 +177,13 @@ public function __construct(array $config) if (empty($config['accept_schemes'])) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Config key \'accept_schemes\' is required'); + throw new \fproject\amf\AmfException('Config key \'accept_schemes\' is required'); } $schemes = explode(' ', $config['accept_schemes']); $this->_acceptSchemes = array_intersect($schemes, $this->_supportedSchemes); if (empty($this->_acceptSchemes)) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('No supported schemes given in \'accept_schemes\'. Valid values: ' + throw new \fproject\amf\AmfException('No supported schemes given in \'accept_schemes\'. Valid values: ' . implode(', ', $this->_supportedSchemes)); } @@ -205,11 +193,7 @@ public function __construct(array $config) !ctype_print($config['realm']) || strpos($config['realm'], ':') !== false || strpos($config['realm'], '"') !== false) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Config key \'realm\' is required, and must contain only printable ' + throw new \fproject\amf\AmfException('Config key \'realm\' is required, and must contain only printable ' . 'characters, excluding quotation marks and colons'); } else { $this->_realm = $config['realm']; @@ -219,11 +203,7 @@ public function __construct(array $config) if (empty($config['digest_domains']) || !ctype_print($config['digest_domains']) || strpos($config['digest_domains'], '"') !== false) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Config key \'digest_domains\' is required, and must contain ' + throw new \fproject\amf\AmfException('Config key \'digest_domains\' is required, and must contain ' . 'only printable characters, excluding quotation marks'); } else { $this->_domains = $config['digest_domains']; @@ -231,11 +211,7 @@ public function __construct(array $config) if (empty($config['nonce_timeout']) || !is_numeric($config['nonce_timeout'])) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Config key \'nonce_timeout\' is required, and must be an ' + throw new \fproject\amf\AmfException('Config key \'nonce_timeout\' is required, and must be an ' . 'integer'); } else { $this->_nonceTimeout = (int) $config['nonce_timeout']; @@ -358,18 +334,14 @@ public function getResponse() /** * Authenticate * - * @throws Zend_Auth_Adapter_Exception + * @throws \fproject\amf\AmfException * @return Zend_Auth_Result */ public function authenticate() { if (empty($this->_request) || empty($this->_response)) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Request and Response objects must be set before calling ' + throw new \fproject\amf\AmfException('Request and Response objects must be set before calling ' . 'authenticate()'); } @@ -412,11 +384,7 @@ public function authenticate() $result = $this->_digestAuth($authHeader); break; default: - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Unsupported authentication scheme'); + throw new \fproject\amf\AmfException('Unsupported authentication scheme'); } return $result; @@ -493,24 +461,16 @@ protected function _digestHeader() * Basic Authentication * * @param string $header Client's Authorization header - * @throws Zend_Auth_Adapter_Exception + * @throws \fproject\amf\AmfException * @return Zend_Auth_Result */ protected function _basicAuth($header) { if (empty($header)) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('The value of the client Authorization header is required'); + throw new \fproject\amf\AmfException('The value of the client Authorization header is required'); } if (empty($this->_basicResolver)) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('A basicResolver object must be set before doing Basic ' + throw new \fproject\amf\AmfException('A basicResolver object must be set before doing Basic ' . 'authentication'); } @@ -518,11 +478,7 @@ protected function _basicAuth($header) $auth = substr($header, strlen('Basic ')); $auth = base64_decode($auth); if (!$auth) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Unable to base64_decode Authorization header value'); + throw new \fproject\amf\AmfException('Unable to base64_decode Authorization header value'); } // See ZF-1253. Validate the credentials the same way the digest @@ -550,24 +506,16 @@ protected function _basicAuth($header) * Digest Authentication * * @param string $header Client's Authorization header - * @throws Zend_Auth_Adapter_Exception + * @throws \fproject\amf\AmfException * @return Zend_Auth_Result Valid auth result only on successful auth */ protected function _digestAuth($header) { if (empty($header)) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('The value of the client Authorization header is required'); + throw new \fproject\amf\AmfException('The value of the client Authorization header is required'); } if (empty($this->_digestResolver)) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('A digestResolver object must be set before doing Digest authentication'); + throw new \fproject\amf\AmfException('A digestResolver object must be set before doing Digest authentication'); } $data = $this->_parseDigestAuth($header); @@ -622,11 +570,7 @@ protected function _digestAuth($header) // Should be REQUEST_METHOD . ':' . uri . ':' . hash(entity-body), // but this isn't supported yet, so fall through to default case default: - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Client requested an unsupported qop option'); + throw new \fproject\amf\AmfException('Client requested an unsupported qop option'); } // Using hash() should make parameterizing the hash algorithm // easier diff --git a/fproject/Zend/Auth/Adapter/Interface.php b/fproject/Zend/Auth/Adapter/Interface.php index e43e088..1e586b9 100644 --- a/fproject/Zend/Auth/Adapter/Interface.php +++ b/fproject/Zend/Auth/Adapter/Interface.php @@ -39,7 +39,7 @@ interface Zend_Auth_Adapter_Interface /** * Performs an authentication attempt * - * @throws Zend_Auth_Adapter_Exception If authentication cannot be performed + * @throws \fproject\amf\AmfException If authentication cannot be performed * @return Zend_Auth_Result */ public function authenticate(); diff --git a/fproject/Zend/Auth/Adapter/Ldap.php b/fproject/Zend/Auth/Adapter/Ldap.php index d8681bb..a922e67 100644 --- a/fproject/Zend/Auth/Adapter/Ldap.php +++ b/fproject/Zend/Auth/Adapter/Ldap.php @@ -239,7 +239,7 @@ protected function _getAuthorityName() /** * Authenticate the user * - * @throws Zend_Auth_Adapter_Exception + * @throws \fproject\amf\AmfException * @return Zend_Auth_Result */ public function authenticate() @@ -282,11 +282,7 @@ public function authenticate() foreach ($this->_options as $name => $options) { if (!is_array($options)) { - /** - * @see Zend_Auth_Adapter_Exception - */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Adapter options array not an array'); + throw new \fproject\amf\AmfException('Adapter options array not an array'); } $adapterOptions = $this->_prepareOptions($ldap, $options); $dname = ''; diff --git a/fproject/Zend/Auth/Adapter/OpenId.php b/fproject/Zend/Auth/Adapter/OpenId.php index fe14043..5770c9e 100644 --- a/fproject/Zend/Auth/Adapter/OpenId.php +++ b/fproject/Zend/Auth/Adapter/OpenId.php @@ -227,7 +227,7 @@ public function setHttpClient($client) { * Authenticates the given OpenId identity. * Defined by Zend_Auth_Adapter_Interface. * - * @throws Zend_Auth_Adapter_Exception If answering the authentication query is impossible + * @throws \fproject\amf\AmfException If answering the authentication query is impossible * @return Zend_Auth_Result */ public function authenticate() {