1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-05 05:37:49 +02:00

Convert to PHP 5 only codebase, adding visibility modifiers to all members and methods in the main library area (function only for test methods)

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1458 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-11-25 02:24:39 +00:00
parent 85a23bacb6
commit 43f01925cd
195 changed files with 1003 additions and 1064 deletions

View File

@@ -10,16 +10,15 @@ class HTMLPurifier_Context
/**
* Private array that stores the references.
* @private
*/
var $_storage = array();
private $_storage = array();
/**
* Registers a variable into the context.
* @param $name String name
* @param $ref Variable to be registered
*/
function register($name, &$ref) {
public function register($name, &$ref) {
if (isset($this->_storage[$name])) {
trigger_error("Name $name produces collision, cannot re-register",
E_USER_ERROR);
@@ -33,7 +32,7 @@ class HTMLPurifier_Context
* @param $name String name
* @param $ignore_error Boolean whether or not to ignore error
*/
function &get($name, $ignore_error = false) {
public function &get($name, $ignore_error = false) {
if (!isset($this->_storage[$name])) {
if (!$ignore_error) {
trigger_error("Attempted to retrieve non-existent variable $name",
@@ -49,7 +48,7 @@ class HTMLPurifier_Context
* Destorys a variable in the context.
* @param $name String name
*/
function destroy($name) {
public function destroy($name) {
if (!isset($this->_storage[$name])) {
trigger_error("Attempted to destroy non-existent variable $name",
E_USER_ERROR);
@@ -62,7 +61,7 @@ class HTMLPurifier_Context
* Checks whether or not the variable exists.
* @param $name String name
*/
function exists($name) {
public function exists($name) {
return isset($this->_storage[$name]);
}
@@ -70,7 +69,7 @@ class HTMLPurifier_Context
* Loads a series of variables from an associative array
* @param $context_array Assoc array of variables to load
*/
function loadArray(&$context_array) {
public function loadArray(&$context_array) {
foreach ($context_array as $key => $discard) {
$this->register($key, $context_array[$key]);
}