PHP 클래스 PHPFusion\Rewrite\RewriteDriver

파일 보기 프로젝트 열기: php-fusion/PHP-Fusion

보호된 프로퍼티들

프로퍼티 타입 설명
$alias_pattern Array of Pattern for Aliases which are made for matching.
$aliases
$buffer_search_regex
$handlers Array of Handlers example: news, threads, articles
$instance
$output The site render HTML buffer which is to be scanned
$path_search_regex
$pattern_replace Target URLs to which permalink request will be rewrited.
$pattern_search Permalink Patterns which will be searched to match against current request.
$pattern_tables Array of DB Table Names with Schema example: prefix_news, prefix_threads, prefix_articles
$patterns_regex Array of Regular Expressions Patterns which are made for matching.
$queries Array of Total Queries which were run.
$regex_statements array Statements are calculation results of Rewrite scan We will have various types of regex statements This is the results data of the entire permalink success/fails
$requesturi Portion of the URL to match in the Regex
$rewrite_code example: %thread_id%, %news_id%
$rewrite_replace example: %thread_id% should be replaced with ([0-9]+)
$warnings Array of Warnings

공개 메소드들

메소드 설명
getInstance ( ) : static Get the instance of the class

보호된 메소드들

메소드 설명
HTML_In ( $output ) Entrance to Permalink from PHP Buffer This function prepares HTML codes to be preg_matched against Permalink Driver Decode everything
HTML_Out ( $output ) Exit from Permalink to PHP Buffer This function prepares HTML codes to be viewed by browser
addRegexTag ( array $regex, string $driver ) Adds the Regular Expression Tags
appendSearchPath ( string $str ) : string Append the BASEDIR Path to Search String
cleanRegex ( string $regex ) : string Clean the REGEX by escaping some characters
cleanString ( $mystr = "" ) Clean the URI String for MATCH/AGAINST in MySQL
cleanURL ( string $string, $delimiter = "-" ) : string Cleans the URL
getTagPosition ( string $pattern, string $search ) Calculates the Tag Position in a given pattern.
getUniqueIDtag ( string $type ) Get the Tag of the Unique ID type
handle_non_seo_url ( ) Validate_url
handle_permalink_requests ( ) Builds the Regular Expressions Patterns for Permalink Translations
includeHandlers ( ) Include the Handlers
includeRewrite ( ) Include the rewrite include file
loadSQLDrivers ( ) Import Handlers from Database
makeSearchRegex ( $pattern, string $type ) Adds the Regular Expression Tags -- for permalink search regex
normalize ( $string ) : string Replaces special characters in a string with their "non-special" counterpart.
prepare_searchRegex ( )
redirect_301 ( string $target, $debug = FALSE ) Redirect 301 : Moved Permanently Redirect This function invoked to prevent of caching any kinds of Non SEO URL on render.
replaceOtherTags ( string $type, string $search, string $replace, array $matches, string $matchkey ) : string Replace Other Tags in Pattern
setWarning ( integer $code, string $info = "" ) Set Warnings
verifyHandlers ( ) Verify Handlers
wrapDoubleQuotes ( $str ) : string Add compatibalities with double quotes HTML codes for Permalink
wrapQuotes ( string $str ) : string Wrap a String with Single Quotes (') This function will wrap a string passed with Single Quotes.

비공개 메소드들

메소드 설명
AddRewrite ( string $include_prefix ) Add the rewrite include file to be included

메소드 상세

HTML_In() 보호된 메소드

Entrance to Permalink from PHP Buffer This function prepares HTML codes to be preg_matched against Permalink Driver Decode everything
protected HTML_In ( $output )

HTML_Out() 보호된 메소드

Exit from Permalink to PHP Buffer This function prepares HTML codes to be viewed by browser
protected HTML_Out ( $output )
$output

addRegexTag() 보호된 메소드

This will Add Regex Tags, which will be replaced in the search patterns. Example: %news_id% could be replaced with ([0-9]+) as it must be a number.
protected addRegexTag ( array $regex, string $driver )
$regex array Array of Tags to be added.
$driver string Type or Handler name

appendSearchPath() 보호된 메소드

This function will append the BASEDIR path to the Search pattern. This is required in some cases like when we are on actual php script page and Permalinks are ON.
protected appendSearchPath ( string $str ) : string
$str string The String
리턴 string

cleanRegex() 보호된 정적인 메소드

This function will escape some characters in the Regex expression
protected static cleanRegex ( string $regex ) : string
$regex string The expression String
리턴 string

cleanString() 보호된 메소드

This function will Clean the string and removes any unwanted characters from it.
protected cleanString ( $mystr = "" )

cleanURL() 보호된 정적인 메소드

This function will clean the URL by removing any unwanted characters from it and only allowing alphanumeric and - in the URL. This function can be customized according to your needs.
protected static cleanURL ( string $string, $delimiter = "-" ) : string
$string string The URL String
리턴 string

getInstance() 공개 정적인 메소드

Get the instance of the class
public static getInstance ( ) : static
리턴 static

getTagPosition() 보호된 메소드

This function will calculate the position of a given Tag in a given pattern. Example: %id% is at 2 position in articles-%title%-%id%
protected getTagPosition ( string $pattern, string $search )
$pattern string The Pattern string in which particular Tag will be searched.
$search string The Tag which will be searched.

getUniqueIDtag() 보호된 메소드

Example: For news, unique ID should be news_id So it will return %news_id% because of array("%%news_id" => "news_id")
protected getUniqueIDtag ( string $type )
$type string Type or Handler name

handle_non_seo_url() 보호된 메소드

If Page is Not SEO, Redirect to SEO one
protected handle_non_seo_url ( )

includeHandlers() 보호된 메소드

This function will include the neccessary files for the Handler and call the functions to manipulate the information from the Handler files.
protected includeHandlers ( )

includeRewrite() 보호된 메소드

The include file will be included from INCLUDES."rewrites/".PREFIX."_rewrite_include.php
protected includeRewrite ( )

loadSQLDrivers() 보호된 메소드

This will import all the Enabled Handlers from the Database Table
protected loadSQLDrivers ( )

makeSearchRegex() 보호된 메소드

This will Add Regex Tags, which will be replaced in the search patterns. Example: %news_id% could be replaced with ([0-9]+) as it must be a number.
protected makeSearchRegex ( $pattern, string $type )
$type string Type or Handler name

normalize() 보호된 정적인 메소드

Useful for friendly URLs.
protected static normalize ( $string ) : string
리턴 string

prepare_searchRegex() 보호된 메소드

protected prepare_searchRegex ( )

redirect_301() 보호된 정적인 메소드

Let search engine mark as 301 permanently
protected static redirect_301 ( string $target, $debug = FALSE )
$target string The Target URL

replaceOtherTags() 보호된 메소드

This function will replace all the Tags in the Pattern with their suitable found matches. All the Information is passed to the function and it will replace the Tags with their respective matches.
protected replaceOtherTags ( string $type, string $search, string $replace, array $matches, string $matchkey ) : string
$type string Type of Pattern
$search string specific Search Pattern
$replace string specific Replace Pattern
$matches array Array of the Matches found for a specific pattern
$matchkey string A Unique matchkey for different matches found for same pattern
리턴 string

setWarning() 보호된 메소드

This function will set Warnings. It will set them by Adding them into the $this->warnings array.
protected setWarning ( integer $code, string $info = "" )
$code integer The Code Number of the Warning
$info string Any other Info to Show along with Warning

verifyHandlers() 보호된 메소드

This will verify all the added Handlers by checking if they are enabled or not. The Disabled Handlers are removed from the List and only Enabled Handlers are kept for working.
protected verifyHandlers ( )

wrapDoubleQuotes() 보호된 정적인 메소드

Add compatibalities with double quotes HTML codes for Permalink
protected static wrapDoubleQuotes ( $str ) : string
$str
리턴 string

wrapQuotes() 보호된 정적인 메소드

Example: mystring will become 'mystring'
protected static wrapQuotes ( string $str ) : string
$str string The String
리턴 string

프로퍼티 상세

$alias_pattern 보호되어 있는 프로퍼티

Array of Pattern for Aliases which are made for matching.
protected $alias_pattern

$aliases 보호되어 있는 프로퍼티

protected $aliases

$buffer_search_regex 보호되어 있는 프로퍼티

protected $buffer_search_regex

$handlers 보호되어 있는 프로퍼티

Array of Handlers example: news, threads, articles
protected $handlers

$instance 보호되어 있는 정적으로 프로퍼티

protected static $instance

$output 보호되어 있는 프로퍼티

The site render HTML buffer which is to be scanned
protected $output

$path_search_regex 보호되어 있는 프로퍼티

protected $path_search_regex

$pattern_replace 보호되어 있는 프로퍼티

Target URLs to which permalink request will be rewrited.
protected $pattern_replace

$pattern_tables 보호되어 있는 프로퍼티

Array of DB Table Names with Schema example: prefix_news, prefix_threads, prefix_articles
protected $pattern_tables

$patterns_regex 보호되어 있는 프로퍼티

Array of Regular Expressions Patterns which are made for matching.
protected $patterns_regex

$queries 보호되어 있는 프로퍼티

Array of Total Queries which were run.
protected $queries

$regex_statements 보호되어 있는 프로퍼티

Statements are calculation results of Rewrite scan We will have various types of regex statements This is the results data of the entire permalink success/fails
protected array $regex_statements
리턴 array

$requesturi 보호되어 있는 프로퍼티

Portion of the URL to match in the Regex
protected $requesturi

$rewrite_code 보호되어 있는 프로퍼티

example: %thread_id%, %news_id%
protected $rewrite_code

$rewrite_replace 보호되어 있는 프로퍼티

example: %thread_id% should be replaced with ([0-9]+)
protected $rewrite_replace

$warnings 보호되어 있는 프로퍼티

Array of Warnings
protected $warnings