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

Class: RewriteParser

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

Class RewriteParser

Direct descendents
Child Class Description
RewriteApiMockParser
RewriteHelperMockParser
RewriteModuleMockParser Mock rewrite parser for this test
AdminRewriteMockParser
SetupRewriteMockParser
ModRewriteParser This URL rewrite parser provides Apache mod_rewrite support for short URLs.
IsapiRewriteParser This URL rewrite parser provides ISAPI_Rewrite support for short URLs.
PathInfoParser This URL Rewrite parser provides PHP Path Info support for short URLs.

[ Top ]
Property Summary
string   $_parserId   The id of this parser
string   $_type   The type of this parser. Can be either 'preGallery' or 'inGallery'
string   $_urlGeneratorId   The name of this URL generator class

[ Top ]
Method Summary
void   fetchEmbedConfig()  
array   getErrorMessage()   Returns translated error message, called from AdminRewrite when an unsucsessful save has been made. A valid $code is anything that $this->saveActiveRules would return if an error occurs.
void   getParserId()  
void   getParserType()  
void   getUrlGeneratorId()  
array   handleAdminParserRequest()   Handles the submitted form and should save the settings.
array   handleTestResultsRequest()   Handles the submitted form and should save any settings (ie. forced tests).
boolean   isValidRule()   This function is called when new rules are saved and by rewrite.AdminRewrite to know if this rule should be displayed. If the parser overrides this function it needs to call this (the parent). It also verifies that locked rules are saved with the original pattern. We perform a sanity check to minimize possible conflicts and bad regular expressions.
GalleryStatus   loadAdminParserTemplate()   Displays the parser configuration if the template variable $AdminParser.body is set. It should be a Gallery base dir relative path.
GalleryStatus   loadTestResultsTemplate()   Displays the test results if the template variable $TestResults.body is set. It should be a Gallery base dir relative path.
array   needsConfiguration()   By default there's nothing to configure, so we return success.
void   needsEmbedConfig()  
array   saveAccessList()   Saves list of hosts Gallery allows as referrer and if Gallery should allow an empty referrer.
array   saveActiveRules()   Saves the active rewrite rules. This needs to be implemented by the specific plugin. It needs to save two rewrite params, activeRules and shortUrls. activeRules is just a serialized array of the given activeRules and shortUrls is returned by RewriteHelper::parseActiveRules(). It returns REWRITE_STATUS_OK on success.
void   saveEmbedConfig()  
void   _setParserId()  
void   _setParserType()  
void   _setUrlGeneratorId()  

[ Top ]
Properties
string   $_parserId [line 47]

The id of this parser

API Tags:
Access:  private


[ Top ]
string   $_type [line 63]

The type of this parser. Can be either 'preGallery' or 'inGallery'

API Tags:
Access:  private


[ Top ]
string   $_urlGeneratorId [line 55]

The name of this URL generator class

API Tags:
Access:  private


[ Top ]
Methods
fetchEmbedConfig  [line 242]

  void fetchEmbedConfig( )


API Tags:
See:  RewriteApi::fetchEmbedConfig


Redefined in descendants as:

[ Top ]
getErrorMessage  [line 158]

  array getErrorMessage( int $code, [RewriteModule $rewriteModule = null]  )

Returns translated error message, called from AdminRewrite when an unsucsessful save has been made. A valid $code is anything that $this->saveActiveRules would return if an error occurs.

Parameters:
int   $code:  rewrite status code
RewriteModule   $rewriteModule:  (optional)

API Tags:
Return:  GalleryStatus a status code string translated error message


Redefined in descendants as:

[ Top ]
getParserId  [line 259]

  void getParserId( )



[ Top ]
getParserType  [line 275]

  void getParserType( )



[ Top ]
getUrlGeneratorId  [line 267]

  void getUrlGeneratorId( )



[ Top ]
handleAdminParserRequest  [line 228]

  array handleAdminParserRequest( array $form  )

Handles the submitted form and should save the settings.

Parameters:
array   $form:  the form values

API Tags:
Return:  GalleryStatus a status code array error codes array status codes


Redefined in descendants as:

