Location: PHPKode > scripts > PhpIndex Light > library/PhpIndex/FrontController.php
<?php
/**
* Front controller
*
* $Id: $
*
* $LastChangedBy: $
*
* $LastChangedDate: $
*
* $Rev: $
*
* @author Indiana Jones <hide@address.com>
* @version 1.0
* @copyright 2010 PhpIndex
* @package PhpIndex
*/

class PhpIndex_FrontController
{
    /**
     * Parse request string from input
     *
     * @return string
     */
    public function parseRequest()
    {
        $urlRequest = '';
        if (isset($_REQUEST['url'])) {
            $urlRequest = $_REQUEST['url'];
        }
        
        $request = $this->_cleanRequest($urlRequest);

        if (empty($request)) {
            $request = '';
        }

        return $request;
    }

    /**
     * Clean request
     *
     * @param string $request
     * @return string
     */
    private function _cleanRequest($request)
    {
        $request = ltrim($request, './\\ ');
        $request = str_replace('//', '/', $request);

        return $request;
    }
}

/* EOF */
Return current item: PhpIndex Light