Alpha Framework alpha--controller--front
[ class tree: alpha--controller--front ] [ index: alpha--controller--front ] [ all elements ]

Source for file FrontController.inc

Documentation is available at FrontController.inc

  1. <?php
  2.  
  3. require_once $config->get('sysRoot').'alpha/util/AlphaErrorHandlers.inc';
  4. require_once $config->get('sysRoot').'alpha/exceptions/AlphaException.inc';
  5. require_once $config->get('sysRoot').'alpha/exceptions/SecurityException.inc';
  6. require_once $config->get('sysRoot').'alpha/exceptions/ResourceNotFoundException.inc';
  7. require_once $config->get('sysRoot').'alpha/exceptions/IllegalArguementException.inc';
  8. require_once $config->get('sysRoot').'alpha/exceptions/LibraryNotInstalledException.inc';
  9. require_once $config->get('sysRoot').'alpha/util/filters/AlphaFilterInterface.inc';
  10. require_once $config->get('sysRoot').'alpha/model/BadRequestObject.inc';
  11. require_once $config->get('sysRoot').'alpha/controller/AlphaController.inc';
  12.  
  13. /**
  14.  * 
  15.  * The front controller designed to optionally handle all requests
  16.  * 
  17.  * @package alpha::controller::front
  18.  * @since 1.0
  19.  * @author John Collins <dev@alphaframework.org>
  20.  * @version $Id: FrontController.inc 1341 2011-03-17 15:02:02Z johnc $
  21.  * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
  22.  * @copyright Copyright (c) 2011, John Collins (founder of Alpha Framework).
  23.  *  All rights reserved.
  24.  * 
  25.  *  <pre>
  26.  *  Redistribution and use in source and binary forms, with or
  27.  *  without modification, are permitted provided that the
  28.  *  following conditions are met:
  29.  * 
  30.  *  * Redistributions of source code must retain the above
  31.  *    copyright notice, this list of conditions and the
  32.  *    following disclaimer.
  33.  *  * Redistributions in binary form must reproduce the above
  34.  *    copyright notice, this list of conditions and the
  35.  *    following disclaimer in the documentation and/or other
  36.  *    materials provided with the distribution.
  37.  *  * Neither the name of the Alpha Framework nor the names
  38.  *    of its contributors may be used to endorse or promote
  39.  *    products derived from this software without specific
  40.  *    prior written permission.
  41.  *   
  42.  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  43.  *  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  44.  *  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  45.  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  46.  *  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  47.  *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  48.  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  49.  *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  50.  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  51.  *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  52.  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  53.  *  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  54.  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  55.  *  </pre>
  56.  *  
  57.  */
  58. class FrontController {
  59.     /**
  60.      * The GET query string
  61.      *
  62.      * @var string 
  63.      * @since 1.0
  64.      */
  65.     private $queryString;
  66.     
  67.     /**
  68.      * The name of the page controller we want to invoke
  69.      *
  70.      * @var string 
  71.      * @since 1.0
  72.      */
  73.     private $pageController;
  74.     
  75.     /**
  76.      * Boolean to flag if the GET query string is encrypted or not
  77.      *
  78.      * @var boolean 
  79.      * @since 1.0
  80.      */
  81.     private $encryptedQuery false;
  82.     
  83.     /**
  84.      * An array of controller alias
  85.      *
  86.      * @var array 
  87.      * @since 1.0
  88.      */
  89.     private $controllerAlias array();
  90.     
  91.     /**
  92.      * An array of HTTP filters applied to each request to the front controller.  Each
  93.      * member must implement AlphaFilterInterface!
  94.      * 
  95.      * @var array 
  96.      * @since 1.0
  97.      */
  98.     private $filters array();
  99.     
  100.     /**
  101.      * The name of the current alias
  102.      *
  103.      * @var string 
  104.      * @since 1.0
  105.      */
  106.     private $currentAlias;
  107.     
  108.     /**
  109.      * Trace logger
  110.      * 
  111.      * @var Logger 
  112.      * @since 1.0
  113.      */
  114.     private static $logger null;
  115.     
  116.     /**
  117.      * The constructor method
  118.      * 
  119.      * @throws ResourceNotFoundException
  120.      * @since 1.0
  121.      */
  122.     public function __construct({
  123.         self::$logger new Logger('FrontController');
  124.         
  125.         self::$logger->debug('>>__construct()');
  126.         
  127.         global $config;
  128.         
  129.         self::$logger->debug('Requested URL is ['.$_SERVER['REQUEST_URI'].']');
  130.         
  131.         // direct calls to the front controller
  132.         if (isset($_GET['act'])) {
  133.             self::$logger->debug('Processing direct request to the front controller');
  134.             $this->pageController $_GET['act'];
  135.         // calls to the front controller via mod_rewrite
  136.         }elseif($config->get('sysUseModRewrite'&& !isset($_GET['tk'])) {
  137.             self::$logger->debug('Processing a mod_rewrite request');
  138.             $this->handleModRewriteRequests();            
  139.         // direct calls to the front controller with an encrypted query string
  140.         }else{
  141.             if (!isset($_GET['tk'])) {
  142.                 self::$logger->warn('No controller action set for the front controller, URL is ['.$_SERVER['REQUEST_URI'].']');
  143.                 throw new ResourceNotFoundException('The file that you have requested cannot be found!');
  144.             }else{
  145.                 self::$logger->debug('Processing a direct request to the front controller with an encrypted token param');
  146.                 $this->setEncrypt(true);
  147.                 try {
  148.                     $this->decodeQuery();            
  149.                     $this->populateGetVars();
  150.                     if(isset($_GET['act']))
  151.                         $this->pageController $_GET['act'];
  152.                     else
  153.                         throw new SecurityException('No act param provided in the secure token!');
  154.                 }catch (SecurityException $e{
  155.                     self::$logger->error('Error while attempting to decode a secure token in the FrontController: '.$e->getMessage());
  156.                     throw new ResourceNotFoundException('The file that you have requested cannot be found!');
  157.                 }
  158.             }
  159.         }
  160.         
  161.         self::$logger->debug('<<__construct');
  162.     }
  163.     
  164.     /**
  165.      * Sets the encryption flag
  166.      *
  167.      * @param boolean $encryptedQuery 
  168.      * @since 1.0
  169.      */
  170.     public function setEncrypt($encryptedQuery{
  171.         $this->encryptedQuery $encryptedQuery;
  172.     }
  173.     
  174.     /**
  175.      * Method to populate the global _GET and _REQUEST arrays with the decoded
  176.      * query string
  177.      * 
  178.      * @since 1.0
  179.      */
  180.     private function populateGetVars({
  181.                 
  182.         $pairs explode('&'$this->queryString);
  183.         
  184.         foreach($pairs as $pair{
  185.             $keyValue explode('='$pair);
  186.             if(count($keyValue== 2{
  187.                 $_GET[$keyValue[0]] $keyValue[1];
  188.                 $_REQUEST[$keyValue[0]] $keyValue[1];
  189.             }
  190.         }
  191.     }
  192.     
  193.     /**
  194.      * Static method for generating an absolute, secure URL for a page controller
  195.      * 
  196.      * @param string $params 
  197.      * @return string 
  198.      * @since 1.0
  199.      */
  200.     public static function generateSecureURL($params{
  201.         global $config;
  202.         
  203.         if($config->get('sysUseModRewrite'))
  204.             return $config->get('sysURL').'tk/'.FrontController::encodeQuery($params);
  205.         else
  206.             return $config->get('sysURL').'?tk='.FrontController::encodeQuery($params);
  207.     }
  208.     
  209.     /**
  210.      * Static method for encoding a query string
  211.      * 
  212.      * @param string $queryString 
  213.      * @return string 
  214.      * @since 1.0
  215.      */
  216.     public static function encodeQuery($queryString{
  217.         global $config;
  218.    
  219.         $td mcrypt_module_open ('tripledes''''ecb''')
  220.         $iv mcrypt_create_iv (mcrypt_enc_get_iv_size ($td)MCRYPT_RAND)
  221.         mcrypt_generic_init ($td$config->get('sysQSKey')$iv)
  222.         $encryptedData mcrypt_generic ($td$queryString)
  223.         mcrypt_generic_deinit ($td)
  224.         mcrypt_module_close ($td);
  225.        
  226.         $return base64_encode($encryptedData);
  227.         // remove any characters that are likely to cause trouble on a URL        
  228.         $return strtr($return'+/''-_');
  229.         
  230.         return $return;
  231.     }
  232.     
  233.     /**
  234.      * Method to decode the current query string
  235.      * 
  236.      * @throws SecurityException
  237.      * @since 1.0
  238.      */
  239.     private function decodeQuery({
  240.         global $config;        
  241.         
  242.         if (!isset($_GET['tk'])) {
  243.             throw new SecurityException('No token provided for the front controller!');
  244.         }else{            
  245.             $td mcrypt_module_open('tripledes''''ecb''');
  246.             $iv mcrypt_create_iv(mcrypt_enc_get_iv_size ($td)MCRYPT_RAND);
  247.             // replace any troublesome characters from the URL with the original values
  248.             $token strtr($_GET['tk']'-_''+/');
  249.             $token base64_decode($token);            
  250.             $this->queryString trim(mcrypt_decrypt('tripledes'$config->get('sysQSKey')$token'ecb'$iv));
  251.         }
  252.     }
  253.     
  254.     /**
  255.      * Static method to return the decoded GET paramters from an encrytpted tk value
  256.      * 
  257.      * @return string 
  258.      * @since 1.0
  259.      */
  260.     public static function decodeQueryParams($tk{
  261.         global $config;        
  262.         
  263.         $td mcrypt_module_open('tripledes''''ecb''');
  264.         $iv mcrypt_create_iv(mcrypt_enc_get_iv_size ($td)MCRYPT_RAND);
  265.         // replace any troublesome characters from the URL with the original values
  266.         $token strtr($tk'-_''+/');
  267.         $token base64_decode($token);
  268.         $params trim(mcrypt_decrypt('tripledes'$config->get('sysQSKey')$token'ecb'$iv));
  269.         
  270.         return $params;
  271.     }
  272.     
  273.     /**
  274.      * Static method to return the decoded GET paramters from an encrytpted tk value as an array of key/value pairs.
  275.      * 
  276.      * @return array 
  277.      * @since 1.0
  278.      */
  279.     public static function getDecodeQueryParams($tk{
  280.         global $config;        
  281.         
  282.         $td mcrypt_module_open('tripledes''''ecb''');
  283.         $iv mcrypt_create_iv(mcrypt_enc_get_iv_size ($td)MCRYPT_RAND);
  284.         // replace any troublesome characters from the URL with the original values
  285.         $token strtr($tk'-_''+/');
  286.         $token base64_decode($token);
  287.         $params trim(mcrypt_decrypt('tripledes'$config->get('sysQSKey')$token'ecb'$iv));
  288.         
  289.         $pairs explode('&'$params);
  290.         
  291.         $parameters array();
  292.         
  293.         foreach($pairs as $pair{
  294.             $split explode('='$pair);
  295.             $parameters[$split[0]] $split[1]
  296.         }
  297.         
  298.         return $parameters;
  299.     }
  300.     
  301.     /**
  302.      * Method to load the page controller
  303.      * 
  304.      * @param boolean $allowRedirects Defaults to true, set to false if you want to prevent the front controller from redirecting the request
  305.      * @throws ResourceNotFoundException
  306.      * @since 1.0
  307.      */
  308.     public function loadController($allowRedirects true{
  309.         global $config;
  310.         
  311.         if($allowRedirects && $config->get('sysCheckInstalled'&& $this->pageController != 'Install' && $this->pageController != 'Login'{
  312.             if(!AlphaDAO::isInstalled()) {
  313.                 self::$logger->info('Invoking the Install controller as the system DB is not installed...');
  314.                 $url FrontController::generateSecureURL('act=Install');
  315.                 self::$logger->info('Redirecting to ['.$url.']');
  316.                 header('Location: '.$url);
  317.                 exit;
  318.             }
  319.         }
  320.         
  321.         // first process any attached filters
  322.         foreach ($this->filters as $filter)
  323.             $filter->process();
  324.         
  325.         if($allowRedirects{
  326.             // if there is an alias configured for the above page controller, redirect there
  327.             if($config->get('sysForceFC'&& $this->hasAlias($this->pageController)) {
  328.                 // make sure that it is not already an alias-based request to prevent re-direct loop            
  329.                 if(empty($this->currentAlias)) {
  330.                     // set the correct HTTP header for the response
  331.                     header('HTTP/1.1 301 Moved Permanently');
  332.                     
  333.                     // see if there are any other GET params appart from the controller name
  334.                     if (count($_GET1{
  335.                         $keys array_keys($_GET);
  336.                         $param $_GET[$keys[1]];
  337.                         // if its a title then replace spaces with underscores in the URL
  338.                         if($keys[1== 'title')
  339.                             $param str_replace(' ','_',$param);
  340.                         
  341.                         $URL $config->get('sysURL').'/'.$this->getControllerAlias($this->pageController).'/'.
  342.                             $this->getControllerParam($this->pageController).$param;
  343.                     }else{
  344.                         $URL $config->get('sysURL').'/'.$this->getControllerAlias($this->pageController);
  345.                     }
  346.                     
  347.                     header('Location: '.$URL);
  348.                     exit;
  349.                 }
  350.             }
  351.         }
  352.         
  353.         try {
  354.             AlphaController::loadControllerDef($this->pageController);
  355.             $pageController new $this->pageController();
  356.             
  357.             if(!empty($_POST)) {            
  358.                 $pageController->doPOST($_REQUEST);
  359.             }else{                
  360.                 $pageController->doGET($_GET);
  361.             }
  362.         }catch (LibraryNotInstalledException $e{
  363.             self::$logger->warn($e->getMessage()."\nStacktrace:\n".$e->getTraceAsString()."\nRequest params:\n".var_export($_REQUESTtrue)."\nRequested resource:\n".$_SERVER['REQUEST_URI']);
  364.             throw new LibraryNotInstalledException($e->getMessage());
  365.         }catch (ResourceNotAllowedException $e{
  366.             self::$logger->warn($e->getMessage()."\nStacktrace:\n".$e->getTraceAsString()."\nRequest params:\n".var_export($_REQUESTtrue)."\nRequested resource:\n".$_SERVER['REQUEST_URI']);
  367.             throw new ResourceNotAllowedException($e->getMessage());
  368.         }catch (ResourceNotFoundException $e{
  369.             self::$logger->warn($e->getMessage()."\nStacktrace:\n".$e->getTraceAsString()."\nRequest params:\n".var_export($_REQUESTtrue)."\nRequested resource:\n".$_SERVER['REQUEST_URI']);
  370.             throw new ResourceNotFoundException($e->getMessage());
  371.         }catch (IllegalArguementException $e{
  372.             self::$logger->warn($e->getMessage()."\nStacktrace:\n".$e->getTraceAsString()."\nRequest params:\n".var_export($_REQUESTtrue)."\nRequested resource:\n".$_SERVER['REQUEST_URI']);
  373.             
  374.             if($config->get('sysEnableClientTempBlacklistFiler')) {
  375.                 if(isset($_SERVER['HTTP_USER_AGENT']&& isset($_SERVER['REMOTE_ADDR']&& isset($_SERVER['REQUEST_URI'])) {
  376.                     $request new BadRequestObject();
  377.                     $request->set('client'$_SERVER['HTTP_USER_AGENT']);
  378.                     $request->set('IP'$_SERVER['REMOTE_ADDR']);
  379.                     $request->set('requestedResource'$_SERVER['REQUEST_URI']);
  380.                     $request->save();
  381.                 }
  382.             }
  383.             
  384.             throw new ResourceNotFoundException('The file that you have requested cannot be found!');
  385.         }catch (AlphaException $e{
  386.             self::$logger->warn($e->getMessage()."\nStacktrace:\n".$e->getTraceAsString()."\nRequest params:\n".var_export($_REQUESTtrue)."\nRequested resource:\n".$_SERVER['REQUEST_URI']);
  387.             
  388.             if($config->get('sysEnableClientTempBlacklistFiler')) {
  389.                 if(isset($_SERVER['HTTP_USER_AGENT']&& isset($_SERVER['REMOTE_ADDR']&& isset($_SERVER['REQUEST_URI'])) {
  390.                     $request new BadRequestObject();
  391.                     $request->set('client'$_SERVER['HTTP_USER_AGENT']);
  392.                     $request->set('IP'$_SERVER['REMOTE_ADDR']);
  393.                     $request->set('requestedResource'$_SERVER['REQUEST_URI']);
  394.                     $request->save();
  395.                 }
  396.             }
  397.             
  398.             throw new ResourceNotFoundException('The file that you have requested cannot be found!');
  399.         }
  400.     }
  401.     
  402.     /**
  403.      * Used to register a controller alias to enable shorter URLs with mod_rewrite support enabled.  Note that
  404.      * only controllers with a single parameter are supported.
  405.      * 
  406.      * @param string $controller The name of the page controller class
  407.      * @param string $alias The URL alias for the page controller
  408.      * @param string $param The name of the GET parameter on the alias URL request
  409.      * @since 1.0
  410.      */
  411.     public function registerAlias($controller$alias$param=null{
  412.         $this->controllerAlias[$alias$controller;
  413.         if(isset($param))
  414.             $this->controllerAlias[$alias.'_param'$param;
  415.         
  416.         // set up the page controller 
  417.         $this->handleModRewriteRequests();
  418.     }
  419.     
  420.     /**
  421.      * Check to see if an alias exists for the given alias name
  422.      * 
  423.      * @param string $alias 
  424.      * @return boolean 
  425.      * @since 1.0
  426.      */
  427.     public function checkAlias($alias{        
  428.         if(array_key_exists($alias$this->controllerAlias))
  429.             return true;
  430.         else
  431.             return false;
  432.     }
  433.     
  434.     /**
  435.      * Check to see if an alias exists for the given controller name
  436.      * 
  437.      * @param string $controller 
  438.      * @return boolean 
  439.      * @since 1.0
  440.      */
  441.     public function hasAlias($controller{
  442.         if(in_array($controller$this->controllerAlias))
  443.             return true;
  444.         else
  445.             return false;
  446.     }
  447.     
  448.     /**
  449.      * Gets the full name of the controller for the given alias
  450.      * 
  451.      * @param string $alias 
  452.      * @return string 
  453.      * @since 1.0
  454.      */
  455.     public function getAliasController($alias{
  456.         if(array_key_exists($alias$this->controllerAlias))
  457.             return $this->controllerAlias[$alias];
  458.     }
  459.     
  460.     /**
  461.      * Gets the name of the alias for the given controller
  462.      * 
  463.      * @param string $controller 
  464.      * @return string 
  465.      * @since 1.0
  466.      */
  467.     public function getControllerAlias($controller{
  468.         if(in_array($controller$this->controllerAlias)) {
  469.             $keys array_keys($this->controllerAlias$controller);
  470.             // there should only ever be one key per controller
  471.             return $keys[0];
  472.         }
  473.     }
  474.     
  475.     /**
  476.      * Gets the parameter name expected in requests to the controller with the given alias
  477.      * 
  478.      * @param string $alias 
  479.      * @return string 
  480.      * @since 1.0
  481.      */
  482.     public function getAliasParam($alias{
  483.         if(array_key_exists($alias.'_param'$this->controllerAlias))
  484.             return $this->controllerAlias[$alias.'_param'];
  485.         else
  486.             return '';
  487.     }
  488.     
  489.     /**
  490.      * Gets the parameter name expected in requests to the controller with the given controller name
  491.      * 
  492.      * @param string $controller 
  493.      * @return string 
  494.      * @since 1.0
  495.      */
  496.     public function getControllerParam($controller{
  497.         $alias $this->getControllerAlias($controller);
  498.         if(array_key_exists($alias.'_param'$this->controllerAlias))
  499.             return $this->controllerAlias[$alias.'_param'];
  500.         else
  501.             return '';
  502.     }
  503.     
  504.     /**
  505.      * Handles all of the rules for mod_rewrite style URL parsing
  506.      * 
  507.      * @since 1.0
  508.      */
  509.     private function handleModRewriteRequests({
  510.         self::$logger->debug('>>handleModRewriteRequests');
  511.         global $config;
  512.         
  513.         // strip off the system URL from the request URL
  514.         $request str_replace($config->get('sysURL')'''http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
  515.         self::$logger->debug('$request is ['.$request.']');
  516.         $params explode('/'$request);
  517.         self::$logger->debug('$params are ['.var_export($paramstrue).']');
  518.         
  519.         try {
  520.             // first param will always be the controller alias
  521.             if(empty($this->currentAlias&& !empty($params[0]))
  522.                 $this->currentAlias $params[0];
  523.  
  524.             // check to see if we can load the page controller without an alias
  525.             AlphaController::loadControllerDef($params[0]);
  526.             self::$logger->debug('Page controller name set on the request URL is ['.$params[0].']');
  527.             $this->pageController $params[0];
  528.         }catch (IllegalArguementException $iae{
  529.             // handle request with alias        
  530.             self::$logger->debug('The supplied controller alias is ['.$this->currentAlias.']');
  531.             
  532.             // check to see if the controller is an alias for something
  533.             if($this->checkAlias($this->currentAlias)) {
  534.                 $this->pageController $this->getAliasController($this->currentAlias);
  535.                 self::$logger->debug('Page controller name obtained from the URL alias is ['.$this->pageController.']');
  536.                 
  537.                 if(isset($params[1])) {
  538.                     if(!empty($_POST))
  539.                         $_REQUEST[$this->getAliasParam($this->currentAlias)$params[1];
  540.                     else
  541.                         $_GET[$this->getAliasParam($this->currentAlias)$params[1];
  542.                 }
  543.             }
  544.         }
  545.         
  546.         self::$logger->debug('$params are ['.var_export($paramstrue).']');
  547.         self::$logger->debug('currentAlias is ['.$this->currentAlias.']');
  548.         
  549.         // now populate the _GET vars
  550.         if($this->currentAlias == 'tk'{
  551.             self::$logger->debug('Setting the GET vars for a mod_rewrite request with a tk param');
  552.             $this->setEncrypt(true);
  553.             $this->queryString FrontController::decodeQueryParams($params[1]);
  554.             $_GET['tk'$params[1];
  555.             $this->populateGetVars();
  556.             $this->pageController $_GET['act'];
  557.         }else{
  558.             $count count($params);
  559.             
  560.             for($i 1$i $count$i+=2{
  561.                 if(isset($params[$i+1])) {
  562.                     if(!empty($_POST))
  563.                         $_REQUEST[$params[$i]] $params[$i+1];
  564.                     else            
  565.                         $_GET[$params[$i]] $params[$i+1];
  566.                 }
  567.             }
  568.         }
  569.         
  570.         self::$logger->debug('$_GET is ['.var_export($_GETtrue).']');        
  571.         self::$logger->debug('<<handleModRewriteRequests');
  572.     }
  573.     
  574.     /**
  575.      * Getter for the page controller
  576.      * 
  577.      * @return string 
  578.      * @since 1.0
  579.      */
  580.     public function getPageController({
  581.         return $this->pageController;
  582.     }
  583.     
  584.     /**
  585.      * Add the supplied filter object to the list of filters ran on each request to the front controller
  586.      * 
  587.      * @param AlphaFilterInterface $filterObject 
  588.      * @throws IllegalArguementException
  589.      * @since 1.0
  590.      */
  591.     public function registerFilter($filterObject{
  592.         if($filterObject instanceof AlphaFilterInterface)
  593.             array_push($this->filters$filterObject);
  594.         else
  595.             throw new IllegalArguementException('Supplied filter object is not a valid AlphaFilterInterface instance!');
  596.     }
  597.     
  598.     /**
  599.      * Returns the array of filters currently attached to this FrontController
  600.      * 
  601.      * @return array 
  602.      * @since 1.0
  603.      */
  604.     public function getFilters({
  605.         return $this->filters;
  606.     }
  607. }
  608.  
  609. ?>

Documentation generated on Thu, 17 Mar 2011 16:44:17 +0000 by phpDocumentor 1.4.3