Skip to content

Commit

Permalink
Some more general stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
DASPRiD authored and weierophinney committed Jul 25, 2011
1 parent 67ec863 commit 7a75fa4
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 4 deletions.
64 changes: 64 additions & 0 deletions library/Zend/Controller/Router/Rewrite/Route/AbstractRoute.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?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 [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id$
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* @namespace
*/
namespace Zend\Controller\Router\Rewrite\Route;
use Zend\Controller\Request\HTTP as HTTPRequest;

/**
* Route interface
*
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @see http://manuals.rubyonrails.com/read/chapter/65
*/
abstract class AbstractRoute implements Route
{
/**
* match(): defined by Route interface
*
* @see Route::match()
* @param HTTPRequest $request
* @return boolean
*/
public function match(HTTPRequest $request, $pathOffset)
{

}

/**
* assemble(): Defined by Route interface
*
* @see Route::assemble()
* @param array $params
* @param array $options
* @return string
*/
public function assemble(array $params = null, array $options = null)
{

}
}
56 changes: 56 additions & 0 deletions library/Zend/Controller/Router/Rewrite/Route/Route.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?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 [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id$
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* @namespace
*/
namespace Zend\Controller\Router\Rewrite\Route;
use Zend\Controller\Request\HTTP as HTTPRequest;

/**
* Route interface
*
* @package Zend_Controller
* @subpackage Router
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @see http://manuals.rubyonrails.com/read/chapter/65
*/
interface Route
{
/**
* Match a request
*
* @param HTTPRequest $request
* @return boolean
*/
public function match(HTTPRequest $request, $pathOffset);

/**
* Assemble an URL
*
* @param array $params
* @param array $options
* @return string
*/
public function assemble(array $params = null, array $options = null);
}
9 changes: 5 additions & 4 deletions library/Zend/Controller/Router/Rewrite/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
namespace Zend\Controller\Router\Rewrite;
use Zend\Controller\Router\Rewrite\Route\Route;
use Zend\Controller\Request\HTTP as HTTPRequest;

/**
* Ruby routing based router
Expand All @@ -45,8 +46,8 @@ class Router
*/
public function addRoutes(array $routes)
{
foreach ($routes as $route) {
$this->addRoute($route);
foreach ($routes as $name => $route) {
$this->addRoute($name, $route);
}

return $this;
Expand Down Expand Up @@ -75,9 +76,9 @@ public function addRoute($name, $route)
/**
* Match a request
*
* @param \Zend\Controller\Request\HTTP $request
* @param HTTPRequest $request
*/
public function match(\Zend\Controller\Request\HTTP $request)
public function match(HTTPRequest $request)
{

}
Expand Down

0 comments on commit 7a75fa4

Please sign in to comment.