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

Commit

Permalink
Merge branch 'master' into markup
Browse files Browse the repository at this point in the history
Conflicts:
	library/Zend/Markup/Parser/Textile.php
	library/Zend/Markup/Renderer/AbstractRenderer.php
	library/Zend/Markup/Renderer/Html.php
  • Loading branch information
kokx committed Oct 30, 2010
2 parents bcd7d9e + 6c4437a commit 8e7b30c
Show file tree
Hide file tree
Showing 42 changed files with 684 additions and 475 deletions.
15 changes: 4 additions & 11 deletions src/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,28 @@
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Paginator
* @package Paginator
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Paginator;
use \Countable;

/**
* Interface for pagination adapters.
*
* @uses Countable
* @category Zend
* @package Zend_Paginator
* @package Paginator
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Adapter extends \Countable
interface Adapter extends Countable
{
/**
* Returns the total number of rows in the collection.
*
* @return integer
*/
//public function count();

/**
* Returns an collection of items for a page.
*
Expand Down
8 changes: 3 additions & 5 deletions src/Adapter/ArrayAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,21 @@
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Paginator
* @package Paginator
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Paginator\Adapter;

use Zend\Paginator\Adapter;
use Zend\Paginator\Adapter;

/**
* @uses \Zend\Paginator\Adapter
* @category Zend
* @package Zend_Paginator
* @package Paginator
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
Expand Down
11 changes: 5 additions & 6 deletions src/Adapter/DbSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @package Zend_Paginator
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand All @@ -27,14 +26,14 @@
use Zend\Db\Select,
Zend\Db,
Zend\Paginator\Adapter,
Zend\Paginator\Exception as PaginatorException;
Zend\Paginator\Adapter\Exception;

/**
* @uses \Zend\Db\Db
* @uses \Zend\Db\Expr
* @uses \Zend\Db\Select
* @uses \Zend\Paginator\Adapter
* @uses \Zend\Paginator\Exception
* @uses Zend\Paginator\Adapter\Exception
* @category Zend
* @package Zend_Paginator
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
Expand Down Expand Up @@ -93,7 +92,7 @@ public function __construct(Select $select)
* @param \Zend\Db\Select|integer $totalRowCount Total row count integer
* or query
* @return \Zend\Paginator\Adapter\DbSelect $this
* @throws \Zend\Paginator\Exception
* @throws \Zend\Paginator\Adapter\Exception
*/
public function setRowCount($rowCount)
{
Expand All @@ -110,7 +109,7 @@ public function setRowCount($rowCount)

// The select query can contain only one column, which should be the row count column
if (false === strpos($countColumnPart, $rowCountColumn)) {
throw new PaginatorException('Row count column not found');
throw new Exception\InvalidArgumentException('Row count column not found');
}

$result = $rowCount->query(Db\Db::FETCH_ASSOC)->fetch();
Expand All @@ -119,7 +118,7 @@ public function setRowCount($rowCount)
} else if (is_integer($rowCount)) {
$this->_rowCount = $rowCount;
} else {
throw new PaginatorException('Invalid row count');
throw new Exception\InvalidArgumentException('Invalid row count');
}

return $this;
Expand Down
1 change: 0 additions & 1 deletion src/Adapter/DbTableSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @package Zend_Paginator
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down
37 changes: 37 additions & 0 deletions src/Adapter/Exception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Paginator
* @subpackage Adapter
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Paginator\Adapter;

/**
* @uses Zend\Paginator\Exception
* @category Zend
* @package Zend_Paginator
* @subpackage Adapter
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Exception extends \Zend\Paginator\Exception
{}
39 changes: 39 additions & 0 deletions src/Adapter/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend\Paginator\Adapter
* @subpackage Exception
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Paginator\Adapter\Exception;

/**
* @uses Zend\Paginator\Adapter\Exception
* @category Zend
* @package Zend\Paginator\Adapter
* @subpackage Exception
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class InvalidArgumentException
extends \Zend\Paginator\Exception\InvalidArgumentException
implements \Zend\Paginator\Adapter\Exception
{}
39 changes: 39 additions & 0 deletions src/Adapter/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend\Paginator\Adapter
* @subpackage Exception
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Paginator\Adapter\Exception;

/**
* @uses Zend\Paginator\Adapter\Exception
* @category Zend
* @package Zend\Paginator\Adapter
* @subpackage Exception
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class RuntimeException
extends \Zend\Paginator\Exception\RuntimeException
implements \Zend\Paginator\Adapter\Exception
{}
37 changes: 37 additions & 0 deletions src/Adapter/Exception/UnexpectedValueException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend\Paginator\Adapter
* @subpackage Exception
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Paginator\Adapter\Exception;

/**
* @uses Zend\Paginator\Adapter\Exception
* @category Zend
* @package Zend\Paginator\Adapter
* @subpackage Exception
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class UnexpectedValueException extends \UnexpectedValueException implements \Zend\Paginator\Adapter\Exception
{}
7 changes: 3 additions & 4 deletions src/Adapter/Iterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @package Zend_Paginator
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand All @@ -28,7 +27,7 @@

/**
* @uses \Zend\Paginator\Adapter
* @uses \Zend\Paginator\Exception
* @uses \Zend\Paginator\Adapter\Exception
* @uses \Zend\Paginator\SerializableLimitIterator
* @category Zend
* @package Zend_Paginator
Expand All @@ -55,12 +54,12 @@ class Iterator implements Adapter
* Constructor.
*
* @param Iterator $iterator Iterator to paginate
* @throws \Zend\Paginator\Exception
* @throws \Zend\Paginator\Adapter\Exception
*/
public function __construct(\Iterator $iterator)
{
if (!$iterator instanceof \Countable) {
throw new \Zend\Paginator\Exception('Iterator must implement Countable');
throw new Exception\InvalidArgumentException('Iterator must implement Countable');
}

$this->_iterator = $iterator;
Expand Down
1 change: 0 additions & 1 deletion src/Adapter/Null.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* @package Zend_Paginator
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down
1 change: 0 additions & 1 deletion src/AdapterAggregate.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @subpackage Adapter
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
Expand Down
54 changes: 54 additions & 0 deletions src/AdapterBroker.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Paginator
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Paginator;

use Zend\Loader\PluginBroker;

/**
* Broker for pagination adapter instances
*
* @category Zend
* @package Zend_Paginator
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class AdapterBroker extends PluginBroker
{
/**
* @var string Default plugin loading strategy
*/
protected $defaultClassLoader = 'Zend\Paginator\AdapterLoader';

/**
* Determine if we have a valid adapter
*
* @param mixed $plugin
* @return true
* @throws Exception
*/
protected function validatePlugin($plugin)
{
if (!$plugin instanceof Adapter) {
throw new Exception('Pagination adapters must implement Zend\Paginator\Adapter');
}
return true;
}
}
Loading

0 comments on commit 8e7b30c

Please sign in to comment.