Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. Covert singleton class for php 4.4.4 to php 5.2 [modified]

Covert singleton class for php 4.4.4 to php 5.2 [modified]

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
helpphpdatabaseregextutorial
2 Posts 2 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    malrajphp
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • M malrajphp

      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

      M Offline
      M Offline
      Marc Firth
      wrote on last edited by
      #2

      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.

      Neonlight

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups