PHP Class PHPFusion\Rewrite\Router

You can use this API to Add custom rules for handling requests
Inheritance: extends RewriteDriver
显示文件 Open project: php-fusion/PHP-Fusion

Public Properties

Property Type Description
$routing boolean True = SEF URL to FilePath False = File Path to SEF URL

Public Methods

Method Description
__construct ( )
getFilePath ( ) Index Include File
rewritePage ( ) Call all the functions to process rewrite detection and further actions.
setGetParameters ( mixed $get_parameters )
setPathtofile ( mixed $pathtofile )
setquerystring ( ) Set the new QUERY_STRING This function will set the values of QUERY_STRING to new value which is calculated in buildParams().
setservervars ( ) Set the PHP_SELF and SCRIPT_NAME to the suitable filepath.

Protected Methods

Method Description
makeSearchRegex ( string $pattern, string $type ) Builds the Regex pattern for a specific Type string

Private Methods

Method Description
buildParams ( ) Builds the $_GET parameters This function will build the GET parameters and also the Query String.
checkAlias ( ) Checks if there is any matching Alias or not
checkAliasPatterns ( ) Checks if there is any matching Alias Pattern or not
checkPattern ( ) Builds the Regular Expressions Patterns
explodeURL ( string $url, string $param_delimiter = "&" ) Explodes a URL into Filename and Get Parameters
getAliasURL ( string $url, string $php_url, string $type ) Get Alias URL for Router This function will return an Array of 2 elements for a specific Alias: 1. The Permalink URL of Alias 2. PHP URL of the Alias
importPatterns ( ) Import the Available Patterns from Database
setVariables ( ) Call the Functions to Set GET Parameters and Query String This function will call the functions to set Server GET parameters and the QUERY_STRING.

Method Details

__construct() public method

public __construct ( )

getFilePath() public method

Returns the filename of the php file which will be included. If this file is blank, index.php will redirect to 404 error page
public getFilePath ( )

makeSearchRegex() protected method

This function will build the Regex pattern for a specific string, which is passed to the function.
protected makeSearchRegex ( string $pattern, string $type )
$pattern string The String
$type string Type or Handler name

rewritePage() public method

This will call all the other functions after all the included files have been included and all the patterns have been made.
public rewritePage ( )

setGetParameters() public method

public setGetParameters ( mixed $get_parameters )
$get_parameters mixed

setPathtofile() public method

public setPathtofile ( mixed $pathtofile )
$pathtofile mixed

setquerystring() public method

Set the new QUERY_STRING This function will set the values of QUERY_STRING to new value which is calculated in buildParams().
public setquerystring ( )

setservervars() public method

This function will set the values of PHP_SELF and SCRIPT_NAME to the suitable file name. The filename will be searched in the $pattern_replace array. The php filename is found before '?' in the pattern.
public setservervars ( )

Property Details

$routing public_oe property

True = SEF URL to FilePath False = File Path to SEF URL
public bool $routing
return boolean