Language and development rules: Difference between revisions

Jump to navigation Jump to search
Line 393: Line 393:
Do not create tables, on the fly, during execution by a standard user, we mean, during current usage of software.
Do not create tables, on the fly, during execution by a standard user, we mean, during current usage of software.
If you create a module that uses its own table, not available in the default Dolibarr code, then take a look at tutorial [[Module development]]. It explains how to provide new tables with your module, so that, the tables will be created during module activation and not during module usage.
If you create a module that uses its own table, not available in the default Dolibarr code, then take a look at tutorial [[Module development]]. It explains how to provide new tables with your module, so that, the tables will be created during module activation and not during module usage.
== Comparing version ==
If your code need to make different things depending on Dolibarr version, you can use the following tip to detect version
<source lang="php">
$version=preg_split('/[\.-]/',DOL_VERSION);
if (versioncompare($version,array(5,0,-4)) >= 0) { //mycode for 5.0 only; } // For dolibarr 5.0.* (the -4 means we include also alpha, beta, rc and rcX)
</source>


== Logs ==
== Logs ==

Navigation menu