Permalink
Browse files

Rename classes

  • Loading branch information...
1 parent 5328534 commit 84177051078bfc9db4577b0501595b7bae06732b @CloCkWeRX CloCkWeRX committed May 19, 2012
@@ -1,10 +0,0 @@
-<?php
-require_once 'HTML/BBCodeParser.php';
-
-/**
-* Dummy class that filters need to extend from.
-*/
-class HTML_BBCodeParser_Filter extends HTML_BBCodeParser
-{
-}
-?>
@@ -1,7 +1,7 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
-// | PHP Version 4 |
+// | PHP Version 5 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
@@ -20,7 +20,7 @@
//
/**
-* @package HTML_BBCodeParser
+* @package HTML_BBCodeParser2
* @author Stijn de Reede <sjr@gmx.co.uk>
*
*
@@ -34,21 +34,21 @@
*
*
* Usage:
-* $parser = new HTML_BBCodeParser();
+* $parser = new HTML_BBCodeParser2();
* $parser->setText('normal [b]bold[/b] and normal again');
* $parser->parse();
* echo $parser->getParsed();
* or:
-* $parser = new HTML_BBCodeParser();
+* $parser = new HTML_BBCodeParser2();
* echo $parser->qparse('normal [b]bold[/b] and normal again');
* or:
-* echo HTML_BBCodeParser::staticQparse('normal [b]bold[/b] and normal again');
+* echo HTML_BBCodeParser2::staticQparse('normal [b]bold[/b] and normal again');
*
*
* Setting the options from the ini file:
* $config = parse_ini_file('BBCodeParser.ini', true);
-* $options = &PEAR::getStaticProperty('HTML_BBCodeParser', '_options');
-* $options = $config['HTML_BBCodeParser'];
+* $options = &PEAR::getStaticProperty('HTML_BBCodeParser2', '_options');
+* $options = $config['HTML_BBCodeParser2'];
* unset($options);
*
*
@@ -80,7 +80,7 @@
*/
require_once 'PEAR.php';
-class HTML_BBCodeParser
+class HTML_BBCodeParser2
{
/**
* An array of tags parsed by the engine, should be overwritten by filters
@@ -163,11 +163,11 @@ class HTML_BBCodeParser
* @access public
* @author Stijn de Reede <sjr@gmx.co.uk>
*/
- function HTML_BBCodeParser($options = array())
+ function __construct($options = array())
{
$pear=new PEAR();
// set the already set options
- $baseoptions = $pear->getStaticProperty('HTML_BBCodeParser', '_options');
+ $baseoptions = $pear->getStaticProperty('HTML_BBCodeParser2', '_options');
if (is_array($baseoptions)) {
foreach ($baseoptions as $k => $v) {
$this->_options[$k] = $v;
@@ -197,7 +197,7 @@ function HTML_BBCodeParser($options = array())
unset($baseoptions);
// return if this is a subclass
- if (is_subclass_of($this, 'HTML_BBCodeParser_Filter')) {
+ if (is_subclass_of($this, 'HTML_BBCodeParser2_Filter')) {
return;
}
@@ -227,8 +227,8 @@ function addFilter($filter)
{
$filter = ucfirst($filter);
if (!array_key_exists($filter, $this->_filters)) {
- $class = 'HTML_BBCodeParser_Filter_'.$filter;
- @include_once 'HTML/BBCodeParser/Filter/'.$filter.'.php';
+ $class = 'HTML_BBCodeParser2_Filter_'.$filter;
+ @include_once 'HTML/BBCodeParser2/Filter/'.$filter.'.php';
if (!class_exists($class)) {
PEAR::raiseError("Failed to load filter $filter", null, PEAR_ERROR_DIE);
}
@@ -314,7 +314,7 @@ function _preparse()
$this->_preparsed = $this->_text;
// return if this is a subclass
- if (is_subclass_of($this, 'HTML_BBCodeParser')) {
+ if (is_subclass_of($this, 'HTML_BBCodeParser2')) {
return;
}
@@ -874,7 +874,7 @@ function qparse($str)
*/
function staticQparse($str)
{
- $p = new HTML_BBCodeParser();
+ $p = new HTML_BBCodeParser2();
$str = $p->qparse($str);
unset($p);
return $str;
@@ -0,0 +1,9 @@
+<?php
+require_once 'HTML/BBCodeParser2.php';
+
+/**
+* Dummy class that filters need to extend from.
+*/
+class HTML_BBCodeParser2_Filter extends HTML_BBCodeParser2
+{
+}
@@ -1,7 +1,7 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
-// | PHP Version 4 |
+// | PHP Version 5 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
@@ -20,17 +20,17 @@
//
/**
-* @package HTML_BBCodeParser
+* @package HTML_BBCodeParser2
* @author Stijn de Reede <sjr@gmx.co.uk>
*/
-require_once 'HTML/BBCodeParser/Filter.php';
+require_once 'HTML/BBCodeParser2/Filter.php';
-class HTML_BBCodeParser_Filter_Basic extends HTML_BBCodeParser_Filter
+class HTML_BBCodeParser2_Filter_Basic extends HTML_BBCodeParser2_Filter
{
/**
@@ -66,6 +66,3 @@ class HTML_BBCodeParser_Filter_Basic extends HTML_BBCodeParser_Filter
);
}
-
-
-?>
@@ -1,7 +1,7 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
-// | PHP Version 4 |
+// | PHP Version 5 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
@@ -20,17 +20,17 @@
//
/**
-* @package HTML_BBCodeParser
+* @package HTML_BBCodeParser2
* @author Stijn de Reede <sjr@gmx.co.uk>
*/
-require_once 'HTML/BBCodeParser/Filter.php';
+require_once 'HTML/BBCodeParser2/Filter.php';
-class HTML_BBCodeParser_Filter_Email extends HTML_BBCodeParser_Filter
+class HTML_BBCodeParser2_Filter_Email extends HTML_BBCodeParser2_Filter
{
/**
@@ -66,8 +66,8 @@ class HTML_BBCodeParser_Filter_Email extends HTML_BBCodeParser_Filter
*/
function _preparse()
{
- $pear=new PEAR();
- $options = $pear->getStaticProperty('HTML_BBCodeParser','_options');
+ $pear = new PEAR();
+ $options = $pear->getStaticProperty('HTML_BBCodeParser2','_options');
$o = $options['open'];
$c = $options['close'];
$oe = $options['open_esc'];
@@ -81,6 +81,3 @@ function _preparse()
}
-
-
-?>
@@ -1,7 +1,7 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
-// | PHP Version 4 |
+// | PHP Version 5 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
@@ -20,17 +20,17 @@
//
/**
-* @package HTML_BBCodeParser
+* @package HTML_BBCodeParser2
* @author Stijn de Reede <sjr@gmx.co.uk>
*/
-require_once 'HTML/BBCodeParser/Filter.php';
+require_once 'HTML/BBCodeParser2/Filter.php';
-class HTML_BBCodeParser_Filter_Extended extends HTML_BBCodeParser_Filter
+class HTML_BBCodeParser2_Filter_Extended extends HTML_BBCodeParser2_Filter
{
/**
@@ -93,5 +93,3 @@ class HTML_BBCodeParser_Filter_Extended extends HTML_BBCodeParser_Filter
}
-
-?>
@@ -1,7 +1,7 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
-// | PHP Version 4 |
+// | PHP Version 5 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
@@ -23,9 +23,9 @@
* @package HTML_BBCodeParser
* @author Stijn de Reede <sjr@gmx.co.uk>
*/
-require_once 'HTML/BBCodeParser/Filter.php';
+require_once 'HTML/BBCodeParser2/Filter.php';
-class HTML_BBCodeParser_Filter_Images extends HTML_BBCodeParser_Filter
+class HTML_BBCodeParser2_Filter_Images extends HTML_BBCodeParser2_Filter
{
/**
@@ -66,7 +66,7 @@ class HTML_BBCodeParser_Filter_Images extends HTML_BBCodeParser_Filter
*/
function _preparse()
{
- $options = PEAR::getStaticProperty('HTML_BBCodeParser','_options');
+ $options = PEAR::getStaticProperty('HTML_BBCodeParser2','_options');
$o = $options['open'];
$c = $options['close'];
$oe = $options['open_esc'];
@@ -1,7 +1,7 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
-// | PHP Version 4 |
+// | PHP Version 5 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
@@ -20,15 +20,15 @@
//
/**
-* @package HTML_BBCodeParser
+* @package HTML_BBCodeParser2
* @author Stijn de Reede <sjr@gmx.co.uk>
*/
-require_once 'HTML/BBCodeParser/Filter.php';
+require_once 'HTML/BBCodeParser2/Filter.php';
/**
*
*/
-class HTML_BBCodeParser_Filter_Links extends HTML_BBCodeParser_Filter
+class HTML_BBCodeParser2_Filter_Links extends HTML_BBCodeParser2_Filter
{
/**
* List of allowed schemes
@@ -82,7 +82,7 @@ class HTML_BBCodeParser_Filter_Links extends HTML_BBCodeParser_Filter
*/
function _preparse()
{
- $options = PEAR::getStaticProperty('HTML_BBCodeParser', '_options');
+ $options = PEAR::getStaticProperty('HTML_BBCodeParser2', '_options');
$o = $options['open'];
$c = $options['close'];
$oe = $options['open_esc'];
@@ -111,7 +111,7 @@ function _preparse()
function smarterPPLinkExpand($matches)
{
//echo '<hr><pre>';var_dump($matches);echo '</pre><hr>';
- $options = PEAR::getStaticProperty('HTML_BBCodeParser','_options');
+ $options = PEAR::getStaticProperty('HTML_BBCodeParser2','_options');
$o = $options['open'];
$c = $options['close'];
$oe = $options['open_esc'];
@@ -169,7 +169,7 @@ function smarterPPLinkExpand($matches)
*/
function smarterPPLink($matches)
{
- $options = PEAR::getStaticProperty('HTML_BBCodeParser','_options');
+ $options = PEAR::getStaticProperty('HTML_BBCodeParser2','_options');
$o = $options['open'];
$c = $options['close'];
@@ -1,7 +1,7 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
-// | PHP Version 4 |
+// | PHP Version 5 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
@@ -21,16 +21,16 @@
/**
-* @package HTML_BBCodeParser
+* @package HTML_BBCodeParser2
* @author Stijn de Reede <sjr@gmx.co.uk>
*/
-require_once 'HTML/BBCodeParser/Filter.php';
+require_once 'HTML/BBCodeParser2/Filter.php';
/**
*
*/
-class HTML_BBCodeParser_Filter_Lists extends HTML_BBCodeParser_Filter
+class HTML_BBCodeParser2_Filter_Lists extends HTML_BBCodeParser2_Filter
{
/**
@@ -78,7 +78,7 @@ class HTML_BBCodeParser_Filter_Lists extends HTML_BBCodeParser_Filter
*/
function _preparse()
{
- $options = PEAR::getStaticProperty('HTML_BBCodeParser','_options');
+ $options = PEAR::getStaticProperty('HTML_BBCodeParser2','_options');
$o = $options['open'];
$c = $options['close'];
$oe = $options['open_esc'];
@@ -102,7 +102,4 @@ function _preparse()
$this->_preparsed = preg_replace($pattern, $replace, $this->_text);
}
-}
-
-
-?>
+}
View
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.9.4" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
- <name>HTML_BBCodeParser</name>
+ <name>HTML_BBCodeParser2</name>
<channel>pear.php.net</channel>
<summary>This is a parser to replace UBB style tags with their html equivalents.</summary>
<description>This is a parser to replace UBB style tags with their html equivalents.

0 comments on commit 8417705

Please sign in to comment.