From global to singleton

Discussion in 'Developers' Forum' started by bpssoft, Nov 9, 2007.

  1. bpssoft

    bpssoft Banned

    Hello,

    A friend of my told me it's better to work with singleton then global. He have experience with PHP for 6 years, and works fulltime as PHP developer.

    What you all think about it, should we move to singleton?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Generally, I agree with him. From an academic point of programming, a singleton pattern shall be used. But I dont think that we should rewrite all the code now. Using just one global object ($app) and one additional variable ($conf) is not a problem in my opinion. If we start to rewrite everything now, we will have to do many tests again and we will not be able to get a first (at least bety) release at the end of the year.
     
  3. bpssoft

    bpssoft Banned

    That is true,
    We could do it on a later release, The same like changing the PHP 4 codes to PHP 5
     

Share This Page