Class RewriteRule

Description

Habari RewriteRule Class

Located in /system/classes/rewriterule.php (line 10)

QueryRecord
   |
   --RewriteRule
Class Constant Summary
Variable Summary
Method Summary
static RewriteRule create_url_rule (string $build_str, string $handler, string $action)
static array default_fields ()
RewriteRule __construct ([array $paramarray = array()])
integer arg_match (array $args)
string build (array $args, [boolean $useall = true], [ $noamp = false])
void delete ()
void insert ()
boolean match (string $stub)
void update ()
mixed __get (string $name)
Variables
mixed $entire_match = NULL (line 18)
  • access: public
mixed $named_arg_values = array() (line 19)
  • access: public

Inherited Variables

Inherited from QueryRecord

QueryRecord::$fields
QueryRecord::$newfields
QueryRecord::$unsetfields
Methods
static method create_url_rule (line 214)

Create an old-style rewrite rule

  • return: The created rule
  • access: public
static RewriteRule create_url_rule (string $build_str, string $handler, string $action)
  • string $build_str
  • string $handler
  • string $action
static method default_fields (line 27)

Returns the defined database columns for a rewrite rule.

  • return: Array of columns in the rewrite_rules table
  • access: public
static array default_fields ()
Constructor __construct (line 48)

Constructor for the rewrite_rule class.

  • access: public
RewriteRule __construct ([array $paramarray = array()])
  • array $paramarray: an associative array or querystring of initial field values

Redefinition of:
QueryRecord::__construct()
constructor __construct Constructor for the QueryRecord class.
arg_match (line 145)

Returns a distance from 0 indicating the appropriateness of the rule based on the passed-in arguments.

  • return: Returns 0 for an exact match, a higher number for less of a match
  • todo: Enable this logic
  • access: public
integer arg_match (array $args)
  • array $args: An array of arguments
build (line 99)

Builds a URL using this rule based on the passed in data

  • return: The URL created from the substituted arguments
  • access: public
string build (array $args, [boolean $useall = true], [ $noamp = false])
  • array $args: An associative array of arguments to use for replacement in the rule
  • boolean $useall: If true (default), then all passed parameters that are not part of the built URL are tacked onto the URL as querystring
  • $noamp
delete (line 202)

Deletes an existing rule

  • access: public
void delete ()

Redefinition of:
QueryRecord::delete()
This is the public interface that deletes a record
insert (line 186)

Saves a new rewrite rule to the rewrite_rules table

  • access: public
void insert ()

Redefinition of:
QueryRecord::insert()
This is the public interface that inserts a record
match (line 66)

Match the stub against this rule

Also sets internal structures based on a successful match

  • return: True if this rule matches the stub, false if not
  • access: public
boolean match (string $stub)
  • string $stub: The URL stub to match against
update (line 194)

Updates an existing rule in the rewrite_rules table

  • access: public
void update ()

Redefinition of:
QueryRecord::update()
This is the public interface that updates a record
__get (line 167)

Magic property getter for this class

  • return: The value of that field in this object
  • access: public
mixed __get (string $name)
  • string $name: The name of the class property to return

Redefinition of:
QueryRecord::__get()
function __get

Inherited Methods

Inherited From QueryRecord

QueryRecord::__construct()
QueryRecord::delete()
QueryRecord::deleteRecord()
QueryRecord::exclude_fields()
QueryRecord::get_url_args()
QueryRecord::insert()
QueryRecord::insertRecord()
QueryRecord::list_excluded_fields()
QueryRecord::to_array()
QueryRecord::update()
QueryRecord::updateRecord()
QueryRecord::__get()
QueryRecord::__isset()
QueryRecord::__set()
Class Constants
RULE_CUSTOM = 5 (line 16)
RULE_PLUGIN = 2 (line 15)
RULE_SYSTEM = 0 (line 13)
RULE_THEME = 1 (line 14)

Documentation generated on Thu, 30 Oct 2008 20:31:25 +0100 by phpDocumentor 1.3.2