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

Class: Text_Wiki_Parse_Url

Source Location: /Text_Wiki_Mediawiki-0.2.0/Text/Wiki/Parse/Mediawiki/Url.php

Class Overview

Text_Wiki_Parse
   |
   --Text_Wiki_Parse_Url

Parse for URLS in the source text.


Author(s):

Version:

  • Release: @package_version@

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 51]
Parse for URLS in the source text.

Various URL markings are supported: inline (the URL by itself), inline (where the URL is enclosed in square brackets), and named reference (where the URL is enclosed in square brackets and has a name included inside the brackets). E.g.:

inline -- http://example.com undescribed -- [http://example.com] described -- [http://example.com Example Description] described -- [http://www.example.com|Example Description]

When rendering a URL token, this will convert URLs pointing to a .gif, .jpg, or .png image into an inline <img /> tag (for the 'xhtml' format).

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



[ Top ]


Class Variables

$conf = array(
        'schemes' => array(
            'http://',
            'https://',
            'ftp://',
            'gopher://',
            'news://',
            'file://',
            'mailto:'
        ))

[line 68]

URL schemes recognized by this rule.
  • Access: public

Type:   array


[ Top ]

$footnoteCount =  0

[line 59]

Keeps a running count of numbered-reference URLs.
  • Access: public

Type:   int


[ Top ]



Method Detail

Text_Wiki_Parse_Url (Constructor)   [line 88]

Text_Wiki_Parse_Url Text_Wiki_Parse_Url( &$obj)

Constructor.

We override the constructor so we can comment the regex nicely.

  • Access: public

Parameters:

   &$obj   — 

[ Top ]

parse   [line 117]

void parse( )

Find three different kinds of URLs in the source text.
  • Access: public

[ Top ]

process   [line 202]

string process( array &$matches, array $matches)

Process inline URLs.
  • Return: The processed text replacement.

Parameters:

array   &$matches   — 
array   $matches   —  An array of matches from the parse() method as generated by preg_replace_callback. $matches[0] is the full matched string, $matches[1] is the first matched pattern, $matches[2] is the second matched pattern, and so on.

[ Top ]

processDescr   [line 305]

string processDescr( array &$matches, array $matches)

Process described-reference (named-reference) URLs.

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: The processed text replacement.

Parameters:

array   &$matches   — 
array   $matches   —  An array of matches from the parse() method as generated by preg_replace_callback. $matches[0] is the full matched string, $matches[1] is the first matched pattern, $matches[2] is the second matched pattern, and so on.

[ Top ]

processFootnote   [line 255]

string processFootnote( array &$matches, array $matches)

Process numbered (footnote) URLs.

Token options are:

  • Return: The processed text replacement.

Parameters:

array   &$matches   — 
array   $matches   —  An array of matches from the parse() method as generated by preg_replace_callback. $matches[0] is the full matched string, $matches[1] is the first matched pattern, $matches[2] is the second matched pattern, and so on.

[ Top ]

processInlineEmail   [line 230]

void processInlineEmail( &$matches)


Parameters:

   &$matches   — 

[ Top ]

processOrdinary   [line 271]

void processOrdinary( &$matches)


Parameters:

   &$matches   — 

[ Top ]

processWithoutProtocol   [line 216]

void processWithoutProtocol( &$matches)


Parameters:

   &$matches   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:32:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.