diff --git a/auth/cas/auth.php b/auth/cas/auth.php index afa87dd2f8d..7b95eadafc4 100644 --- a/auth/cas/auth.php +++ b/auth/cas/auth.php @@ -39,13 +39,20 @@ class auth_plugin_cas extends auth_plugin_ldap { /** * Constructor. */ - function auth_plugin_cas() { + public function __construct() { $this->authtype = 'cas'; $this->roleauth = 'auth_cas'; $this->errorlogtag = '[AUTH CAS] '; $this->init_plugin($this->authtype); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_cas() { + self::__construct(); + } + function prevent_local_passwords() { return true; } diff --git a/auth/email/auth.php b/auth/email/auth.php index 0a0827d9149..bd5cb03799f 100644 --- a/auth/email/auth.php +++ b/auth/email/auth.php @@ -34,11 +34,18 @@ class auth_plugin_email extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_email() { + public function __construct() { $this->authtype = 'email'; $this->config = get_config('auth/email'); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_email() { + self::__construct(); + } + /** * Returns true if the username and password work and false if they are * wrong or don't exist. diff --git a/auth/fc/auth.php b/auth/fc/auth.php index 75c8bd073b5..27c55f48a5f 100644 --- a/auth/fc/auth.php +++ b/auth/fc/auth.php @@ -37,11 +37,18 @@ class auth_plugin_fc extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_fc() { + public function __construct() { $this->authtype = 'fc'; $this->config = get_config('auth/fc'); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_fc() { + self::__construct(); + } + /** * Returns true if the username and password work and false if they are * wrong or don't exist. diff --git a/auth/fc/fcFPP.php b/auth/fc/fcFPP.php index c08220215d5..36c589e4e3f 100644 --- a/auth/fc/fcFPP.php +++ b/auth/fc/fcFPP.php @@ -30,7 +30,7 @@ class fcFPP var $_debug = FALSE; // set to true to see some debug info // class constructor - function fcFPP($host="localhost", $port="3333") + public function __construct($host="localhost", $port="3333") { $this->_hostname = $host; $this->_port = $port; diff --git a/auth/imap/auth.php b/auth/imap/auth.php index b0d7f9fb016..e43af0f8bd3 100644 --- a/auth/imap/auth.php +++ b/auth/imap/auth.php @@ -35,11 +35,18 @@ class auth_plugin_imap extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_imap() { + public function __construct() { $this->authtype = 'imap'; $this->config = get_config('auth/imap'); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_imap() { + self::__construct(); + } + /** * Returns true if the username and password work and false if they are * wrong or don't exist. diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index 96d9bbaf23d..bf68540eec8 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -143,13 +143,20 @@ class auth_plugin_ldap extends auth_plugin_base { /** * Constructor with initialisation. */ - function auth_plugin_ldap() { + public function __construct() { $this->authtype = 'ldap'; $this->roleauth = 'auth_ldap'; $this->errorlogtag = '[AUTH LDAP] '; $this->init_plugin($this->authtype); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_ldap() { + self::__construct(); + } + /** * Returns true if the username and password work and false if they are * wrong or don't exist. diff --git a/auth/manual/auth.php b/auth/manual/auth.php index 938aae8f6fb..6d6ef93fd28 100644 --- a/auth/manual/auth.php +++ b/auth/manual/auth.php @@ -46,13 +46,20 @@ class auth_plugin_manual extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_manual() { + public function __construct() { $this->authtype = 'manual'; $config = get_config(self::COMPONENT_NAME); $legacyconfig = get_config(self::LEGACY_COMPONENT_NAME); $this->config = (object)array_merge((array)$legacyconfig, (array)$config); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_manual() { + self::__construct(); + } + /** * Returns true if the username and password work and false if they are * wrong or don't exist. (Non-mnet accounts only!) diff --git a/auth/mnet/auth.php b/auth/mnet/auth.php index f0615398630..8c7a72aa2cf 100644 --- a/auth/mnet/auth.php +++ b/auth/mnet/auth.php @@ -35,12 +35,19 @@ class auth_plugin_mnet extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_mnet() { + public function __construct() { $this->authtype = 'mnet'; $this->config = get_config('auth_mnet'); $this->mnet = get_mnet_environment(); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_mnet() { + self::__construct(); + } + /** * This function is normally used to determine if the username and password * are correct for local logins. Always returns false, as local users do not diff --git a/auth/nntp/auth.php b/auth/nntp/auth.php index c2ad28319db..909d920bda2 100644 --- a/auth/nntp/auth.php +++ b/auth/nntp/auth.php @@ -35,11 +35,18 @@ class auth_plugin_nntp extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_nntp() { + public function __construct() { $this->authtype = 'nntp'; $this->config = get_config('auth/nntp'); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_nntp() { + self::__construct(); + } + /** * Returns true if the username and password work and false if they are * wrong or don't exist. diff --git a/auth/nologin/auth.php b/auth/nologin/auth.php index c3ed391c07c..9a80a02d404 100644 --- a/auth/nologin/auth.php +++ b/auth/nologin/auth.php @@ -35,10 +35,17 @@ class auth_plugin_nologin extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_nologin() { + public function __construct() { $this->authtype = 'nologin'; } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_nologin() { + self::__construct(); + } + /** * Do not allow any login. * diff --git a/auth/none/auth.php b/auth/none/auth.php index fcfce4cfd2d..110c3906036 100644 --- a/auth/none/auth.php +++ b/auth/none/auth.php @@ -34,11 +34,18 @@ class auth_plugin_none extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_none() { + public function __construct() { $this->authtype = 'none'; $this->config = get_config('auth/none'); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_none() { + self::__construct(); + } + /** * Returns true if the username and password work or don't exist and false * if the user exists and the password is wrong. diff --git a/auth/pam/auth.php b/auth/pam/auth.php index fd76a09ef84..0383621bb1c 100644 --- a/auth/pam/auth.php +++ b/auth/pam/auth.php @@ -53,12 +53,19 @@ class auth_plugin_pam extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_pam() { + public function __construct() { $this->authtype = 'pam'; $this->config = get_config('auth/pam'); $this->errormessage = ''; } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_pam() { + self::__construct(); + } + /** * Returns true if the username and password work and false if they are * wrong or don't exist. diff --git a/auth/pop3/auth.php b/auth/pop3/auth.php index 5e25aa95bcf..1b6345abc37 100644 --- a/auth/pop3/auth.php +++ b/auth/pop3/auth.php @@ -35,11 +35,18 @@ class auth_plugin_pop3 extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_pop3() { + public function __construct() { $this->authtype = 'pop3'; $this->config = get_config('auth/pop3'); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_pop3() { + self::__construct(); + } + /** * Returns true if the username and password work and false if they are * wrong or don't exist. diff --git a/auth/radius/auth.php b/auth/radius/auth.php index a74369e6afb..da703941abc 100644 --- a/auth/radius/auth.php +++ b/auth/radius/auth.php @@ -38,11 +38,18 @@ class auth_plugin_radius extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_radius() { + public function __construct() { $this->authtype = 'radius'; $this->config = get_config('auth/radius'); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_radius() { + self::__construct(); + } + /** * Returns true if the username and password work and false if they are * wrong or don't exist. diff --git a/auth/shibboleth/auth.php b/auth/shibboleth/auth.php index a4cebd84043..225390dada7 100644 --- a/auth/shibboleth/auth.php +++ b/auth/shibboleth/auth.php @@ -38,11 +38,18 @@ class auth_plugin_shibboleth extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_shibboleth() { + public function __construct() { $this->authtype = 'shibboleth'; $this->config = get_config('auth/shibboleth'); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_shibboleth() { + self::__construct(); + } + /** * Returns true if the username and password work and false if they are * wrong or don't exist. diff --git a/auth/webservice/auth.php b/auth/webservice/auth.php index 1fc56942623..80c351a9f7c 100644 --- a/auth/webservice/auth.php +++ b/auth/webservice/auth.php @@ -35,11 +35,18 @@ class auth_plugin_webservice extends auth_plugin_base { /** * Constructor. */ - function auth_plugin_webservice() { + public function __construct() { $this->authtype = 'webservice'; $this->config = get_config('auth/webservice'); } + /** + * Old syntax of class constructor for backward compatibility. + */ + public function auth_plugin_webservice() { + self::__construct(); + } + /** * Returns true if the username and password work and false if they are * wrong or don't exist. diff --git a/lib/pear/Crypt/CHAP.php b/lib/pear/Crypt/CHAP.php index 561ec9fdac0..333db9bf071 100644 --- a/lib/pear/Crypt/CHAP.php +++ b/lib/pear/Crypt/CHAP.php @@ -85,9 +85,9 @@ class Crypt_CHAP extends PEAR * Generates a random challenge * @return void */ - function Crypt_CHAP() + public function __construct() { - $this->PEAR(); + parent::__construct(); $this->generateChallenge(); } @@ -167,9 +167,9 @@ class Crypt_CHAP_MSv1 extends Crypt_CHAP * Loads the hash extension * @return void */ - function Crypt_CHAP_MSv1() + public function __construct() { - $this->Crypt_CHAP(); + parent::__construct(); $this->loadExtension('hash'); } @@ -415,9 +415,9 @@ class Crypt_CHAP_MSv2 extends Crypt_CHAP_MSv1 * Generates the 16 Bytes peer and authentication challenge * @return void */ - function Crypt_CHAP_MSv2() + public function __construct() { - $this->Crypt_CHAP_MSv1(); + parent::__construct(); $this->generateChallenge('peerChallenge', 16); $this->generateChallenge('authChallenge', 16); } diff --git a/lib/pear/README_MOODLE.txt b/lib/pear/README_MOODLE.txt index 8a9dcaa4c66..b800987b53a 100644 --- a/lib/pear/README_MOODLE.txt +++ b/lib/pear/README_MOODLE.txt @@ -32,4 +32,9 @@ MDL-52081 - made all constructors PHP7 compatible Pear ==== -Changed constructors in classes PEAR and PEAR_ERROR to be __construct(). \ No newline at end of file +Changed constructors in classes PEAR and PEAR_ERROR to be __construct(). + + +Crypt/CHAP +========== +MDL-52285 - made all constructors PHP7 compatible diff --git a/mnet/environment.php b/mnet/environment.php index 5cc649b2e91..236e4b65ef7 100644 --- a/mnet/environment.php +++ b/mnet/environment.php @@ -17,10 +17,6 @@ class mnet_environment { var $keypair = array(); var $deleted = 0; - function mnet_environment() { - return true; - } - function init() { global $CFG, $DB; diff --git a/mnet/peer.php b/mnet/peer.php index 9f72e179853..804b7d2dfd8 100644 --- a/mnet/peer.php +++ b/mnet/peer.php @@ -39,10 +39,6 @@ class mnet_peer { /** @var int $sslverification The level of SSL verification to apply. */ public $sslverification = self::SSL_HOST_AND_PEER; - function mnet_peer() { - return true; - } - /* * Fetch information about a peer identified by wwwroot * If information does not preexist in db, collect it together based on diff --git a/mnet/xmlrpc/client.php b/mnet/xmlrpc/client.php index 08414cf3153..3597cd58e35 100644 --- a/mnet/xmlrpc/client.php +++ b/mnet/xmlrpc/client.php @@ -23,12 +23,11 @@ class mnet_xmlrpc_client { var $mnet = null; /** - * Constructor returns true + * Constructor */ - function mnet_xmlrpc_client() { + public function __construct() { // make sure we've got this set up before we try and do anything else $this->mnet = get_mnet_environment(); - return true; } /** diff --git a/mnet/xmlrpc/xmlparser.php b/mnet/xmlrpc/xmlparser.php index 95ccd2a6547..caf52ea158b 100644 --- a/mnet/xmlrpc/xmlparser.php +++ b/mnet/xmlrpc/xmlparser.php @@ -17,7 +17,7 @@ class mnet_encxml_parser { * * @return bool True */ - function mnet_encxml_parser() { + public function __construct() { return $this->initialise(); }