[ Top ]
handleTestResultsRequest  [line 204]

  array handleTestResultsRequest( array $form  )

Handles the submitted form and should save any settings (ie. forced tests).

Parameters:
array   $form:  the form values

API Tags:
Return:  GalleryStatus a status code array error codes array status codes


Redefined in descendants as:

[ Top ]
isValidRule  [line 117]

  boolean isValidRule( array $rule, [array $activeRule = null]  )

This function is called when new rules are saved and by rewrite.AdminRewrite to know if this rule should be displayed. If the parser overrides this function it needs to call this (the parent). It also verifies that locked rules are saved with the original pattern. We perform a sanity check to minimize possible conflicts and bad regular expressions.

Parameters:
array   $rule:  rewrite rule
array   $activeRule:  (optional) array ('pattern' => string pattern) set to the custom active rule when called from saveActiveRules

API Tags:
Return:  true if the rule is valid


Redefined in descendants as:

[ Top ]
loadAdminParserTemplate  [line 216]

  GalleryStatus loadAdminParserTemplate( &$template, &$form, GalleryTemplate $template, array $form  )

Displays the parser configuration if the template variable $AdminParser.body is set. It should be a Gallery base dir relative path.

Parameters:
GalleryTemplate   $template: 
array   $form:  the form values
   &$template: 
   &$form: 

API Tags:
Return:  a status code


Redefined in descendants as:

[ Top ]
loadTestResultsTemplate  [line 192]

  GalleryStatus loadTestResultsTemplate( &$template, &$form, GalleryTemplate $template, array $form  )

Displays the test results if the template variable $TestResults.body is set. It should be a Gallery base dir relative path.

Parameters:
GalleryTemplate   $template: 
array   $form:  the form values
   &$template: 
   &$form: 

API Tags:
Return:  a status code


Redefined in descendants as:

[ Top ]
needsConfiguration  [line 102]

  array needsConfiguration( )

By default there's nothing to configure, so we return success.


API Tags:
Return:  GalleryStatus a status code boolean true if this parser needs configuration


Redefined in descendants as:

[ Top ]
needsEmbedConfig  [line 235]

  void needsEmbedConfig( )


API Tags:
See:  RewriteApi::needsEmbedConfig


Redefined in descendants as:

[ Top ]
saveAccessList  [line 92]

  array saveAccessList( array $accessList, boolean $allowEmptyReferer  )

Saves list of hosts Gallery allows as referrer and if Gallery should allow an empty referrer.

This needs to be implemented by the specific plugin. It needs to save a serialized array of the hosts and the value of allowEmptyReferer to the params accessList and allowEmptyReferer.

Parameters:
array   $accessList:  access list of referer hosts
boolean   $allowEmptyReferer:  true if Gallery should allow empty referrer

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


Redefined in descendants as:

[ Top ]
saveActiveRules  [line 78]

  array saveActiveRules( [array $activeRules = null], [GalleryModule $upgradeModule = null]  )

Saves the active rewrite rules. This needs to be implemented by the specific plugin. It needs to save two rewrite params, activeRules and shortUrls. activeRules is just a serialized array of the given activeRules and shortUrls is returned by RewriteHelper::parseActiveRules(). It returns REWRITE_STATUS_OK on success.

Parameters:
array   $activeRules:  (if null, or not set, it defaults to the current rules)
GalleryModule   $upgradeModule:  (optional)

API Tags:
Return:  GalleryStatus a status code int rewrite status code (REWRITE_STATUS_OK on success) array string module (on error) int rule id (on error)


Redefined in descendants as:

[ Top ]
saveEmbedConfig  [line 249]

  void saveEmbedConfig( $params  )

Parameters:
   $params: 

API Tags:
See:  RewriteApi::saveEmbedConfig


Redefined in descendants as:

[ Top ]
_setParserId  [line 255]

  void _setParserId( $parserId  )

Parameters:
   $parserId: 


[ Top ]
_setParserType  [line 271]

  void _setParserType( $parserType  )

Parameters:
   $parserType: 


[ Top ]
_setUrlGeneratorId  [line 263]

  void _setUrlGeneratorId( $urlGenerator  )

Parameters:
   $urlGenerator: 


[ Top ]

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