phpDocumentor Rewrite
Classes
[ class tree: Rewrite ] [ index: Rewrite ] [ all elements ]

Class: RewriteHelper

Source Location: /modules/rewrite/classes/RewriteHelper.class

Class RewriteHelper

Method Summary
array   getHistoryForModule()   Get the rewrite rule history for a specific module.
array   getRewriteParser()   Load and initialize the rewrite plugin. If no plugin has been configured yet it returns a GalleryStatus ERROR_MISSING_VALUE.
array   parseActiveRules()   Parse active rules into an array of regular expressions for parsing URLs during page requests and build an array for the URL generator to use when generating short URLs.
GalleryStatus   setHistoryForModule()   Store the rewrite rule history for a specific module.
int   _parseKeywords()   Replace keywords with appropriate pattern and add backreference to $regexRule['keywords'].
array   _parseRule()   Replace keywords with appropriate pattern and append to $regexRules.
int   _sortRules()   Comparison function used to order regex rules. Order rules from most specific to least specific.

[ Top ]
Methods
getHistoryForModule  [line 419]

  array getHistoryForModule( string $moduleId  )

Get the rewrite rule history for a specific module.

Parameters:
string   $moduleId:  id of the module

API Tags:
Return:  GalleryStatus a status code array (mixed ruleId => array ('pattern' => string pattern))


[ Top ]
getRewriteParser  [line 52]

  array getRewriteParser( [boolean $new = false]  )

Load and initialize the rewrite plugin. If no plugin has been configured yet it returns a GalleryStatus ERROR_MISSING_VALUE.

Parameters:
boolean   $new:  (optional) true if we need a new instance

API Tags:
Return:  GalleryStatus a status code RewritePlugin a loaded parser


[ Top ]
parseActiveRules  [line 92]

  array parseActiveRules( &$activeRules, RewriteParser $rewriteParser, [GalleryModule $upgradeModule = null], [array $flags = null], array $activeRules  )

Parse active rules into an array of regular expressions for parsing URLs during page requests and build an array for the URL generator to use when generating short URLs.

Parameters:
array   $activeRules:  array array ('pattern' => string pattern) active rules by reference
RewriteParser   $rewriteParser: 
GalleryModule   $upgradeModule:  (optional) passed in during activate / upgrade
array   $flags:  optional definition of default and mandatory flags
   &$activeRules: 

API Tags:
Return:  GalleryStatus a status code int rewrite status code (REWRITE_STATUS_OK on success) array parsed patterns translated to regular expressions array short URLs which will used by to generate URLs array string module (on error) int rule id (on error)


[ Top ]
setHistoryForModule  [line 436]

  GalleryStatus setHistoryForModule( string $moduleId, array $history  )

Store the rewrite rule history for a specific module.

Parameters:
string   $moduleId:  id of the module
array   $history:  array (mixed ruleId => array ('pattern' => string pattern))

API Tags:
Return:  a status code


[ Top ]
_parseKeywords  [line 334]

  int _parseKeywords( &$regexRule, &$pattern, array $keywords, array $regexRule, array $pattern  )

Replace keywords with appropriate pattern and add backreference to $regexRule['keywords'].

Parameters:
array   $regexRule:  parsed rule
array   $pattern: 
array   $keywords:  of keywords => regular expresion for the htaccess file
   &$regexRule: 
   &$pattern: 

API Tags:
Return:  rewrite status code (REWRITE_STATUS_OK on success)
Access:  private


[ Top ]
_parseRule  [line 286]

  array _parseRule( &$regexRules, array $rule, array $activeRule, array $regexRules  )

Replace keywords with appropriate pattern and append to $regexRules.

Parameters:
array   $regexRules:  of parsed rules
array   $rule:  rewrite rule
array   $activeRule:  array ('pattern' => string pattern)
   &$regexRules: 

API Tags:
Return:  GalleryStatus a status code int rewrite status code (REWRITE_STATUS_OK on success)
Access:  private


[ Top ]
_sortRules  [line 363]

  int _sortRules( array $a, array $b  )

Comparison function used to order regex rules. Order rules from most specific to least specific.

Parameters:
array   $a:  first rule to compare
array   $b:  second rule to compare

API Tags:
Return:  an integer less than, equal to, or greater than zero if the first rule is considered to be respectively less than, equal to, or greater than the second
Access:  private


[ Top ]

Documentation generated on Fri, 08 Oct 2010 05:51:03 -0700 by phpDocumentor 1.3.0RC6