dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dolibarr-dev] Backward compatibility old php version


From: Gustavo Novaro
Subject: [Dolibarr-dev] Backward compatibility old php version
Date: Wed, 11 May 2011 14:12:00 -0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]