From b60c345536e10386938f47f643012c43242c20f3 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 5 Apr 2011 17:25:08 +0000 Subject: [PATCH] Remove PHP4 constructors. Props hakre. see #16768 git-svn-id: http://svn.automattic.com/wordpress/trunk@17604 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/cache.php | 11 ----------- wp-includes/capabilities.php | 12 ++++-------- wp-includes/class.wp-dependencies.php | 7 ------- wp-includes/wp-db.php | 17 ----------------- 4 files changed, 4 insertions(+), 43 deletions(-) diff --git a/wp-includes/cache.php b/wp-includes/cache.php index 895c43161..67c7b241a 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -456,17 +456,6 @@ class WP_Object_Cache { echo ''; } - /** - * PHP4 constructor; Calls PHP 5 style constructor - * - * @since 2.0.0 - * - * @return WP_Object_Cache - */ - function WP_Object_Cache() { - return $this->__construct(); - } - /** * Sets up object properties; PHP 5 style constructor * diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 7d8a00d73..bd87028ea 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -73,14 +73,11 @@ class WP_Roles { var $use_db = true; /** - * PHP4 Constructor - Call {@link WP_Roles::_init()} method. + * Constructor * * @since 2.0.0 - * @access public - * - * @return WP_Roles */ - function WP_Roles() { + function __construct() { $this->_init(); } @@ -269,7 +266,7 @@ class WP_Role { var $capabilities; /** - * PHP4 Constructor - Set up object properties. + * Constructor - Set up object properties. * * The list of capabilities, must have the key as the name of the capability * and the value a boolean of whether it is granted to the role. @@ -279,9 +276,8 @@ class WP_Role { * * @param string $role Role name. * @param array $capabilities List of capabilities. - * @return WP_Role */ - function WP_Role( $role, $capabilities ) { + function __construct( $role, $capabilities ) { $this->name = $role; $this->capabilities = $capabilities; } diff --git a/wp-includes/class.wp-dependencies.php b/wp-includes/class.wp-dependencies.php index de3630ad8..658952c61 100644 --- a/wp-includes/class.wp-dependencies.php +++ b/wp-includes/class.wp-dependencies.php @@ -25,13 +25,6 @@ class WP_Dependencies { var $groups = array(); var $group = 0; - function WP_Dependencies() { - $args = func_get_args(); - call_user_func_array( array(&$this, '__construct'), $args ); - } - - function __construct() {} - /** * Do the dependencies * diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 9820ea0d5..4bbe9eaee 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -461,23 +461,6 @@ class wpdb { */ var $func_call; - /** - * Connects to the database server and selects a database - * - * PHP4 compatibility layer for calling the PHP5 constructor. - * - * @uses wpdb::__construct() Passes parameters and returns result - * @since 0.71 - * - * @param string $dbuser MySQL database user - * @param string $dbpassword MySQL database password - * @param string $dbname MySQL database name - * @param string $dbhost MySQL database host - */ - function wpdb( $dbuser, $dbpassword, $dbname, $dbhost ) { - return $this->__construct( $dbuser, $dbpassword, $dbname, $dbhost ); - } - /** * Connects to the database server and selects a database *