Covert singleton class for php 4.4.4 to php 5.2 [modified]
-
Hi, In my project there is singleton pattern used in php 4.4.4 and also Smarty used to display pages. Now we want to convert php 4.4.4 to 5.2.0 or above. There is error occurred in singleton pattern like below. "Non-static method" PaDbConnection::getInstance() should not be called statically in config.inc.php on line 177. In config.php line no 177 is like below. $db =& PaDbConnection::getInstance(); So I need help that how to modify the singleton class related to php5.2.0. anyone help me.
modified on Friday, July 3, 2009 12:22 AM
-
Hi, In my project there is singleton pattern used in php 4.4.4 and also Smarty used to display pages. Now we want to convert php 4.4.4 to 5.2.0 or above. There is error occurred in singleton pattern like below. "Non-static method" PaDbConnection::getInstance() should not be called statically in config.inc.php on line 177. In config.php line no 177 is like below. $db =& PaDbConnection::getInstance(); So I need help that how to modify the singleton class related to php5.2.0. anyone help me.
modified on Friday, July 3, 2009 12:22 AM
Go to php.net and check the release notes for all version of php between 4.4.4 and 5.2.0. In there you will find all the commands that have changed - and thus you should be able to find and fix your error. You should also get an error message that tells you what line is causing the error. that may help you in finding deprecated and removed commands.