DLB:code_rules_ref
SRC:wiki.dolibarr.org/lang_dev_rules
PHP:
COMPAT: php>=7.1 db:mysql>=5.7|maria|pgsql os:win|linux|mac
FILE: ext:.php fmt:lf tag:<?php_only hdr:copyright_req
STYLE: psr:12 exc:
- tabs_ok
- long_decl_ok
- max_line=1000
STR: concat:"txt ".$var cmt://|/**/ ret:ok>=0|err<0
INC: include_once:.class.php|.lib.php include:.inc.php|.tpl.php
FORBID: dead_code select* short_tags
INPUT: never:$_GET|$_POST use:GETPOST
EX: id=GETPOST('id','int') ref=GETPOST('ref','alpha') txt=GETPOST('txt','alphanohtml')
GLOBALS: db user conf langs mysoc hookmanager extrafields
REQ: core:require_once(DOL_DOCUMENT_ROOT...) mod:dol_include_once(...)
LOG: dol_syslog(msg,LOG_INFO|DEBUG|WARNING|ERR)
DATE: now:dol_now() mk:dol_mktime() fmt:dol_print_date() str2ts:dol_stringtotime() add:dol_time_plus_duree()
SQL_DATE: ts2db:$db->idate() db2ts:$db->jdate()
NOTE: db_dates=php_tz tms=gmt
FLOAT: amount:price2num(v,'MT') other:round()
DIR: base:DOL_DATA_ROOT mk:dol_mkdir()
VER: if:(float)DOL_VERSION>=17 or:versioncompare()
SQL:
TABLE: prefix:llx_ engine:innodb pk:rowid auto_inc
STD_FIELDS: rowid ref entity ref_ext date_creation tms fk_user_creat fk_user_modif import_key status note_private note_public
TYPE: pk|fk:int|bigint bool:smallint amount:double(24,8) vat:double(6,3) qty:real str:varchar(N) ts:timestamp dt:datetime date:date txt:text|mediumtext
FORBID: enum char(1)
KEYS: pk:rowid uk:uk_table_field fk:fk_table_field idx:idx_table_field
FK: soft_only no_db_constraint
SQL_CODE: txn: begin() query() commit|rollback()
SELECT: never:select* never:sql_date_fn use:explicit_fields
FLOW: query num_rows fetch_object free
DATE_SQL: use:dol_now()+idate() never:NOW|SYSDATE|DATEDIFF|DATE
PORT: ifsql:$db->ifsql()
FORBID_SQL: GROUP_CONCAT WITH_ROLLUP DELETE_CASCADE UPDATE_CASCADE triggers stored_proc quoted_numeric
HTML:
RULES: html:not_xhtml attr:lowercase+dq
URL: dol_buildpath()
IMG: img_picto()
LAYOUT: no_forced_width
JS: if($conf->use_javascript_ajax)
POPUP: forbid_except_tooltip
TPL: no_smarty|twig use:tpl.php
CSS: liste_titre=table_hdr pair|impair=alt_rows flat=input button=submit
MVC: ACT: /* Actions */
VIEW: /* View */ llxHeader() llxFooter()
PATTERNS: table_module active_record mvc no_composer libs:embedded