Invalid class constructors

From: Date: Sat, 14 Feb 2004 15:58:44 +0000
Subject: Invalid class constructors
Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-531@lists.php.net to get a copy of this message
Hi, I let run a little script searching for class constructors returning anything or assigning anything to $this, which is important for PHP5 compatibility and is also a bad habit in PHP4, for what it's worth - however that's just the result for my locally installed packages: ---#--- File w:\php\pear\Tree\OptionsDB.php: Class' Tree_OptionsDB constructor might return: return $res; File w:\php\pear\Tree\Memory\XML.php: Class' Tree_Memory_XML constructor might return: return $this->raiseError("No filename passed."); File w:\php\pear\Science\Chemistry\Atom.php: Class' Science_Chemistry_Atom constructor might return: return null; return null; File w:\php\pear\Science\Chemistry\Residue_PDB.php: Class' Science_Chemistry_Residue_PDB constructor might return: return null; File w:\php\pear\Net\Dig.php: Class' Net_Dig constructor might return: $this = new PEAR_Error("Couldn't find system dig program"); File w:\php\pear\Net\LDAP\Schema.php: Class' Net_LDAP_Schema constructor might return: return false; return false; File w:\php\pear\Net\DNS\RR.php: Class' Net_DNS_RR constructor might return: $this = $this->new_from_string($rrdata); $this = $this->new_from_data($name, $rrtype, $rrclass, $ttl, $rdlength, $data, $offset); $this = $this->new_from_array($rrdata); File w:\php\pear\Net\DNS\RR\AAAA.php: Class' Net_DNS_RR_AAAA constructor might return: return; File w:\php\pear\Mail\Queue\Container\db.php: Class' Mail_Queue_Container_db constructor might return: return new Mail_Queue_Error('No dsn specified!', __FILE__, __LINE__); return new Mail_Queue_Error('DB::connect failed: ' . DB::errorMessage($this->db), __FILE__, __LINE__); File w:\php\pear\HTML\Table.php: Class' HTML_Table constructor might return: return PEAR::raiseError("HTML_Table version " . $this->apiVersion() . " requires " . "HTML_Common version $commonVersion or greater.", 0, PEAR_ERROR_TRIGGER); File w:\php\pear\Cache\Container\db.php: Class' Cache_Container_db constructor might return: return new Cache_Error('No dsn specified!', __FILE__, __LINE__); return new Cache_Error('No dsn specified!', __FILE__, __LINE__); return new Cache_Error('DB::connect failed: ' . DB::errorMessage($this->db), __FILE__, __LINE__); File w:\php\pear\Cache\Container\dbx.php: Class' Cache_Container_dbx constructor might return: return new Cache_Error('No options specified!', __FILE__, __LINE__); return new Cache_Error('No module specified!', __FILE__, __LINE__); return new Cache_Error('DBx connect failed: ' . dbx_error($this->db), __FILE__, __LINE__); File w:\php\pear\Cache\Container\mdb.php: Class' Cache_Container_mdb constructor might return: return new Cache_Error('MDB::connect failed: ' . $this->db->getMessage(), __FILE__, __LINE__); File w:\php\pear\Auth\Container\IMAP.php: Class' Auth_Container_IMAP constructor might return: return PEAR::raiseError("Cannot use IMAP authentication, IMAP extension not loaded!", 41, PEAR_ERROR_DIE); return true; File w:\php\pear\Auth\Container\SMBPasswd.php: Class' Auth_Container_SMBPasswd constructor might return: return; ---#--- Regards, -- Michael - < mike(@)php.net >

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.pear.qa (#531) next »