summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-05-16 11:54:32 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-05-16 11:54:32 +0200
commitdd0d7a4198ffaf4061d322de53ecd9a34eac3500 (patch)
tree9883d43081d67b8886c7076effa313cfec9ff7c0 /inc
parentbff1a21bd9a53ef56d9603457bbb3b6178564791 (diff)
parent79eec18f7ad9126ba147cd13eb2a8d6ee41bf140 (diff)
downloadrpg-dd0d7a4198ffaf4061d322de53ecd9a34eac3500.tar.gz
rpg-dd0d7a4198ffaf4061d322de53ecd9a34eac3500.tar.bz2
Merge pull request #1154 from splitbrain/php7compatibility
Php7compatibility
Diffstat (limited to 'inc')
-rw-r--r--inc/IXR_Library.php20
-rw-r--r--inc/JSON.php2
-rw-r--r--inc/JpegMeta.php2
-rw-r--r--inc/cache.php10
-rw-r--r--inc/events.php4
-rw-r--r--inc/form.php2
-rw-r--r--inc/parser/handler.php48
-rw-r--r--inc/parser/lexer.php8
-rw-r--r--inc/parser/parser.php32
-rw-r--r--inc/phpseclib/Crypt_AES.php4
-rw-r--r--inc/phpseclib/Crypt_Base.php2
-rw-r--r--inc/phpseclib/Crypt_Hash.php2
-rw-r--r--inc/phpseclib/Crypt_Rijndael.php4
13 files changed, 73 insertions, 67 deletions
diff --git a/inc/IXR_Library.php b/inc/IXR_Library.php
index 839298680..301a8d9e1 100644
--- a/inc/IXR_Library.php
+++ b/inc/IXR_Library.php
@@ -52,7 +52,7 @@ class IXR_Value {
* @param mixed $data
* @param bool $type
*/
- function IXR_Value($data, $type = false) {
+ function __construct($data, $type = false) {
$this->data = $data;
if(!$type) {
$type = $this->calculateType();
@@ -201,7 +201,7 @@ class IXR_Message {
/**
* @param string $message
*/
- function IXR_Message($message) {
+ function __construct($message) {
$this->message =& $message;
}
@@ -388,7 +388,7 @@ class IXR_Server {
* @param bool $data
* @param bool $wait
*/
- function IXR_Server($callbacks = false, $data = false, $wait = false) {
+ function __construct($callbacks = false, $data = false, $wait = false) {
$this->setCapabilities();
if($callbacks) {
$this->callbacks = $callbacks;
@@ -621,7 +621,7 @@ class IXR_Request {
* @param string $method
* @param array $args
*/
- function IXR_Request($method, $args) {
+ function __construct($method, $args) {
$this->method = $method;
$this->args = $args;
$this->xml = <<<EOD
@@ -684,7 +684,7 @@ class IXR_Client extends DokuHTTPClient {
* @param int $port
* @param int $timeout
*/
- function IXR_Client($server, $path = false, $port = 80, $timeout = 15) {
+ function __construct($server, $path = false, $port = 80, $timeout = 15) {
parent::__construct();
if(!$path) {
// Assume we have been given a URL instead
@@ -779,7 +779,7 @@ class IXR_Error {
* @param int $code
* @param string $message
*/
- function IXR_Error($code, $message) {
+ function __construct($code, $message) {
$this->code = $code;
$this->message = htmlspecialchars($message);
}
@@ -829,7 +829,7 @@ class IXR_Date {
/**
* @param int|string $time
*/
- function IXR_Date($time) {
+ function __construct($time) {
// $time can be a PHP timestamp or an ISO one
if(is_numeric($time)) {
$this->parseTimestamp($time);
@@ -899,7 +899,7 @@ class IXR_Base64 {
/**
* @param string $data
*/
- function IXR_Base64($data) {
+ function __construct($data) {
$this->data = $data;
}
@@ -923,7 +923,7 @@ class IXR_IntrospectionServer extends IXR_Server {
/** @var string[] */
var $help;
- function IXR_IntrospectionServer() {
+ function __construct() {
$this->setCallbacks();
$this->setCapabilities();
$this->capabilities['introspection'] = array(
@@ -1106,7 +1106,7 @@ class IXR_ClientMulticall extends IXR_Client {
* @param string|bool $path
* @param int $port
*/
- function IXR_ClientMulticall($server, $path = false, $port = 80) {
+ function __construct($server, $path = false, $port = 80) {
parent::IXR_Client($server, $path, $port);
//$this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)';
}
diff --git a/inc/JSON.php b/inc/JSON.php
index 7f89005ff..e01488e14 100644
--- a/inc/JSON.php
+++ b/inc/JSON.php
@@ -119,7 +119,7 @@ class JSON {
* JSON_LOOSE_TYPE - loose typing
* "{...}" syntax creates associative arrays in decode.
*/
- function JSON($use=JSON_STRICT_TYPE) {
+ function __construct($use=JSON_STRICT_TYPE) {
$this->use = $use;
}
diff --git a/inc/JpegMeta.php b/inc/JpegMeta.php
index cd082cbba..1fa4f25ce 100644
--- a/inc/JpegMeta.php
+++ b/inc/JpegMeta.php
@@ -54,7 +54,7 @@ class JpegMeta {
*
* @author Sebastian Delmont <sdelmont@zonageek.com>
*/
- function JpegMeta($fileName) {
+ function __construct($fileName) {
$this->_fileName = $fileName;
diff --git a/inc/cache.php b/inc/cache.php
index 68f64eaa2..9375dc86b 100644
--- a/inc/cache.php
+++ b/inc/cache.php
@@ -26,7 +26,7 @@ class cache {
* @param string $key primary identifier
* @param string $ext file extension
*/
- public function cache($key,$ext) {
+ public function __construct($key,$ext) {
$this->key = $key;
$this->ext = $ext;
$this->cache = getCacheName($key,$ext);
@@ -188,12 +188,12 @@ class cache_parser extends cache {
* @param string $file source file for cache
* @param string $mode input mode
*/
- public function cache_parser($id, $file, $mode) {
+ public function __construct($id, $file, $mode) {
if ($id) $this->page = $id;
$this->file = $file;
$this->mode = $mode;
- parent::cache($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.'.$mode);
+ parent::__construct($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.'.$mode);
}
/**
@@ -308,8 +308,8 @@ class cache_instructions extends cache_parser {
* @param string $id page id
* @param string $file source file for cache
*/
- public function cache_instructions($id, $file) {
- parent::cache_parser($id, $file, 'i');
+ public function __construct($id, $file) {
+ parent::__construct($id, $file, 'i');
}
/**
diff --git a/inc/events.php b/inc/events.php
index 256fb561e..35d55d0e3 100644
--- a/inc/events.php
+++ b/inc/events.php
@@ -31,7 +31,7 @@ class Doku_Event {
* @param string $name
* @param mixed $data
*/
- function Doku_Event($name, &$data) {
+ function __construct($name, &$data) {
$this->name = $name;
$this->data =& $data;
@@ -153,7 +153,7 @@ class Doku_Event_Handler {
* constructor, loads all action plugins and calls their register() method giving them
* an opportunity to register any hooks they require
*/
- function Doku_Event_Handler() {
+ function __construct() {
// load action plugins
/** @var DokuWiki_Action_Plugin $plugin */
diff --git a/inc/form.php b/inc/form.php
index 00eea9b3a..748983281 100644
--- a/inc/form.php
+++ b/inc/form.php
@@ -55,7 +55,7 @@ class Doku_Form {
*
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
- function Doku_Form($params, $action=false, $method=false, $enctype=false) {
+ function __construct($params, $action=false, $method=false, $enctype=false) {
if(!is_array($params)) {
$this->params = array('id' => $params);
if ($action !== false) $this->params['action'] = $action;
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index b8e2de82a..815ac39c5 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -17,7 +17,7 @@ class Doku_Handler {
var $rewriteBlocks = true;
- function Doku_Handler() {
+ function __construct() {
$this->CallWriter = new Doku_Handler_CallWriter($this);
}
@@ -295,7 +295,7 @@ class Doku_Handler {
switch ( $state ) {
case DOKU_LEXER_ENTER:
$ReWriter = new Doku_Handler_Preformatted($this->CallWriter);
- $this->CallWriter = & $ReWriter;
+ $this->CallWriter = $ReWriter;
$this->_addCall('preformatted_start',array(), $pos);
break;
case DOKU_LEXER_EXIT:
@@ -715,15 +715,21 @@ function Doku_Handler_Parse_Media($match) {
}
//------------------------------------------------------------------------
-class Doku_Handler_CallWriter {
+interface Doku_Handler_CallWriter_Interface {
+ public function writeCall($call);
+ public function writeCalls($calls);
+ public function finalise();
+}
+
+class Doku_Handler_CallWriter implements Doku_Handler_CallWriter_Interface {
var $Handler;
/**
* @param Doku_Handler $Handler
*/
- function Doku_Handler_CallWriter(& $Handler) {
- $this->Handler = & $Handler;
+ function __construct(Doku_Handler $Handler) {
+ $this->Handler = $Handler;
}
function writeCall($call) {
@@ -748,7 +754,7 @@ class Doku_Handler_CallWriter {
*
* @author Chris Smith <chris@jalakai.co.uk>
*/
-class Doku_Handler_Nest {
+class Doku_Handler_Nest implements Doku_Handler_CallWriter_Interface {
var $CallWriter;
var $calls = array();
@@ -762,8 +768,8 @@ class Doku_Handler_Nest {
* @param string $close closing instruction name, this is required to properly terminate the
* syntax mode if the document ends without a closing pattern
*/
- function Doku_Handler_Nest(& $CallWriter, $close="nest_close") {
- $this->CallWriter = & $CallWriter;
+ function __construct(Doku_Handler_CallWriter_Interface $CallWriter, $close="nest_close") {
+ $this->CallWriter = $CallWriter;
$this->closingInstruction = $close;
}
@@ -808,7 +814,7 @@ class Doku_Handler_Nest {
}
}
-class Doku_Handler_List {
+class Doku_Handler_List implements Doku_Handler_CallWriter_Interface {
var $CallWriter;
@@ -818,8 +824,8 @@ class Doku_Handler_List {
const NODE = 1;
- function Doku_Handler_List(& $CallWriter) {
- $this->CallWriter = & $CallWriter;
+ function __construct(Doku_Handler_CallWriter_Interface $CallWriter) {
+ $this->CallWriter = $CallWriter;
}
function writeCall($call) {
@@ -1018,7 +1024,7 @@ class Doku_Handler_List {
}
//------------------------------------------------------------------------
-class Doku_Handler_Preformatted {
+class Doku_Handler_Preformatted implements Doku_Handler_CallWriter_Interface {
var $CallWriter;
@@ -1028,8 +1034,8 @@ class Doku_Handler_Preformatted {
- function Doku_Handler_Preformatted(& $CallWriter) {
- $this->CallWriter = & $CallWriter;
+ function __construct(Doku_Handler_CallWriter_Interface $CallWriter) {
+ $this->CallWriter = $CallWriter;
}
function writeCall($call) {
@@ -1078,7 +1084,7 @@ class Doku_Handler_Preformatted {
}
//------------------------------------------------------------------------
-class Doku_Handler_Quote {
+class Doku_Handler_Quote implements Doku_Handler_CallWriter_Interface {
var $CallWriter;
@@ -1086,8 +1092,8 @@ class Doku_Handler_Quote {
var $quoteCalls = array();
- function Doku_Handler_Quote(& $CallWriter) {
- $this->CallWriter = & $CallWriter;
+ function __construct(Doku_Handler_CallWriter_Interface $CallWriter) {
+ $this->CallWriter = $CallWriter;
}
function writeCall($call) {
@@ -1170,7 +1176,7 @@ class Doku_Handler_Quote {
}
//------------------------------------------------------------------------
-class Doku_Handler_Table {
+class Doku_Handler_Table implements Doku_Handler_CallWriter_Interface {
var $CallWriter;
@@ -1185,8 +1191,8 @@ class Doku_Handler_Table {
var $currentRow = array('tableheader' => 0, 'tablecell' => 0);
var $countTableHeadRows = 0;
- function Doku_Handler_Table(& $CallWriter) {
- $this->CallWriter = & $CallWriter;
+ function __construct(Doku_Handler_CallWriter_Interface $CallWriter) {
+ $this->CallWriter = $CallWriter;
}
function writeCall($call) {
@@ -1551,7 +1557,7 @@ class Doku_Handler_Block {
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
- function Doku_Handler_Block(){
+ function __construct(){
global $DOKU_PLUGINS;
//check if syntax plugins were loaded
if(empty($DOKU_PLUGINS['syntax'])) return;
diff --git a/inc/parser/lexer.php b/inc/parser/lexer.php
index b46a5f505..17aa6c170 100644
--- a/inc/parser/lexer.php
+++ b/inc/parser/lexer.php
@@ -46,7 +46,7 @@ class Doku_LexerParallelRegex {
* for insensitive.
* @access public
*/
- function Doku_LexerParallelRegex($case) {
+ function __construct($case) {
$this->_case = $case;
$this->_patterns = array();
$this->_labels = array();
@@ -232,7 +232,7 @@ class Doku_LexerStateStack {
* @param string $start Starting state name.
* @access public
*/
- function Doku_LexerStateStack($start) {
+ function __construct($start) {
$this->_stack = array($start);
}
@@ -296,11 +296,11 @@ class Doku_Lexer {
* @param boolean $case True for case sensitive.
* @access public
*/
- function Doku_Lexer(&$parser, $start = "accept", $case = false) {
+ function __construct($parser, $start = "accept", $case = false) {
$this->_case = $case;
/** @var Doku_LexerParallelRegex[] _regexes */
$this->_regexes = array();
- $this->_parser = &$parser;
+ $this->_parser = $parser;
$this->_mode = new Doku_LexerStateStack($start);
$this->_mode_handlers = array();
}
diff --git a/inc/parser/parser.php b/inc/parser/parser.php
index 5f86cf5c4..7814e94f6 100644
--- a/inc/parser/parser.php
+++ b/inc/parser/parser.php
@@ -64,24 +64,24 @@ class Doku_Parser {
/**
* @param Doku_Parser_Mode_base $BaseMode
*/
- function addBaseMode(& $BaseMode) {
- $this->modes['base'] =& $BaseMode;
+ function addBaseMode($BaseMode) {
+ $this->modes['base'] = $BaseMode;
if ( !$this->Lexer ) {
$this->Lexer = new Doku_Lexer($this->Handler,'base', true);
}
- $this->modes['base']->Lexer =& $this->Lexer;
+ $this->modes['base']->Lexer = $this->Lexer;
}
/**
* PHP preserves order of associative elements
* Mode sequence is important
*/
- function addMode($name, & $Mode) {
+ function addMode($name, Doku_Parser_Mode_Interface $Mode) {
if ( !isset($this->modes['base']) ) {
$this->addBaseMode(new Doku_Parser_Mode_base());
}
- $Mode->Lexer = & $this->Lexer;
- $this->modes[$name] =& $Mode;
+ $Mode->Lexer = $this->Lexer;
+ $this->modes[$name] = $Mode;
}
function connectModes() {
@@ -226,7 +226,7 @@ class Doku_Parser_Mode_Plugin extends DokuWiki_Plugin implements Doku_Parser_Mod
//-------------------------------------------------------------------
class Doku_Parser_Mode_base extends Doku_Parser_Mode {
- function Doku_Parser_Mode_base() {
+ function __construct() {
global $PARSER_MODES;
$this->allowedModes = array_merge (
@@ -248,7 +248,7 @@ class Doku_Parser_Mode_base extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_footnote extends Doku_Parser_Mode {
- function Doku_Parser_Mode_footnote() {
+ function __construct() {
global $PARSER_MODES;
$this->allowedModes = array_merge (
@@ -416,7 +416,7 @@ class Doku_Parser_Mode_formatting extends Doku_Parser_Mode {
/**
* @param string $type
*/
- function Doku_Parser_Mode_formatting($type) {
+ function __construct($type) {
global $PARSER_MODES;
if ( !array_key_exists($type, $this->formatting) ) {
@@ -470,7 +470,7 @@ class Doku_Parser_Mode_formatting extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_listblock extends Doku_Parser_Mode {
- function Doku_Parser_Mode_listblock() {
+ function __construct() {
global $PARSER_MODES;
$this->allowedModes = array_merge (
@@ -504,7 +504,7 @@ class Doku_Parser_Mode_listblock extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_table extends Doku_Parser_Mode {
- function Doku_Parser_Mode_table() {
+ function __construct() {
global $PARSER_MODES;
$this->allowedModes = array_merge (
@@ -648,7 +648,7 @@ class Doku_Parser_Mode_file extends Doku_Parser_Mode {
//-------------------------------------------------------------------
class Doku_Parser_Mode_quote extends Doku_Parser_Mode {
- function Doku_Parser_Mode_quote() {
+ function __construct() {
global $PARSER_MODES;
$this->allowedModes = array_merge (
@@ -682,7 +682,7 @@ class Doku_Parser_Mode_acronym extends Doku_Parser_Mode {
var $acronyms = array();
var $pattern = '';
- function Doku_Parser_Mode_acronym($acronyms) {
+ function __construct($acronyms) {
usort($acronyms,array($this,'_compare'));
$this->acronyms = $acronyms;
}
@@ -729,7 +729,7 @@ class Doku_Parser_Mode_smiley extends Doku_Parser_Mode {
var $smileys = array();
var $pattern = '';
- function Doku_Parser_Mode_smiley($smileys) {
+ function __construct($smileys) {
$this->smileys = $smileys;
}
@@ -762,7 +762,7 @@ class Doku_Parser_Mode_wordblock extends Doku_Parser_Mode {
var $badwords = array();
var $pattern = '';
- function Doku_Parser_Mode_wordblock($badwords) {
+ function __construct($badwords) {
$this->badwords = $badwords;
}
@@ -797,7 +797,7 @@ class Doku_Parser_Mode_entity extends Doku_Parser_Mode {
var $entities = array();
var $pattern = '';
- function Doku_Parser_Mode_entity($entities) {
+ function __construct($entities) {
$this->entities = $entities;
}
diff --git a/inc/phpseclib/Crypt_AES.php b/inc/phpseclib/Crypt_AES.php
index 81fa2feab..f2df78351 100644
--- a/inc/phpseclib/Crypt_AES.php
+++ b/inc/phpseclib/Crypt_AES.php
@@ -164,9 +164,9 @@ class Crypt_AES extends Crypt_Rijndael {
* @param optional Integer $mode
* @access public
*/
- function Crypt_AES($mode = CRYPT_AES_MODE_CBC)
+ function __construct($mode = CRYPT_AES_MODE_CBC)
{
- parent::Crypt_Rijndael($mode);
+ parent::__construct($mode);
}
/**
diff --git a/inc/phpseclib/Crypt_Base.php b/inc/phpseclib/Crypt_Base.php
index 7c650ca72..4fb9990c7 100644
--- a/inc/phpseclib/Crypt_Base.php
+++ b/inc/phpseclib/Crypt_Base.php
@@ -445,7 +445,7 @@ class Crypt_Base {
* @param optional Integer $mode
* @access public
*/
- function Crypt_Base($mode = CRYPT_MODE_CBC)
+ function __construct($mode = CRYPT_MODE_CBC)
{
$const_crypt_mode = 'CRYPT_' . $this->const_namespace . '_MODE';
diff --git a/inc/phpseclib/Crypt_Hash.php b/inc/phpseclib/Crypt_Hash.php
index 840fcd508..61825d3c3 100644
--- a/inc/phpseclib/Crypt_Hash.php
+++ b/inc/phpseclib/Crypt_Hash.php
@@ -143,7 +143,7 @@ class Crypt_Hash {
* @return Crypt_Hash
* @access public
*/
- function Crypt_Hash($hash = 'sha1')
+ function __construct($hash = 'sha1')
{
if ( !defined('CRYPT_HASH_MODE') ) {
switch (true) {
diff --git a/inc/phpseclib/Crypt_Rijndael.php b/inc/phpseclib/Crypt_Rijndael.php
index c63e0ff7e..33f42da17 100644
--- a/inc/phpseclib/Crypt_Rijndael.php
+++ b/inc/phpseclib/Crypt_Rijndael.php
@@ -699,9 +699,9 @@ class Crypt_Rijndael extends Crypt_Base {
* @param optional Integer $mode
* @access public
*/
- function Crypt_Rijndael($mode = CRYPT_RIJNDAEL_MODE_CBC)
+ function __construct($mode = CRYPT_RIJNDAEL_MODE_CBC)
{
- parent::Crypt_Base($mode);
+ parent::__construct($mode);
}
/**