Text_Wiki
[ class tree: Text_Wiki ] [ index: Text_Wiki ] [ all elements ]

Class: Text_Wiki_Parse_Url

Source Location: /Text_Wiki_BBCode-0.0.4/Text/Wiki/Parse/BBCode/Url.php

Class Overview

Text_Wiki_Parse
   |
   --Text_Wiki_Parse_Url

Url rule parser class for BBCode.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005 bertrand Gugger

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 34]
Url rule parser class for BBCode.


[ Top ]


Class Variables

$conf = array(
        'schemes' => '[a-z][-+.a-z0-9]*',  // can be also as array('htpp', 'htpps', 'ftp')
        'refused' => array('script', 'about', 'applet', 'activex', 'chrome'),'prefixes'=>array('www','ftp'),'host_regexp'=>'(?:[^.\s/"\'<\\\#delim#\ca-\cz]+\.)*[a-z](?:[-a-z0-9]*[a-z0-9])?\.?','path_regexp'=>'(?:/[^][\'\s"<\\\#delim#\ca-\cz]*)?','user_regexp'=>'[^]()<>[:;@\,."\s\\\#delim#\ca-\cz]+(?:\.[^]()<>[:;@\,."\s\\\#delim#\ca-\cz]+)*','inline_enable'=>true,'relative_enable'=>false)

[line 50]

Configuration keys for this rule

'schemes' => URL scheme(s) (array) recognized by this rule, default is the single rfc2396 pattern That is some (array of) regex string(s), must be safe with a pattern delim '#' 'refused' => which schemes are refused (usefull if 'schemes' is not an exhaustive list as by default 'prefixes' => which prefixes are usable for "lazy" url as www.xxxx.yyyy... (defaulted to http://...) 'host_regexp' => the regexp used to match the host part of url (after 'scheme://') 'path_regexp' => the regexp used to match the rest of url (starting with '/' included) 'user_regexp' => the regexp used to match user name in email 'inline_enable' => are inline urls and emails enabled (default true)

  • Var: 'config-key' => mixed config-value
  • Access: public

Type:   array


[ Top ]

$regex = array(
            '#\[url(?:(=)|])(#url#)(?(1)](.*?))\[/url]#mi',
            '#([\n\r\s#delim#])(#url#)#i',
            '#\[(email)(?:(=)|])(#email#)(?(2)](.*?))\[/email]#mi',
            '#([\n\r\s#delim#](mailto:)?)(#email#)#i',
        )

[line 69]

The regular expressions used to parse the source text and find matches conforming to this rule. Used by the parse() method.
  • See: parse()
  • Access: public

Type:   string


[ Top ]



Method Detail

Text_Wiki_Parse_Url (Constructor)   [line 84]

The Text_Wiki_Parse_Url( object &$obj)

Constructor.

We override the constructor to build up the regex from config

  • Return: parser object
  • Access: public

Parameters:

object   &$obj   —  the base conversion handler

[ Top ]

process   [line 133]

string process( array &$matches)

Generates a replacement for the matched text. Token options are:

'type' => ['inline'|'footnote'|'descr'] the type of URL 'href' => the URL link href portion 'text' => the displayed text of the URL link

  • Return: Delimited token representing the url
  • Access: public

Parameters:

array   &$matches   —  The array of matches from parse().

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:50:57 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.