Code Repitition (dev)

Discussion in 'Developers' Forum' started by Tommahawk, Aug 15, 2007.

  1. Tommahawk

    Tommahawk New Member

    It seems that essentially the code required to do things in ISPConfig GUI is the same as remoting except for the php validation logically remoting could simply make a call to the function rather than repeating the code.

    for example
    ispconfig_kunde.lib.php
    ispconfig_isp_kunde.lib.php

    grappling to unify (and successfully unifying) these two files will potentially lead to less errors/bugs.

    There are many such incidents in /home/admispconfig/ispconfig/lib/classes

    Possible the easiest solution....

    ispconfig_kunde.lib.php

    function Add_Kunde_remoting {
    1) code specific to remoting if any
    2) call to Add_Kunde
    }
    function Add_Kunde_ispconfig {
    1) code specific to ispconfiggui if any
    2) call to Add_Kunde
    }
    function Add_Kunde {
    unified procedure (SQL-DB Filesystem)
    }

    Over time and versions aim to unify the three functions into two functions and if possible one universally compatible function where possible and logical
     
    Last edited: Aug 15, 2007
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The code is not the same as the functions in ispconfig_isp_kunde.lib.php are called from ispconfig_kunde.lib.php.

    Please have a deepoer look at the famework to understand how it works. The functions in ispconfig_isp_kunde.lib.php validate the data and the functions in ispconfig_kunde.lib.php insert the data when the remoting fremework is used. When you use the interface, the data is inserted by the form manager.
     

Share This Page