mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/15849] Stop using php4 constructors
PHPBB3-15849
This commit is contained in:
parent
ae6c3b0d34
commit
b148bb5d70
25 changed files with 64 additions and 64 deletions
|
@ -33,7 +33,7 @@ class build_package
|
||||||
var $status_begun = false;
|
var $status_begun = false;
|
||||||
var $num_dots = 0;
|
var $num_dots = 0;
|
||||||
|
|
||||||
function build_package($versions, $verbose = false)
|
function __construct($versions, $verbose = false)
|
||||||
{
|
{
|
||||||
$this->versions = $versions;
|
$this->versions = $versions;
|
||||||
$this->verbose = $verbose;
|
$this->verbose = $verbose;
|
||||||
|
|
|
@ -24,7 +24,7 @@ class acp_inactive
|
||||||
var $u_action;
|
var $u_action;
|
||||||
var $p_master;
|
var $p_master;
|
||||||
|
|
||||||
function acp_inactive(&$p_master)
|
function __construct(&$p_master)
|
||||||
{
|
{
|
||||||
$this->p_master = &$p_master;
|
$this->p_master = &$p_master;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ class acp_users
|
||||||
var $u_action;
|
var $u_action;
|
||||||
var $p_master;
|
var $p_master;
|
||||||
|
|
||||||
function acp_users(&$p_master)
|
function __construct(&$p_master)
|
||||||
{
|
{
|
||||||
$this->p_master = &$p_master;
|
$this->p_master = &$p_master;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||||
/**
|
/**
|
||||||
* Init auth settings
|
* Init auth settings
|
||||||
*/
|
*/
|
||||||
function auth_admin()
|
function __construct()
|
||||||
{
|
{
|
||||||
global $db, $cache;
|
global $db, $cache;
|
||||||
|
|
||||||
|
@ -819,7 +819,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||||
|
|
||||||
// Because we just changed the options and also purged the options cache, we instantly update/regenerate it for later calls to succeed.
|
// Because we just changed the options and also purged the options cache, we instantly update/regenerate it for later calls to succeed.
|
||||||
$this->acl_options = array();
|
$this->acl_options = array();
|
||||||
$this->auth_admin();
|
$this->__construct();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ class bbcode
|
||||||
* Constructor
|
* Constructor
|
||||||
* Init bbcode cache entries if bitfield is specified
|
* Init bbcode cache entries if bitfield is specified
|
||||||
*/
|
*/
|
||||||
function bbcode($bitfield = '')
|
function __construct($bitfield = '')
|
||||||
{
|
{
|
||||||
if ($bitfield)
|
if ($bitfield)
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,7 @@ class diff
|
||||||
* @param array &$to_content An array of strings.
|
* @param array &$to_content An array of strings.
|
||||||
* @param bool $preserve_cr If true, \r is replaced by a new line in the diff output
|
* @param bool $preserve_cr If true, \r is replaced by a new line in the diff output
|
||||||
*/
|
*/
|
||||||
function diff(&$from_content, &$to_content, $preserve_cr = true)
|
function __construct(&$from_content, &$to_content, $preserve_cr = true)
|
||||||
{
|
{
|
||||||
$diff_engine = new diff_engine();
|
$diff_engine = new diff_engine();
|
||||||
$this->_edits = $diff_engine->diff($from_content, $to_content, $preserve_cr);
|
$this->_edits = $diff_engine->diff($from_content, $to_content, $preserve_cr);
|
||||||
|
@ -330,14 +330,14 @@ class mapped_diff extends diff
|
||||||
* compared when computing the diff.
|
* compared when computing the diff.
|
||||||
* @param array $mapped_to_lines This array should have the same number of elements as $to_lines.
|
* @param array $mapped_to_lines This array should have the same number of elements as $to_lines.
|
||||||
*/
|
*/
|
||||||
function mapped_diff(&$from_lines, &$to_lines, &$mapped_from_lines, &$mapped_to_lines)
|
function __construct(&$from_lines, &$to_lines, &$mapped_from_lines, &$mapped_to_lines)
|
||||||
{
|
{
|
||||||
if (count($from_lines) != count($mapped_from_lines) || count($to_lines) != count($mapped_to_lines))
|
if (count($from_lines) != count($mapped_from_lines) || count($to_lines) != count($mapped_to_lines))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::diff($mapped_from_lines, $mapped_to_lines);
|
parent::__construct($mapped_from_lines, $mapped_to_lines);
|
||||||
|
|
||||||
$xi = $yi = 0;
|
$xi = $yi = 0;
|
||||||
for ($i = 0; $i < count($this->_edits); $i++)
|
for ($i = 0; $i < count($this->_edits); $i++)
|
||||||
|
@ -394,7 +394,7 @@ class diff_op
|
||||||
*/
|
*/
|
||||||
class diff_op_copy extends diff_op
|
class diff_op_copy extends diff_op
|
||||||
{
|
{
|
||||||
function diff_op_copy($orig, $final = false)
|
function __construct($orig, $final = false)
|
||||||
{
|
{
|
||||||
if (!is_array($final))
|
if (!is_array($final))
|
||||||
{
|
{
|
||||||
|
@ -419,7 +419,7 @@ class diff_op_copy extends diff_op
|
||||||
*/
|
*/
|
||||||
class diff_op_delete extends diff_op
|
class diff_op_delete extends diff_op
|
||||||
{
|
{
|
||||||
function diff_op_delete($lines)
|
function __construct($lines)
|
||||||
{
|
{
|
||||||
$this->orig = $lines;
|
$this->orig = $lines;
|
||||||
$this->final = false;
|
$this->final = false;
|
||||||
|
@ -440,7 +440,7 @@ class diff_op_delete extends diff_op
|
||||||
*/
|
*/
|
||||||
class diff_op_add extends diff_op
|
class diff_op_add extends diff_op
|
||||||
{
|
{
|
||||||
function diff_op_add($lines)
|
function __construct($lines)
|
||||||
{
|
{
|
||||||
$this->final = $lines;
|
$this->final = $lines;
|
||||||
$this->orig = false;
|
$this->orig = false;
|
||||||
|
@ -461,7 +461,7 @@ class diff_op_add extends diff_op
|
||||||
*/
|
*/
|
||||||
class diff_op_change extends diff_op
|
class diff_op_change extends diff_op
|
||||||
{
|
{
|
||||||
function diff_op_change($orig, $final)
|
function __construct($orig, $final)
|
||||||
{
|
{
|
||||||
$this->orig = $orig;
|
$this->orig = $orig;
|
||||||
$this->final = $final;
|
$this->final = $final;
|
||||||
|
@ -498,7 +498,7 @@ class diff3 extends diff
|
||||||
* @param bool $preserve_cr If true, \r\n and bare \r are replaced by a new line
|
* @param bool $preserve_cr If true, \r\n and bare \r are replaced by a new line
|
||||||
* in the diff output
|
* in the diff output
|
||||||
*/
|
*/
|
||||||
function diff3(&$orig, &$final1, &$final2, $preserve_cr = true)
|
function __construct(&$orig, &$final1, &$final2, $preserve_cr = true)
|
||||||
{
|
{
|
||||||
$diff_engine = new diff_engine();
|
$diff_engine = new diff_engine();
|
||||||
|
|
||||||
|
@ -754,7 +754,7 @@ class diff3 extends diff
|
||||||
*/
|
*/
|
||||||
class diff3_op
|
class diff3_op
|
||||||
{
|
{
|
||||||
function diff3_op($orig = false, $final1 = false, $final2 = false)
|
function __construct($orig = false, $final1 = false, $final2 = false)
|
||||||
{
|
{
|
||||||
$this->orig = $orig ? $orig : array();
|
$this->orig = $orig ? $orig : array();
|
||||||
$this->final1 = $final1 ? $final1 : array();
|
$this->final1 = $final1 ? $final1 : array();
|
||||||
|
@ -1066,7 +1066,7 @@ class diff3_op
|
||||||
*/
|
*/
|
||||||
class diff3_op_copy extends diff3_op
|
class diff3_op_copy extends diff3_op
|
||||||
{
|
{
|
||||||
function diff3_op_copy($lines = false)
|
function __construct($lines = false)
|
||||||
{
|
{
|
||||||
$this->orig = $lines ? $lines : array();
|
$this->orig = $lines ? $lines : array();
|
||||||
$this->final1 = &$this->orig;
|
$this->final1 = &$this->orig;
|
||||||
|
@ -1092,7 +1092,7 @@ class diff3_op_copy extends diff3_op
|
||||||
*/
|
*/
|
||||||
class diff3_block_builder
|
class diff3_block_builder
|
||||||
{
|
{
|
||||||
function diff3_block_builder()
|
function __construct()
|
||||||
{
|
{
|
||||||
$this->_init();
|
$this->_init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ class diff_renderer
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
function diff_renderer($params = array())
|
function __construct($params = array())
|
||||||
{
|
{
|
||||||
foreach ($params as $param => $value)
|
foreach ($params as $param => $value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -210,7 +210,7 @@ class compress_zip extends compress
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
function compress_zip($mode, $file)
|
function __construct($mode, $file)
|
||||||
{
|
{
|
||||||
global $phpbb_filesystem;
|
global $phpbb_filesystem;
|
||||||
|
|
||||||
|
@ -569,7 +569,7 @@ class compress_tar extends compress
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
function compress_tar($mode, $file, $type = '')
|
function __construct($mode, $file, $type = '')
|
||||||
{
|
{
|
||||||
global $phpbb_filesystem;
|
global $phpbb_filesystem;
|
||||||
|
|
||||||
|
|
|
@ -1672,7 +1672,7 @@ class bitfield
|
||||||
{
|
{
|
||||||
var $data;
|
var $data;
|
||||||
|
|
||||||
function bitfield($bitfield = '')
|
function __construct($bitfield = '')
|
||||||
{
|
{
|
||||||
$this->data = base64_decode($bitfield);
|
$this->data = base64_decode($bitfield);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ class messenger
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
function messenger($use_queue = true)
|
function __construct($use_queue = true)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
@ -781,7 +781,7 @@ class queue
|
||||||
/**
|
/**
|
||||||
* constructor
|
* constructor
|
||||||
*/
|
*/
|
||||||
function queue()
|
function __construct()
|
||||||
{
|
{
|
||||||
global $phpEx, $phpbb_root_path, $phpbb_filesystem, $phpbb_container;
|
global $phpEx, $phpbb_root_path, $phpbb_filesystem, $phpbb_container;
|
||||||
|
|
||||||
|
@ -1317,7 +1317,7 @@ class smtp_class
|
||||||
var $backtrace = false;
|
var $backtrace = false;
|
||||||
var $backtrace_log = array();
|
var $backtrace_log = array();
|
||||||
|
|
||||||
function smtp_class()
|
function __construct()
|
||||||
{
|
{
|
||||||
// Always create a backtrace for admins to identify SMTP problems
|
// Always create a backtrace for admins to identify SMTP problems
|
||||||
$this->backtrace = true;
|
$this->backtrace = true;
|
||||||
|
|
|
@ -40,7 +40,7 @@ class p_master
|
||||||
* Constuctor
|
* Constuctor
|
||||||
* Set module include path
|
* Set module include path
|
||||||
*/
|
*/
|
||||||
function p_master($include_path = false)
|
function __construct($include_path = false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
global $phpbb_root_path;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ class transfer
|
||||||
/**
|
/**
|
||||||
* Constructor - init some basic values
|
* Constructor - init some basic values
|
||||||
*/
|
*/
|
||||||
function transfer()
|
function __construct()
|
||||||
{
|
{
|
||||||
global $phpbb_root_path;
|
global $phpbb_root_path;
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ class ftp extends transfer
|
||||||
/**
|
/**
|
||||||
* Standard parameters for FTP session
|
* Standard parameters for FTP session
|
||||||
*/
|
*/
|
||||||
function ftp($host, $username, $password, $root_path, $port = 21, $timeout = 10)
|
function __construct($host, $username, $password, $root_path, $port = 21, $timeout = 10)
|
||||||
{
|
{
|
||||||
$this->host = $host;
|
$this->host = $host;
|
||||||
$this->port = $port;
|
$this->port = $port;
|
||||||
|
@ -512,7 +512,7 @@ class ftp_fsock extends transfer
|
||||||
/**
|
/**
|
||||||
* Standard parameters for FTP session
|
* Standard parameters for FTP session
|
||||||
*/
|
*/
|
||||||
function ftp_fsock($host, $username, $password, $root_path, $port = 21, $timeout = 10)
|
function __construct($host, $username, $password, $root_path, $port = 21, $timeout = 10)
|
||||||
{
|
{
|
||||||
$this->host = $host;
|
$this->host = $host;
|
||||||
$this->port = $port;
|
$this->port = $port;
|
||||||
|
@ -529,7 +529,7 @@ class ftp_fsock extends transfer
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init some needed values
|
// Init some needed values
|
||||||
$this->transfer();
|
parent::__construct();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ class phpbb_hook
|
||||||
*
|
*
|
||||||
* @param array $valid_hooks array containing the hookable functions/methods
|
* @param array $valid_hooks array containing the hookable functions/methods
|
||||||
*/
|
*/
|
||||||
function phpbb_hook($valid_hooks)
|
function __construct($valid_hooks)
|
||||||
{
|
{
|
||||||
foreach ($valid_hooks as $_null => $method)
|
foreach ($valid_hooks as $_null => $method)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@ class mcp_logs
|
||||||
var $u_action;
|
var $u_action;
|
||||||
var $p_master;
|
var $p_master;
|
||||||
|
|
||||||
function mcp_logs(&$p_master)
|
function __construct(&$p_master)
|
||||||
{
|
{
|
||||||
$this->p_master = &$p_master;
|
$this->p_master = &$p_master;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class mcp_main
|
||||||
var $p_master;
|
var $p_master;
|
||||||
var $u_action;
|
var $u_action;
|
||||||
|
|
||||||
function mcp_main(&$p_master)
|
function __construct(&$p_master)
|
||||||
{
|
{
|
||||||
$this->p_master = &$p_master;
|
$this->p_master = &$p_master;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class mcp_notes
|
||||||
var $p_master;
|
var $p_master;
|
||||||
var $u_action;
|
var $u_action;
|
||||||
|
|
||||||
function mcp_notes(&$p_master)
|
function __construct(&$p_master)
|
||||||
{
|
{
|
||||||
$this->p_master = &$p_master;
|
$this->p_master = &$p_master;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class mcp_pm_reports
|
||||||
var $p_master;
|
var $p_master;
|
||||||
var $u_action;
|
var $u_action;
|
||||||
|
|
||||||
function mcp_pm_reports(&$p_master)
|
function __construct(&$p_master)
|
||||||
{
|
{
|
||||||
$this->p_master = &$p_master;
|
$this->p_master = &$p_master;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class mcp_queue
|
||||||
var $p_master;
|
var $p_master;
|
||||||
var $u_action;
|
var $u_action;
|
||||||
|
|
||||||
public function mcp_queue(&$p_master)
|
public function __construct(&$p_master)
|
||||||
{
|
{
|
||||||
$this->p_master = &$p_master;
|
$this->p_master = &$p_master;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class mcp_reports
|
||||||
var $p_master;
|
var $p_master;
|
||||||
var $u_action;
|
var $u_action;
|
||||||
|
|
||||||
function mcp_reports(&$p_master)
|
function __construct(&$p_master)
|
||||||
{
|
{
|
||||||
$this->p_master = &$p_master;
|
$this->p_master = &$p_master;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class mcp_warn
|
||||||
var $p_master;
|
var $p_master;
|
||||||
var $u_action;
|
var $u_action;
|
||||||
|
|
||||||
function mcp_warn(&$p_master)
|
function __construct(&$p_master)
|
||||||
{
|
{
|
||||||
$this->p_master = &$p_master;
|
$this->p_master = &$p_master;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1139,7 +1139,7 @@ class parse_message extends bbcode_firstpass
|
||||||
/**
|
/**
|
||||||
* Init - give message here or manually
|
* Init - give message here or manually
|
||||||
*/
|
*/
|
||||||
function parse_message($message = '')
|
function __construct($message = '')
|
||||||
{
|
{
|
||||||
// Init BBCode UID
|
// Init BBCode UID
|
||||||
$this->bbcode_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN);
|
$this->bbcode_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN);
|
||||||
|
|
|
@ -40,7 +40,7 @@ class phpbb_questionnaire_data_collector
|
||||||
*
|
*
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
function phpbb_questionnaire_data_collector($install_id)
|
function __construct($install_id)
|
||||||
{
|
{
|
||||||
$this->install_id = $install_id;
|
$this->install_id = $install_id;
|
||||||
$this->providers = array();
|
$this->providers = array();
|
||||||
|
@ -223,7 +223,7 @@ class phpbb_questionnaire_phpbb_data_provider
|
||||||
*
|
*
|
||||||
* @param array $config
|
* @param array $config
|
||||||
*/
|
*/
|
||||||
function phpbb_questionnaire_phpbb_data_provider($config)
|
function __construct($config)
|
||||||
{
|
{
|
||||||
// generate a unique id if necessary
|
// generate a unique id if necessary
|
||||||
if (empty($config['questionnaire_unique_id']))
|
if (empty($config['questionnaire_unique_id']))
|
||||||
|
|
|
@ -427,7 +427,7 @@ class SphinxClient
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/// create a new client object and fill defaults
|
/// create a new client object and fill defaults
|
||||||
function SphinxClient ()
|
function __construct ()
|
||||||
{
|
{
|
||||||
// per-client-object settings
|
// per-client-object settings
|
||||||
$this->_host = "localhost";
|
$this->_host = "localhost";
|
||||||
|
|
|
@ -28,7 +28,7 @@ class ucp_main
|
||||||
var $p_master;
|
var $p_master;
|
||||||
var $u_action;
|
var $u_action;
|
||||||
|
|
||||||
function ucp_main(&$p_master)
|
function __construct(&$p_master)
|
||||||
{
|
{
|
||||||
$this->p_master = &$p_master;
|
$this->p_master = &$p_master;
|
||||||
}
|
}
|
||||||
|
|
2
tests/cache/cache_memory.php
vendored
2
tests/cache/cache_memory.php
vendored
|
@ -18,7 +18,7 @@ class phpbb_cache_memory extends \phpbb\cache\driver\memory
|
||||||
/**
|
/**
|
||||||
* Set cache path
|
* Set cache path
|
||||||
*/
|
*/
|
||||||
function phpbb_cache_memory()
|
function __construct()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue