mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-13 20:32:11 +02:00
[ticket/15849] Stop using php4 constructors
PHPBB3-15849
This commit is contained in:
parent
ae6c3b0d34
commit
b148bb5d70
@ -33,7 +33,7 @@ class build_package
|
||||
var $status_begun = false;
|
||||
var $num_dots = 0;
|
||||
|
||||
function build_package($versions, $verbose = false)
|
||||
function __construct($versions, $verbose = false)
|
||||
{
|
||||
$this->versions = $versions;
|
||||
$this->verbose = $verbose;
|
||||
|
@ -24,7 +24,7 @@ class acp_inactive
|
||||
var $u_action;
|
||||
var $p_master;
|
||||
|
||||
function acp_inactive(&$p_master)
|
||||
function __construct(&$p_master)
|
||||
{
|
||||
$this->p_master = &$p_master;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ class acp_users
|
||||
var $u_action;
|
||||
var $p_master;
|
||||
|
||||
function acp_users(&$p_master)
|
||||
function __construct(&$p_master)
|
||||
{
|
||||
$this->p_master = &$p_master;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||
/**
|
||||
* Init auth settings
|
||||
*/
|
||||
function auth_admin()
|
||||
function __construct()
|
||||
{
|
||||
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.
|
||||
$this->acl_options = array();
|
||||
$this->auth_admin();
|
||||
$this->__construct();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ class bbcode
|
||||
* Constructor
|
||||
* Init bbcode cache entries if bitfield is specified
|
||||
*/
|
||||
function bbcode($bitfield = '')
|
||||
function __construct($bitfield = '')
|
||||
{
|
||||
if ($bitfield)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ class diff
|
||||
* @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
|
||||
*/
|
||||
function diff(&$from_content, &$to_content, $preserve_cr = true)
|
||||
function __construct(&$from_content, &$to_content, $preserve_cr = true)
|
||||
{
|
||||
$diff_engine = new diff_engine();
|
||||
$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.
|
||||
* @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))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
parent::diff($mapped_from_lines, $mapped_to_lines);
|
||||
parent::__construct($mapped_from_lines, $mapped_to_lines);
|
||||
|
||||
$xi = $yi = 0;
|
||||
for ($i = 0; $i < count($this->_edits); $i++)
|
||||
@ -394,7 +394,7 @@ class 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))
|
||||
{
|
||||
@ -419,7 +419,7 @@ class diff_op_copy extends diff_op
|
||||
*/
|
||||
class diff_op_delete extends diff_op
|
||||
{
|
||||
function diff_op_delete($lines)
|
||||
function __construct($lines)
|
||||
{
|
||||
$this->orig = $lines;
|
||||
$this->final = false;
|
||||
@ -440,7 +440,7 @@ class diff_op_delete extends diff_op
|
||||
*/
|
||||
class diff_op_add extends diff_op
|
||||
{
|
||||
function diff_op_add($lines)
|
||||
function __construct($lines)
|
||||
{
|
||||
$this->final = $lines;
|
||||
$this->orig = false;
|
||||
@ -461,7 +461,7 @@ class diff_op_add extends diff_op
|
||||
*/
|
||||
class diff_op_change extends diff_op
|
||||
{
|
||||
function diff_op_change($orig, $final)
|
||||
function __construct($orig, $final)
|
||||
{
|
||||
$this->orig = $orig;
|
||||
$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
|
||||
* 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();
|
||||
|
||||
@ -754,7 +754,7 @@ class diff3 extends diff
|
||||
*/
|
||||
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->final1 = $final1 ? $final1 : array();
|
||||
@ -1066,7 +1066,7 @@ class 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->final1 = &$this->orig;
|
||||
@ -1092,7 +1092,7 @@ class diff3_op_copy extends diff3_op
|
||||
*/
|
||||
class diff3_block_builder
|
||||
{
|
||||
function diff3_block_builder()
|
||||
function __construct()
|
||||
{
|
||||
$this->_init();
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class diff_renderer
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function diff_renderer($params = array())
|
||||
function __construct($params = array())
|
||||
{
|
||||
foreach ($params as $param => $value)
|
||||
{
|
||||
|
@ -210,7 +210,7 @@ class compress_zip extends compress
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function compress_zip($mode, $file)
|
||||
function __construct($mode, $file)
|
||||
{
|
||||
global $phpbb_filesystem;
|
||||
|
||||
@ -569,7 +569,7 @@ class compress_tar extends compress
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function compress_tar($mode, $file, $type = '')
|
||||
function __construct($mode, $file, $type = '')
|
||||
{
|
||||
global $phpbb_filesystem;
|
||||
|
||||
|
@ -1672,7 +1672,7 @@ class bitfield
|
||||
{
|
||||
var $data;
|
||||
|
||||
function bitfield($bitfield = '')
|
||||
function __construct($bitfield = '')
|
||||
{
|
||||
$this->data = base64_decode($bitfield);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ class messenger
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function messenger($use_queue = true)
|
||||
function __construct($use_queue = true)
|
||||
{
|
||||
global $config;
|
||||
|
||||
@ -781,7 +781,7 @@ class queue
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
function queue()
|
||||
function __construct()
|
||||
{
|
||||
global $phpEx, $phpbb_root_path, $phpbb_filesystem, $phpbb_container;
|
||||
|
||||
@ -1317,7 +1317,7 @@ class smtp_class
|
||||
var $backtrace = false;
|
||||
var $backtrace_log = array();
|
||||
|
||||
function smtp_class()
|
||||
function __construct()
|
||||
{
|
||||
// Always create a backtrace for admins to identify SMTP problems
|
||||
$this->backtrace = true;
|
||||
|
@ -40,7 +40,7 @@ class p_master
|
||||
* Constuctor
|
||||
* Set module include path
|
||||
*/
|
||||
function p_master($include_path = false)
|
||||
function __construct($include_path = false)
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
|
@ -38,7 +38,7 @@ class transfer
|
||||
/**
|
||||
* Constructor - init some basic values
|
||||
*/
|
||||
function transfer()
|
||||
function __construct()
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
@ -264,7 +264,7 @@ class ftp extends transfer
|
||||
/**
|
||||
* 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->port = $port;
|
||||
@ -512,7 +512,7 @@ class ftp_fsock extends transfer
|
||||
/**
|
||||
* 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->port = $port;
|
||||
@ -529,7 +529,7 @@ class ftp_fsock extends transfer
|
||||
}
|
||||
|
||||
// Init some needed values
|
||||
$this->transfer();
|
||||
parent::__construct();
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class phpbb_hook
|
||||
*
|
||||
* @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)
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ class mcp_logs
|
||||
var $u_action;
|
||||
var $p_master;
|
||||
|
||||
function mcp_logs(&$p_master)
|
||||
function __construct(&$p_master)
|
||||
{
|
||||
$this->p_master = &$p_master;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class mcp_main
|
||||
var $p_master;
|
||||
var $u_action;
|
||||
|
||||
function mcp_main(&$p_master)
|
||||
function __construct(&$p_master)
|
||||
{
|
||||
$this->p_master = &$p_master;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class mcp_notes
|
||||
var $p_master;
|
||||
var $u_action;
|
||||
|
||||
function mcp_notes(&$p_master)
|
||||
function __construct(&$p_master)
|
||||
{
|
||||
$this->p_master = &$p_master;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class mcp_pm_reports
|
||||
var $p_master;
|
||||
var $u_action;
|
||||
|
||||
function mcp_pm_reports(&$p_master)
|
||||
function __construct(&$p_master)
|
||||
{
|
||||
$this->p_master = &$p_master;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class mcp_queue
|
||||
var $p_master;
|
||||
var $u_action;
|
||||
|
||||
public function mcp_queue(&$p_master)
|
||||
public function __construct(&$p_master)
|
||||
{
|
||||
$this->p_master = &$p_master;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class mcp_reports
|
||||
var $p_master;
|
||||
var $u_action;
|
||||
|
||||
function mcp_reports(&$p_master)
|
||||
function __construct(&$p_master)
|
||||
{
|
||||
$this->p_master = &$p_master;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class mcp_warn
|
||||
var $p_master;
|
||||
var $u_action;
|
||||
|
||||
function mcp_warn(&$p_master)
|
||||
function __construct(&$p_master)
|
||||
{
|
||||
$this->p_master = &$p_master;
|
||||
}
|
||||
|
@ -1139,7 +1139,7 @@ class parse_message extends bbcode_firstpass
|
||||
/**
|
||||
* Init - give message here or manually
|
||||
*/
|
||||
function parse_message($message = '')
|
||||
function __construct($message = '')
|
||||
{
|
||||
// Init BBCode UID
|
||||
$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
|
||||
*/
|
||||
function phpbb_questionnaire_data_collector($install_id)
|
||||
function __construct($install_id)
|
||||
{
|
||||
$this->install_id = $install_id;
|
||||
$this->providers = array();
|
||||
@ -223,7 +223,7 @@ class phpbb_questionnaire_phpbb_data_provider
|
||||
*
|
||||
* @param array $config
|
||||
*/
|
||||
function phpbb_questionnaire_phpbb_data_provider($config)
|
||||
function __construct($config)
|
||||
{
|
||||
// generate a unique id if necessary
|
||||
if (empty($config['questionnaire_unique_id']))
|
||||
|
@ -126,7 +126,7 @@ define ( "SPH_GROUPBY_ATTRPAIR", 5 );
|
||||
function sphPackI64 ( $v )
|
||||
{
|
||||
assert ( is_numeric($v) );
|
||||
|
||||
|
||||
// x64
|
||||
if ( PHP_INT_SIZE>=8 )
|
||||
{
|
||||
@ -138,7 +138,7 @@ function sphPackI64 ( $v )
|
||||
if ( is_int($v) )
|
||||
return pack ( "NN", $v < 0 ? -1 : 0, $v );
|
||||
|
||||
// x32, bcmath
|
||||
// x32, bcmath
|
||||
if ( function_exists("bcmul") )
|
||||
{
|
||||
if ( bccomp ( $v, 0 ) == -1 )
|
||||
@ -175,16 +175,16 @@ function sphPackI64 ( $v )
|
||||
function sphPackU64 ( $v )
|
||||
{
|
||||
assert ( is_numeric($v) );
|
||||
|
||||
|
||||
// x64
|
||||
if ( PHP_INT_SIZE>=8 )
|
||||
{
|
||||
assert ( $v>=0 );
|
||||
|
||||
|
||||
// x64, int
|
||||
if ( is_int($v) )
|
||||
return pack ( "NN", $v>>32, $v&0xFFFFFFFF );
|
||||
|
||||
|
||||
// x64, bcmath
|
||||
if ( function_exists("bcmul") )
|
||||
{
|
||||
@ -192,12 +192,12 @@ function sphPackU64 ( $v )
|
||||
$l = bcmod ( $v, 4294967296 );
|
||||
return pack ( "NN", $h, $l );
|
||||
}
|
||||
|
||||
|
||||
// x64, no-bcmath
|
||||
$p = max ( 0, strlen($v) - 13 );
|
||||
$lo = (int)substr ( $v, $p );
|
||||
$hi = (int)substr ( $v, 0, $p );
|
||||
|
||||
|
||||
$m = $lo + $hi*1316134912;
|
||||
$l = $m % 4294967296;
|
||||
$h = $hi*2328 + (int)($m/4294967296);
|
||||
@ -208,7 +208,7 @@ function sphPackU64 ( $v )
|
||||
// x32, int
|
||||
if ( is_int($v) )
|
||||
return pack ( "NN", 0, $v );
|
||||
|
||||
|
||||
// x32, bcmath
|
||||
if ( function_exists("bcmul") )
|
||||
{
|
||||
@ -221,7 +221,7 @@ function sphPackU64 ( $v )
|
||||
$p = max(0, strlen($v) - 13);
|
||||
$lo = (float)substr($v, $p);
|
||||
$hi = (float)substr($v, 0, $p);
|
||||
|
||||
|
||||
$m = $lo + $hi*1316134912.0;
|
||||
$q = floor($m / 4294967296.0);
|
||||
$l = $m - ($q * 4294967296.0);
|
||||
@ -277,11 +277,11 @@ function sphUnpackU64 ( $v )
|
||||
// x32, bcmath
|
||||
if ( function_exists("bcmul") )
|
||||
return bcadd ( $lo, bcmul ( $hi, "4294967296" ) );
|
||||
|
||||
|
||||
// x32, no-bcmath
|
||||
$hi = (float)$hi;
|
||||
$lo = (float)$lo;
|
||||
|
||||
|
||||
$q = floor($hi/10000000.0);
|
||||
$r = $hi - $q*10000000.0;
|
||||
$m = $lo + $r*4967296.0;
|
||||
@ -324,7 +324,7 @@ function sphUnpackI64 ( $v )
|
||||
return $lo;
|
||||
return sprintf ( "%.0f", $lo - 4294967296.0 );
|
||||
}
|
||||
|
||||
|
||||
$neg = "";
|
||||
$c = 0;
|
||||
if ( $hi<0 )
|
||||
@ -333,7 +333,7 @@ function sphUnpackI64 ( $v )
|
||||
$lo = ~$lo;
|
||||
$c = 1;
|
||||
$neg = "-";
|
||||
}
|
||||
}
|
||||
|
||||
$hi = sprintf ( "%u", $hi );
|
||||
$lo = sprintf ( "%u", $lo );
|
||||
@ -345,7 +345,7 @@ function sphUnpackI64 ( $v )
|
||||
// x32, no-bcmath
|
||||
$hi = (float)$hi;
|
||||
$lo = (float)$lo;
|
||||
|
||||
|
||||
$q = floor($hi/10000000.0);
|
||||
$r = $hi - $q*10000000.0;
|
||||
$m = $lo + $r*4967296.0;
|
||||
@ -427,7 +427,7 @@ class SphinxClient
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// create a new client object and fill defaults
|
||||
function SphinxClient ()
|
||||
function __construct ()
|
||||
{
|
||||
// per-client-object settings
|
||||
$this->_host = "localhost";
|
||||
@ -510,7 +510,7 @@ class SphinxClient
|
||||
$this->_path = $host;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
assert ( is_int($port) );
|
||||
$this->_host = $host;
|
||||
$this->_port = $port;
|
||||
@ -590,14 +590,14 @@ class SphinxClient
|
||||
$fp = @fsockopen ( $host, $port, $errno, $errstr );
|
||||
else
|
||||
$fp = @fsockopen ( $host, $port, $errno, $errstr, $this->_timeout );
|
||||
|
||||
|
||||
if ( !$fp )
|
||||
{
|
||||
if ( $this->_path )
|
||||
$location = $this->_path;
|
||||
else
|
||||
$location = "{$this->_host}:{$this->_port}";
|
||||
|
||||
|
||||
$errstr = trim ( $errstr );
|
||||
$this->_error = "connection to $location failed (errno=$errno, msg=$errstr)";
|
||||
$this->_connerror = true;
|
||||
@ -1236,7 +1236,7 @@ class SphinxClient
|
||||
if ( $type==SPH_ATTR_FLOAT )
|
||||
{
|
||||
list(,$uval) = unpack ( "N*", substr ( $response, $p, 4 ) ); $p += 4;
|
||||
list(,$fval) = unpack ( "f*", pack ( "L", $uval ) );
|
||||
list(,$fval) = unpack ( "f*", pack ( "L", $uval ) );
|
||||
$attrvals[$attr] = $fval;
|
||||
continue;
|
||||
}
|
||||
@ -1264,7 +1264,7 @@ class SphinxClient
|
||||
} else if ( $type==SPH_ATTR_STRING )
|
||||
{
|
||||
$attrvals[$attr] = substr ( $response, $p, $val );
|
||||
$p += $val;
|
||||
$p += $val;
|
||||
} else
|
||||
{
|
||||
$attrvals[$attr] = sphFixUint($val);
|
||||
@ -1345,7 +1345,7 @@ class SphinxClient
|
||||
if ( !isset($opts["passage_boundary"]) ) $opts["passage_boundary"] = "none";
|
||||
if ( !isset($opts["emit_zones"]) ) $opts["emit_zones"] = false;
|
||||
if ( !isset($opts["load_files_scattered"]) ) $opts["load_files_scattered"] = false;
|
||||
|
||||
|
||||
|
||||
/////////////////
|
||||
// build request
|
||||
@ -1634,7 +1634,7 @@ class SphinxClient
|
||||
|
||||
fclose ( $this->_socket );
|
||||
$this->_socket = false;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ class ucp_main
|
||||
var $p_master;
|
||||
var $u_action;
|
||||
|
||||
function ucp_main(&$p_master)
|
||||
function __construct(&$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
|
||||
*/
|
||||
function phpbb_cache_memory()
|
||||
function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user