Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Arh committed Apr 21, 2012
2 parents c11d0f1 + 52120c3 commit 78a70ad
Show file tree
Hide file tree
Showing 28 changed files with 222 additions and 129 deletions.
2 changes: 1 addition & 1 deletion documentation/manual/en/module_specs/Zend_Mvc-Examples.xml
Expand Up @@ -126,7 +126,7 @@ $matches = $event->getRouteMatch();
The base <classname>Bootstrap</classname> class shipped with the
framework has an <classname>EventManager</classname> associated with it,
and once the locator and router instances are initialized, it triggers a
"bootstrap" event, with "application" and "modules" parameters.
"bootstrap" event, with "application" and "config" parameters.
</para>

<para>
Expand Down
Expand Up @@ -19,7 +19,7 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Authentication;
namespace Zend\Authentication\Adapter;

/**
* @category Zend
Expand All @@ -28,13 +28,13 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Adapter
interface AdapterInterface
{
/**
* Performs an authentication attempt
*
* @return Zend\Authentication\Result
* @throws Zend\Authentication\Adapter\Exception If authentication cannot be performed
* @throws Zend\Authentication\Adapter\Exception\ExceptionInterface If authentication cannot be performed
*/
public function authenticate();
}
6 changes: 3 additions & 3 deletions library/Zend/Authentication/Adapter/DbTable.php
Expand Up @@ -20,7 +20,7 @@
*/

namespace Zend\Authentication\Adapter;
use Zend\Authentication\Adapter as AuthenticationAdapter,
use Zend\Authentication\Adapter\AdapterInterface as AuthenticationAdapter,
Zend\Authentication\Result as AuthenticationResult,
Zend\Db\Adapter\Adapter as DbAdapter,
Zend\Db\Sql\Select as DbSelect,
Expand Down Expand Up @@ -352,7 +352,7 @@ public function authenticate()
* making sure that this adapter was indeed setup properly with all
* required pieces of information.
*
* @throws Exception - in the event that setup was not done properly
* @throws Exception\ExceptionInterface - in the event that setup was not done properly
* @return true
*/
protected function _authenticateSetup()
Expand Down Expand Up @@ -426,7 +426,7 @@ protected function _authenticateQuerySelect(DBSelect $dbSelect)
{
$statement = $this->_zendDb->createStatement();
$dbSelect->prepareStatement($this->_zendDb, $statement);
$resultSet = new ResultSet();
$resultSet = new ResultSet();
try {
$resultSet->setDataSource($statement->execute(array($this->_credential, $this->_identity)));
$resultIdentities = $resultSet->toArray();
Expand Down
6 changes: 2 additions & 4 deletions library/Zend/Authentication/Adapter/Digest.php
Expand Up @@ -20,12 +20,10 @@
*/

namespace Zend\Authentication\Adapter;
use Zend\Authentication\Adapter as AuthenticationAdapter,
use Zend\Authentication\Adapter\AdapterInterface as AuthenticationAdapter,
Zend\Authentication\Result as AuthenticationResult;

/**
* @uses Zend\Authentication\Adapter\Exception
* @uses Zend\Authentication\Adapter
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
Expand Down Expand Up @@ -173,7 +171,7 @@ public function setPassword($password)
/**
* Defined by Zend_Auth_Adapter_Interface
*
* @throws Zend\Authentication\Adapter\Exception\RuntimeException
* @throws Zend\Authentication\Adapter\Exception\ExceptionInterface
* @return Zend\Authentication\Result
*/
public function authenticate()
Expand Down
Expand Up @@ -14,20 +14,20 @@
*
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @subpackage Adapter_Exception
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Authentication\Adapter;
namespace Zend\Authentication\Adapter\Exception;

/**
* @uses Zend\Authentication\Exception
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
* @subpackage Adapter_Exception
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Exception extends \Zend\Authentication\Exception
interface ExceptionInterface extends \Zend\Authentication\Exception\ExceptionInterface
{}
Expand Up @@ -4,6 +4,6 @@

class InvalidArgumentException
extends \InvalidArgumentException
implements \Zend\Authentication\Adapter\Exception
implements \Zend\Authentication\Adapter\Exception\ExceptionInterface
{
}
Expand Up @@ -4,7 +4,7 @@

class RuntimeException
extends \RuntimeException
implements \Zend\Authentication\Adapter\Exception
implements \Zend\Authentication\Adapter\Exception\ExceptionInterface
{

}
Expand Up @@ -4,6 +4,6 @@

class UnexpectedValueException
extends \UnexpectedValueException
implements \Zend\Authentication\Adapter\Exception
implements \Zend\Authentication\Adapter\Exception\ExceptionInterface
{
}
20 changes: 9 additions & 11 deletions library/Zend/Authentication/Adapter/Http.php
Expand Up @@ -21,7 +21,7 @@

namespace Zend\Authentication\Adapter;

use Zend\Authentication\Adapter as AuthenticationAdapter,
use Zend\Authentication\Adapter\AdapterInterface as AuthenticationAdapter,
Zend\Authentication,
Zend\Http\Request as HTTPRequest,
Zend\Http\Response as HTTPResponse,
Expand All @@ -32,8 +32,6 @@
*
* Implements a pretty good chunk of RFC 2617.
*
* @uses Zend\Authentication\Exception
* @uses Zend\Authentication\Adapter
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter_Http
Expand Down Expand Up @@ -244,10 +242,10 @@ public function __construct(array $config)
/**
* Setter for the _basicResolver property
*
* @param Zend\Authentication\Adapter\Http\Resolver $resolver
* @param Zend\Authentication\Adapter\Http\ResolverInterface $resolver
* @return Zend\Authentication\Adapter\Http Provides a fluent interface
*/
public function setBasicResolver(Http\Resolver $resolver)
public function setBasicResolver(Http\ResolverInterface $resolver)
{
$this->_basicResolver = $resolver;

Expand All @@ -257,7 +255,7 @@ public function setBasicResolver(Http\Resolver $resolver)
/**
* Getter for the _basicResolver property
*
* @return Zend\Authentication\Adapter\Http\Resolver
* @return Zend\Authentication\Adapter\Http\ResolverInterface
*/
public function getBasicResolver()
{
Expand All @@ -267,10 +265,10 @@ public function getBasicResolver()
/**
* Setter for the _digestResolver property
*
* @param Zend\Authentication\Adapter\Http\Resolver $resolver
* @param Zend\Authentication\Adapter\Http\ResolverInterface $resolver
* @return Zend\Authentication\Adapter\Http Provides a fluent interface
*/
public function setDigestResolver(Http\Resolver $resolver)
public function setDigestResolver(Http\ResolverInterface $resolver)
{
$this->_digestResolver = $resolver;

Expand All @@ -280,7 +278,7 @@ public function setDigestResolver(Http\Resolver $resolver)
/**
* Getter for the _digestResolver property
*
* @return Zend\Authentication\Adapter\Http\Resolver
* @return Zend\Authentication\Adapter\Http\ResolverInterface
*/
public function getDigestResolver()
{
Expand Down Expand Up @@ -467,7 +465,7 @@ protected function _digestHeader()
* Basic Authentication
*
* @param string $header Client's Authorization header
* @throws Zend\Authentication\UnexpectedValueException
* @throws Zend\Authentication\Exception\ExceptionInterface
* @return Zend\Authentication\Result
*/
protected function _basicAuth($header)
Expand Down Expand Up @@ -514,7 +512,7 @@ protected function _basicAuth($header)
* Digest Authentication
*
* @param string $header Client's Authorization header
* @throws Zend\Authentication\Adapter\Exception\UnexpectedValueException
* @throws Zend\Authentication\Adapter\Exception\ExceptionInterface
* @return Zend\Authentication\Result Valid auth result only on successful auth
*/
protected function _digestAuth($header)
Expand Down
Expand Up @@ -14,22 +14,22 @@
*
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter_HTTP
* @subpackage Adapter_HTTP_Exception
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Authentication\Adapter\Http;
namespace Zend\Authentication\Adapter\Http\Exception;

/**
* HTTP Auth Resolver Exception
*
* @uses Zend\Authentication\Exception
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter_Http
* @subpackage Adapter_Http_Exception
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Exception extends \Zend\Authentication\Adapter\Exception
interface ExceptionInterface extends \Zend\Authentication\Adapter\Exception\ExceptionInterface
{}
@@ -0,0 +1,9 @@
<?php

namespace Zend\Authentication\Adapter\Http\Exception;

class InvalidArgumentException
extends \InvalidArgumentException
implements ExceptionInterface
{
}
@@ -0,0 +1,9 @@
<?php

namespace Zend\Authentication\Adapter\Http\Exception;

class RuntimeException
extends \RuntimeException
implements ExceptionInterface
{
}
20 changes: 9 additions & 11 deletions library/Zend/Authentication/Adapter/Http/FileResolver.php
Expand Up @@ -24,15 +24,13 @@
/**
* HTTP Authentication File Resolver
*
* @uses Zend\Authentication\Adapter\Http\Exception
* @uses Zend\Authentication\Adapter\Http\Resolver
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter_Http
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class FileResolver implements Resolver
class FileResolver implements ResolverInterface
{
/**
* Path to credentials file
Expand All @@ -59,12 +57,12 @@ public function __construct($path = '')
*
* @param string $path
* @return Zend\Authentication\Adapter\Http\FileResolver Provides a fluent interface
* @throws Zend\Authentication\Adapter\Http\Exception
* @throws Zend\Authentication\Adapter\Http\Exception\ExceptionInterface
*/
public function setFile($path)
{
if (empty($path) || !is_readable($path)) {
throw new InvalidArgumentException('Path not readable: ' . $path);
throw new Exception\InvalidArgumentException('Path not readable: ' . $path);
}
$this->_file = $path;

Expand Down Expand Up @@ -100,27 +98,27 @@ public function getFile()
* @param string $realm Authentication Realm
* @return string|false User's shared secret, if the user is found in the
* realm, false otherwise.
* @throws Zend\Authentication\Adapter\Http\Exception
* @throws Zend\Authentication\Adapter\Http\Exception\ExceptionInterface
*/
public function resolve($username, $realm)
{
if (empty($username)) {
throw new InvalidArgumentException('Username is required');
throw new Exception\InvalidArgumentException('Username is required');
} else if (!ctype_print($username) || strpos($username, ':') !== false) {
throw new InvalidArgumentException('Username must consist only of printable characters, '
throw new Exception\InvalidArgumentException('Username must consist only of printable characters, '
. 'excluding the colon');
}
if (empty($realm)) {
throw new InvalidArgumentException('Realm is required');
throw new Exception\InvalidArgumentException('Realm is required');
} else if (!ctype_print($realm) || strpos($realm, ':') !== false) {
throw new InvalidArgumentException('Realm must consist only of printable characters, '
throw new Exception\InvalidArgumentException('Realm must consist only of printable characters, '
. 'excluding the colon.');
}

// Open file, read through looking for matching credentials
$fp = @fopen($this->_file, 'r');
if (!$fp) {
throw new RuntimeException('Unable to open password file: ' . $this->_file);
throw new Exception\RuntimeException('Unable to open password file: ' . $this->_file);
}

// No real validation is done on the contents of the password file. The
Expand Down

This file was deleted.

Expand Up @@ -33,7 +33,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Resolver
interface ResolverInterface
{
/**
* Resolve username/realm to password/hash/etc.
Expand Down
9 changes: 0 additions & 9 deletions library/Zend/Authentication/Adapter/Http/RuntimeException.php

This file was deleted.

5 changes: 1 addition & 4 deletions library/Zend/Authentication/Adapter/InfoCard.php
Expand Up @@ -20,16 +20,13 @@
*/

namespace Zend\Authentication\Adapter;
use Zend\Authentication\Adapter as AuthenticationAdapter,
use Zend\Authentication\Adapter\AdapterInterface as AuthenticationAdapter,
Zend\Authentication\Result as AuthenticationResult;

/**
* A Zend_Auth Authentication Adapter allowing the use of Information Cards as an
* authentication mechanism
*
* @uses Zend\Authentication\Adapter
* @uses Zend\Authentication\Result
* @uses Zend\InfoCard\InfoCard
* @category Zend
* @package Zend_Authentication
* @subpackage Adapter
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Authentication/Adapter/Ldap.php
Expand Up @@ -21,7 +21,7 @@

namespace Zend\Authentication\Adapter;

use Zend\Authentication\Adapter as AuthenticationAdapter,
use Zend\Authentication\Adapter\AdapterInterface as AuthenticationAdapter,
Zend\Authentication\Result as AuthenticationResult,
Zend\Ldap as ZendLdap,
Zend\Ldap\Exception\LdapException;
Expand Down Expand Up @@ -237,7 +237,7 @@ protected function getAuthorityName()
* Authenticate the user
*
* @return Zend\Authentication\Result
* @throws Zend\Authentication\Adapter\Exception
* @throws Zend\Authentication\Adapter\Exception\ExceptionInterface
*/
public function authenticate()
{
Expand Down

0 comments on commit 78a70ad

Please sign in to comment.