Hi everybody,
When coding in dolibarr i see in all files are coding with old php rules, i promote php 5 and php 4 don't have official support, don't promote old practice like register globals, old php object model.

all classes are codded like this

class Skeleton_class
{
    var $db;                            //!< To store db handler
var $error; //!< To return error code (or message) var $errors=array(); //!< To return several error codes (or messages) //var $element='skeleton'; //!< Id that identify managed objects //var $table_element='skeleton'; //!< Name of table without prefix where object is stored

    var $id;
    var $prop1;
    var $prop2;
...
        function initAsSpecimen()
        {

        }
}
?>

please replace all var in properties for public, private and protected and all methods we have accesors
public function...

All classes or pure php files should not have the closing tag for php "?>", since the compiler will not interpret it and if they have any newline at the end of the interrupt after the execution of scripts, it is good practice to use this promoting the project mediawiki.


_______________________________________________
Dolibarr-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev

Répondre à