@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | return $line; |
379 | 379 | } |
380 | 380 | |
381 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
381 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
382 | 382 | /** |
383 | 383 | * Select a database |
384 | 384 | * PostgreSQL does not have an equivalent for `mysql_select_db` |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | */ |
390 | 390 | public function select_db($database) |
391 | 391 | { |
392 | - // phpcs:enable |
|
392 | + // phpcs:enable |
|
393 | 393 | if ($database == $this->database_name) { |
394 | 394 | return true; |
395 | 395 | } else { |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | return $ret; |
587 | 587 | } |
588 | 588 | |
589 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
589 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
590 | 590 | /** |
591 | 591 | * Returns the current line (as an object) for the resultset cursor |
592 | 592 | * |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | */ |
596 | 596 | public function fetch_object($resultset) |
597 | 597 | { |
598 | - // phpcs:enable |
|
598 | + // phpcs:enable |
|
599 | 599 | // If resultset not provided, we take the last used by connection |
600 | 600 | if (!is_resource($resultset) && !is_object($resultset)) { |
601 | 601 | $resultset = $this->_results; |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | return pg_fetch_object($resultset); |
604 | 604 | } |
605 | 605 | |
606 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
606 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
607 | 607 | /** |
608 | 608 | * Return datas as an array |
609 | 609 | * |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | */ |
613 | 613 | public function fetch_array($resultset) |
614 | 614 | { |
615 | - // phpcs:enable |
|
615 | + // phpcs:enable |
|
616 | 616 | // If resultset not provided, we take the last used by connection |
617 | 617 | if (!is_resource($resultset) && !is_object($resultset)) { |
618 | 618 | $resultset = $this->_results; |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | return pg_fetch_array($resultset); |
621 | 621 | } |
622 | 622 | |
623 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
623 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
624 | 624 | /** |
625 | 625 | * Return datas as an array |
626 | 626 | * |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | */ |
630 | 630 | public function fetch_row($resultset) |
631 | 631 | { |
632 | - // phpcs:enable |
|
632 | + // phpcs:enable |
|
633 | 633 | // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connection |
634 | 634 | if (!is_resource($resultset) && !is_object($resultset)) { |
635 | 635 | $resultset = $this->_results; |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | return pg_fetch_row($resultset); |
638 | 638 | } |
639 | 639 | |
640 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
640 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
641 | 641 | /** |
642 | 642 | * Return number of lines for result of a SELECT |
643 | 643 | * |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | */ |
648 | 648 | public function num_rows($resultset) |
649 | 649 | { |
650 | - // phpcs:enable |
|
650 | + // phpcs:enable |
|
651 | 651 | // If resultset not provided, we take the last used by connection |
652 | 652 | if (!is_resource($resultset) && !is_object($resultset)) { |
653 | 653 | $resultset = $this->_results; |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | return pg_num_rows($resultset); |
656 | 656 | } |
657 | 657 | |
658 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
658 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
659 | 659 | /** |
660 | 660 | * Return the number of lines in the result of a request INSERT, DELETE or UPDATE |
661 | 661 | * |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | */ |
666 | 666 | public function affected_rows($resultset) |
667 | 667 | { |
668 | - // phpcs:enable |
|
668 | + // phpcs:enable |
|
669 | 669 | // If resultset not provided, we take the last used by connection |
670 | 670 | if (!is_resource($resultset) && !is_object($resultset)) { |
671 | 671 | $resultset = $this->_results; |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | return pg_last_error($this->db); |
847 | 847 | } |
848 | 848 | |
849 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
849 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
850 | 850 | /** |
851 | 851 | * Get last ID after an insert INSERT |
852 | 852 | * |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | */ |
857 | 857 | public function last_insert_id($tab, $fieldid = 'rowid') |
858 | 858 | { |
859 | - // phpcs:enable |
|
859 | + // phpcs:enable |
|
860 | 860 | //$result = pg_query($this->db,"SELECT MAX(".$fieldid.") FROM ".$tab); |
861 | 861 | $result = pg_query($this->db, "SELECT currval('" . $tab . "_" . $fieldid . "_seq')"); |
862 | 862 | if (!$result) { |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | } |
913 | 913 | |
914 | 914 | |
915 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
915 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
916 | 916 | /** |
917 | 917 | * Return connection ID |
918 | 918 | * |
@@ -920,13 +920,13 @@ discard block |
||
920 | 920 | */ |
921 | 921 | public function DDLGetConnectId() |
922 | 922 | { |
923 | - // phpcs:enable |
|
923 | + // phpcs:enable |
|
924 | 924 | return '?'; |
925 | 925 | } |
926 | 926 | |
927 | 927 | |
928 | 928 | |
929 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
929 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
930 | 930 | /** |
931 | 931 | * Create a new database |
932 | 932 | * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | */ |
941 | 941 | public function DDLCreateDb($database, $charset = '', $collation = '', $owner = '') |
942 | 942 | { |
943 | - // phpcs:enable |
|
943 | + // phpcs:enable |
|
944 | 944 | if (empty($charset)) { |
945 | 945 | $charset = $this->forcecharset; |
946 | 946 | } |
@@ -960,7 +960,7 @@ discard block |
||
960 | 960 | return $ret; |
961 | 961 | } |
962 | 962 | |
963 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
963 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
964 | 964 | /** |
965 | 965 | * List tables into a database |
966 | 966 | * |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | */ |
971 | 971 | public function DDLListTables($database, $table = '') |
972 | 972 | { |
973 | - // phpcs:enable |
|
973 | + // phpcs:enable |
|
974 | 974 | $listtables = array(); |
975 | 975 | |
976 | 976 | $escapedlike = ''; |
@@ -988,7 +988,7 @@ discard block |
||
988 | 988 | return $listtables; |
989 | 989 | } |
990 | 990 | |
991 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
991 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
992 | 992 | /** |
993 | 993 | * List tables into a database |
994 | 994 | * |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | */ |
999 | 999 | public function DDLListTablesFull($database, $table = '') |
1000 | 1000 | { |
1001 | - // phpcs:enable |
|
1001 | + // phpcs:enable |
|
1002 | 1002 | $listtables = array(); |
1003 | 1003 | |
1004 | 1004 | $escapedlike = ''; |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | return $listtables; |
1017 | 1017 | } |
1018 | 1018 | |
1019 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1019 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1020 | 1020 | /** |
1021 | 1021 | * List information of columns into a table. |
1022 | 1022 | * |
@@ -1025,7 +1025,7 @@ discard block |
||
1025 | 1025 | */ |
1026 | 1026 | public function DDLInfoTable($table) |
1027 | 1027 | { |
1028 | - // phpcs:enable |
|
1028 | + // phpcs:enable |
|
1029 | 1029 | $infotables = array(); |
1030 | 1030 | |
1031 | 1031 | $sql = "SELECT "; |
@@ -1054,7 +1054,7 @@ discard block |
||
1054 | 1054 | } |
1055 | 1055 | |
1056 | 1056 | |
1057 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1057 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1058 | 1058 | /** |
1059 | 1059 | * Create a table into database |
1060 | 1060 | * |
@@ -1069,7 +1069,7 @@ discard block |
||
1069 | 1069 | */ |
1070 | 1070 | public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null) |
1071 | 1071 | { |
1072 | - // phpcs:enable |
|
1072 | + // phpcs:enable |
|
1073 | 1073 | // @TODO: $fulltext_keys parameter is unused |
1074 | 1074 | |
1075 | 1075 | $sqlk = array(); |
@@ -1146,7 +1146,7 @@ discard block |
||
1146 | 1146 | } |
1147 | 1147 | } |
1148 | 1148 | |
1149 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1149 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1150 | 1150 | /** |
1151 | 1151 | * Drop a table into database |
1152 | 1152 | * |
@@ -1155,7 +1155,7 @@ discard block |
||
1155 | 1155 | */ |
1156 | 1156 | public function DDLDropTable($table) |
1157 | 1157 | { |
1158 | - // phpcs:enable |
|
1158 | + // phpcs:enable |
|
1159 | 1159 | $tmptable = preg_replace('/[^a-z0-9\.\-\_]/i', '', $table); |
1160 | 1160 | |
1161 | 1161 | $sql = "DROP TABLE " . $this->sanitize($tmptable); |
@@ -1167,7 +1167,7 @@ discard block |
||
1167 | 1167 | } |
1168 | 1168 | } |
1169 | 1169 | |
1170 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1170 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1171 | 1171 | /** |
1172 | 1172 | * Return a pointer of line with description of a table or field |
1173 | 1173 | * |
@@ -1177,7 +1177,7 @@ discard block |
||
1177 | 1177 | */ |
1178 | 1178 | public function DDLDescTable($table, $field = "") |
1179 | 1179 | { |
1180 | - // phpcs:enable |
|
1180 | + // phpcs:enable |
|
1181 | 1181 | $sql = "SELECT attname FROM pg_attribute, pg_type WHERE typname = '" . $this->escape($table) . "' AND attrelid = typrelid"; |
1182 | 1182 | $sql .= " AND attname NOT IN ('cmin', 'cmax', 'ctid', 'oid', 'tableoid', 'xmin', 'xmax')"; |
1183 | 1183 | if ($field) { |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | return $this->_results; |
1190 | 1190 | } |
1191 | 1191 | |
1192 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1192 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1193 | 1193 | /** |
1194 | 1194 | * Create a new field into table |
1195 | 1195 | * |
@@ -1201,7 +1201,7 @@ discard block |
||
1201 | 1201 | */ |
1202 | 1202 | public function DDLAddField($table, $field_name, $field_desc, $field_position = "") |
1203 | 1203 | { |
1204 | - // phpcs:enable |
|
1204 | + // phpcs:enable |
|
1205 | 1205 | // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra |
1206 | 1206 | // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); |
1207 | 1207 | $sql = "ALTER TABLE " . $this->sanitize($table) . " ADD " . $this->sanitize($field_name) . " "; |
@@ -1238,7 +1238,7 @@ discard block |
||
1238 | 1238 | return 1; |
1239 | 1239 | } |
1240 | 1240 | |
1241 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1241 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1242 | 1242 | /** |
1243 | 1243 | * Update format of a field into a table |
1244 | 1244 | * |
@@ -1249,7 +1249,7 @@ discard block |
||
1249 | 1249 | */ |
1250 | 1250 | public function DDLUpdateField($table, $field_name, $field_desc) |
1251 | 1251 | { |
1252 | - // phpcs:enable |
|
1252 | + // phpcs:enable |
|
1253 | 1253 | $sql = "ALTER TABLE " . $this->sanitize($table); |
1254 | 1254 | $sql .= " ALTER COLUMN " . $this->sanitize($field_name) . " TYPE " . $this->sanitize($field_desc['type']); |
1255 | 1255 | if (isset($field_desc['value']) && preg_match("/^[^\s]/i", $field_desc['value'])) { |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | return 1; |
1285 | 1285 | } |
1286 | 1286 | |
1287 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1287 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1288 | 1288 | /** |
1289 | 1289 | * Drop a field from table |
1290 | 1290 | * |
@@ -1294,7 +1294,7 @@ discard block |
||
1294 | 1294 | */ |
1295 | 1295 | public function DDLDropField($table, $field_name) |
1296 | 1296 | { |
1297 | - // phpcs:enable |
|
1297 | + // phpcs:enable |
|
1298 | 1298 | $tmp_field_name = preg_replace('/[^a-z0-9\.\-\_]/i', '', $field_name); |
1299 | 1299 | |
1300 | 1300 | $sql = "ALTER TABLE " . $this->sanitize($table) . " DROP COLUMN " . $this->sanitize($tmp_field_name); |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | return 1; |
1306 | 1306 | } |
1307 | 1307 | |
1308 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1308 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1309 | 1309 | /** |
1310 | 1310 | * Create a user to connect to database |
1311 | 1311 | * |
@@ -1317,7 +1317,7 @@ discard block |
||
1317 | 1317 | */ |
1318 | 1318 | public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name) |
1319 | 1319 | { |
1320 | - // phpcs:enable |
|
1320 | + // phpcs:enable |
|
1321 | 1321 | // Note: using ' on user does not works with pgsql |
1322 | 1322 | $sql = "CREATE USER " . $this->sanitize($dolibarr_main_db_user) . " with password '" . $this->escape($dolibarr_main_db_pass) . "'"; |
1323 | 1323 |
@@ -1110,7 +1110,7 @@ |
||
1110 | 1110 | $sqlfields[$i] .= " " . $this->sanitize($field_desc['extra'], 0, 0, 1); |
1111 | 1111 | } |
1112 | 1112 | if (!empty($primary_key) && $primary_key == $field_name) { |
1113 | - $sqlfields[$i] .= " AUTO_INCREMENT PRIMARY KEY"; // mysql instruction that will be converted by driver late |
|
1113 | + $sqlfields[$i] .= " AUTO_INCREMENT PRIMARY KEY"; // mysql instruction that will be converted by driver late |
|
1114 | 1114 | } |
1115 | 1115 | $i++; |
1116 | 1116 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | |
218 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
218 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
219 | 219 | /** |
220 | 220 | * Select a database |
221 | 221 | * |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public function select_db($database) |
226 | 226 | { |
227 | - // phpcs:enable |
|
227 | + // phpcs:enable |
|
228 | 228 | dol_syslog(get_class($this) . "::select_db database=" . $database, LOG_DEBUG); |
229 | 229 | $result = false; |
230 | 230 | try { |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | return $msg; |
389 | 389 | } |
390 | 390 | |
391 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
391 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
392 | 392 | /** |
393 | 393 | * Returns the current line (as an object) for the resultset cursor |
394 | 394 | * |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | */ |
398 | 398 | public function fetch_object($resultset) |
399 | 399 | { |
400 | - // phpcs:enable |
|
400 | + // phpcs:enable |
|
401 | 401 | // If the resultset was not provided, we get the last one for this connection |
402 | 402 | if (!is_object($resultset)) { |
403 | 403 | $resultset = $this->_results; |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | } |
407 | 407 | |
408 | 408 | |
409 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
409 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
410 | 410 | /** |
411 | 411 | * Return datas as an array |
412 | 412 | * |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | */ |
416 | 416 | public function fetch_array($resultset) |
417 | 417 | { |
418 | - // phpcs:enable |
|
418 | + // phpcs:enable |
|
419 | 419 | // If resultset not provided, we take the last used by connection |
420 | 420 | if (!is_object($resultset)) { |
421 | 421 | $resultset = $this->_results; |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | return $resultset->fetch_array(); |
424 | 424 | } |
425 | 425 | |
426 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
426 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
427 | 427 | /** |
428 | 428 | * Return datas as an array |
429 | 429 | * |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | */ |
433 | 433 | public function fetch_row($resultset) |
434 | 434 | { |
435 | - // phpcs:enable |
|
435 | + // phpcs:enable |
|
436 | 436 | // If resultset not provided, we take the last used by connection |
437 | 437 | if (!is_bool($resultset)) { |
438 | 438 | if (!is_object($resultset)) { |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | } |
446 | 446 | } |
447 | 447 | |
448 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
448 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
449 | 449 | /** |
450 | 450 | * Return number of lines for result of a SELECT |
451 | 451 | * |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | */ |
456 | 456 | public function num_rows($resultset) |
457 | 457 | { |
458 | - // phpcs:enable |
|
458 | + // phpcs:enable |
|
459 | 459 | // If resultset not provided, we take the last used by connection |
460 | 460 | if (!is_object($resultset)) { |
461 | 461 | $resultset = $this->_results; |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | return isset($resultset->num_rows) ? $resultset->num_rows : 0; |
464 | 464 | } |
465 | 465 | |
466 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
466 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
467 | 467 | /** |
468 | 468 | * Return the number of lines in the result of a request INSERT, DELETE or UPDATE |
469 | 469 | * |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | */ |
474 | 474 | public function affected_rows($resultset) |
475 | 475 | { |
476 | - // phpcs:enable |
|
476 | + // phpcs:enable |
|
477 | 477 | // If resultset not provided, we take the last used by connection |
478 | 478 | if (!is_object($resultset)) { |
479 | 479 | $resultset = $this->_results; |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | } |
592 | 592 | } |
593 | 593 | |
594 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
594 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
595 | 595 | /** |
596 | 596 | * Get last ID after an insert INSERT |
597 | 597 | * |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | */ |
602 | 602 | public function last_insert_id($tab, $fieldid = 'rowid') |
603 | 603 | { |
604 | - // phpcs:enable |
|
604 | + // phpcs:enable |
|
605 | 605 | return $this->db->insert_id; |
606 | 606 | } |
607 | 607 | |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | } |
667 | 667 | |
668 | 668 | |
669 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
669 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
670 | 670 | /** |
671 | 671 | * Return connection ID |
672 | 672 | * |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | */ |
675 | 675 | public function DDLGetConnectId() |
676 | 676 | { |
677 | - // phpcs:enable |
|
677 | + // phpcs:enable |
|
678 | 678 | $resql = $this->query('SELECT CONNECTION_ID()'); |
679 | 679 | if ($resql) { |
680 | 680 | $row = $this->fetch_row($resql); |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | } |
685 | 685 | } |
686 | 686 | |
687 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
687 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
688 | 688 | /** |
689 | 689 | * Create a new database |
690 | 690 | * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | */ |
699 | 699 | public function DDLCreateDb($database, $charset = '', $collation = '', $owner = '') |
700 | 700 | { |
701 | - // phpcs:enable |
|
701 | + // phpcs:enable |
|
702 | 702 | if (empty($charset)) { |
703 | 703 | $charset = $this->forcecharset; |
704 | 704 | } |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | return $ret; |
723 | 723 | } |
724 | 724 | |
725 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
725 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
726 | 726 | /** |
727 | 727 | * List tables into a database |
728 | 728 | * |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | */ |
733 | 733 | public function DDLListTables($database, $table = '') |
734 | 734 | { |
735 | - // phpcs:enable |
|
735 | + // phpcs:enable |
|
736 | 736 | $listtables = array(); |
737 | 737 | |
738 | 738 | $like = ''; |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | return $listtables; |
755 | 755 | } |
756 | 756 | |
757 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
757 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
758 | 758 | /** |
759 | 759 | * List tables into a database |
760 | 760 | * |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | */ |
765 | 765 | public function DDLListTablesFull($database, $table = '') |
766 | 766 | { |
767 | - // phpcs:enable |
|
767 | + // phpcs:enable |
|
768 | 768 | $listtables = array(); |
769 | 769 | |
770 | 770 | $like = ''; |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | return $listtables; |
787 | 787 | } |
788 | 788 | |
789 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
789 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
790 | 790 | /** |
791 | 791 | * List information of columns into a table. |
792 | 792 | * |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | */ |
796 | 796 | public function DDLInfoTable($table) |
797 | 797 | { |
798 | - // phpcs:enable |
|
798 | + // phpcs:enable |
|
799 | 799 | $infotables = array(); |
800 | 800 | |
801 | 801 | $tmptable = preg_replace('/[^a-z0-9\.\-\_]/i', '', $table); |
@@ -812,7 +812,7 @@ discard block |
||
812 | 812 | return $infotables; |
813 | 813 | } |
814 | 814 | |
815 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
815 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
816 | 816 | /** |
817 | 817 | * Create a table into database |
818 | 818 | * |
@@ -827,7 +827,7 @@ discard block |
||
827 | 827 | */ |
828 | 828 | public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null) |
829 | 829 | { |
830 | - // phpcs:enable |
|
830 | + // phpcs:enable |
|
831 | 831 | // @TODO: $fulltext_keys parameter is unused |
832 | 832 | |
833 | 833 | if (empty($type)) { |
@@ -909,7 +909,7 @@ discard block |
||
909 | 909 | } |
910 | 910 | } |
911 | 911 | |
912 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
912 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
913 | 913 | /** |
914 | 914 | * Drop a table into database |
915 | 915 | * |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | */ |
919 | 919 | public function DDLDropTable($table) |
920 | 920 | { |
921 | - // phpcs:enable |
|
921 | + // phpcs:enable |
|
922 | 922 | $tmptable = preg_replace('/[^a-z0-9\.\-\_]/i', '', $table); |
923 | 923 | |
924 | 924 | $sql = "DROP TABLE " . $this->sanitize($tmptable); |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | } |
931 | 931 | } |
932 | 932 | |
933 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
933 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
934 | 934 | /** |
935 | 935 | * Return a pointer of line with description of a table or field |
936 | 936 | * |
@@ -940,7 +940,7 @@ discard block |
||
940 | 940 | */ |
941 | 941 | public function DDLDescTable($table, $field = "") |
942 | 942 | { |
943 | - // phpcs:enable |
|
943 | + // phpcs:enable |
|
944 | 944 | $sql = "DESC " . $this->sanitize($table) . " " . $this->sanitize($field); |
945 | 945 | |
946 | 946 | dol_syslog(get_class($this) . "::DDLDescTable " . $sql, LOG_DEBUG); |
@@ -948,7 +948,7 @@ discard block |
||
948 | 948 | return $this->_results; |
949 | 949 | } |
950 | 950 | |
951 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
951 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
952 | 952 | /** |
953 | 953 | * Create a new field into table |
954 | 954 | * |
@@ -960,7 +960,7 @@ discard block |
||
960 | 960 | */ |
961 | 961 | public function DDLAddField($table, $field_name, $field_desc, $field_position = "") |
962 | 962 | { |
963 | - // phpcs:enable |
|
963 | + // phpcs:enable |
|
964 | 964 | // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra |
965 | 965 | // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); |
966 | 966 | $sql = "ALTER TABLE " . $this->sanitize($table) . " ADD " . $this->sanitize($field_name) . " "; |
@@ -997,7 +997,7 @@ discard block |
||
997 | 997 | return -1; |
998 | 998 | } |
999 | 999 | |
1000 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1000 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1001 | 1001 | /** |
1002 | 1002 | * Update format of a field into a table |
1003 | 1003 | * |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | */ |
1009 | 1009 | public function DDLUpdateField($table, $field_name, $field_desc) |
1010 | 1010 | { |
1011 | - // phpcs:enable |
|
1011 | + // phpcs:enable |
|
1012 | 1012 | $sql = "ALTER TABLE " . $this->sanitize($table); |
1013 | 1013 | $sql .= " MODIFY COLUMN " . $this->sanitize($field_name) . " " . $this->sanitize($field_desc['type']); |
1014 | 1014 | if (in_array($field_desc['type'], array('double', 'tinyint', 'int', 'varchar')) && $field_desc['value']) { |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | } |
1044 | 1044 | } |
1045 | 1045 | |
1046 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1046 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1047 | 1047 | /** |
1048 | 1048 | * Drop a field from table |
1049 | 1049 | * |
@@ -1053,7 +1053,7 @@ discard block |
||
1053 | 1053 | */ |
1054 | 1054 | public function DDLDropField($table, $field_name) |
1055 | 1055 | { |
1056 | - // phpcs:enable |
|
1056 | + // phpcs:enable |
|
1057 | 1057 | $tmp_field_name = preg_replace('/[^a-z0-9\.\-\_]/i', '', $field_name); |
1058 | 1058 | |
1059 | 1059 | $sql = "ALTER TABLE " . $this->sanitize($table) . " DROP COLUMN `" . $this->sanitize($tmp_field_name) . "`"; |
@@ -1065,7 +1065,7 @@ discard block |
||
1065 | 1065 | } |
1066 | 1066 | |
1067 | 1067 | |
1068 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1068 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1069 | 1069 | /** |
1070 | 1070 | * Create a user and privileges to connect to database (even if database does not exists yet) |
1071 | 1071 | * |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | */ |
1078 | 1078 | public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name) |
1079 | 1079 | { |
1080 | - // phpcs:enable |
|
1080 | + // phpcs:enable |
|
1081 | 1081 | $sql = "CREATE USER '" . $this->escape($dolibarr_main_db_user) . "' IDENTIFIED BY '" . $this->escape($dolibarr_main_db_pass) . "'"; |
1082 | 1082 | dol_syslog(get_class($this) . "::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log |
1083 | 1083 | $resql = $this->query($sql); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $clientmustbe = 'utf8'; |
121 | 121 | } |
122 | 122 | |
123 | - $disableforcecharset = 0; // Set to 1 to test without charset forcing |
|
123 | + $disableforcecharset = 0; // Set to 1 to test without charset forcing |
|
124 | 124 | if (empty($disableforcecharset) && $this->db->character_set_name() != $clientmustbe) { |
125 | 125 | try { |
126 | 126 | //print "You should set the \$dolibarr_main_db_character_set and \$dolibarr_main_db_collation for the PHP to the one of the database ".$this->db->character_set_name(); |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | $sqlfields[$i] .= " " . $this->sanitize($field_desc['extra'], 0, 0, 1); |
874 | 874 | } |
875 | 875 | if (!empty($primary_key) && $primary_key == $field_name) { |
876 | - $sqlfields[$i] .= " AUTO_INCREMENT PRIMARY KEY"; // mysql instruction that will be converted by driver late |
|
876 | + $sqlfields[$i] .= " AUTO_INCREMENT PRIMARY KEY"; // mysql instruction that will be converted by driver late |
|
877 | 877 | } |
878 | 878 | $i++; |
879 | 879 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | return $line; |
298 | 298 | } |
299 | 299 | |
300 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
300 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
301 | 301 | /** |
302 | 302 | * Select a database |
303 | 303 | * |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | */ |
307 | 307 | public function select_db($database) |
308 | 308 | { |
309 | - // phpcs:enable |
|
309 | + // phpcs:enable |
|
310 | 310 | dol_syslog(get_class($this) . "::select_db database=" . $database, LOG_DEBUG); |
311 | 311 | // sqlite_select_db() does not exist |
312 | 312 | //return sqlite_select_db($this->db,$database); |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | return $ret; |
514 | 514 | } |
515 | 515 | |
516 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
516 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
517 | 517 | /** |
518 | 518 | * Returns the current line (as an object) for the resultset cursor |
519 | 519 | * |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | */ |
523 | 523 | public function fetch_object($resultset) |
524 | 524 | { |
525 | - // phpcs:enable |
|
525 | + // phpcs:enable |
|
526 | 526 | // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connection |
527 | 527 | if (!is_object($resultset)) { |
528 | 528 | $resultset = $this->_results; |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | } |
537 | 537 | |
538 | 538 | |
539 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
539 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
540 | 540 | /** |
541 | 541 | * Return datas as an array |
542 | 542 | * |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | */ |
546 | 546 | public function fetch_array($resultset) |
547 | 547 | { |
548 | - // phpcs:enable |
|
548 | + // phpcs:enable |
|
549 | 549 | // If resultset not provided, we take the last used by connection |
550 | 550 | if (!is_object($resultset)) { |
551 | 551 | $resultset = $this->_results; |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | return $ret; |
556 | 556 | } |
557 | 557 | |
558 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
558 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
559 | 559 | /** |
560 | 560 | * Return datas as an array |
561 | 561 | * |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | */ |
565 | 565 | public function fetch_row($resultset) |
566 | 566 | { |
567 | - // phpcs:enable |
|
567 | + // phpcs:enable |
|
568 | 568 | // If resultset not provided, we take the last used by connection |
569 | 569 | if (!is_bool($resultset)) { |
570 | 570 | if (!is_object($resultset)) { |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | } |
578 | 578 | } |
579 | 579 | |
580 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
580 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
581 | 581 | /** |
582 | 582 | * Return number of lines for result of a SELECT |
583 | 583 | * |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | */ |
588 | 588 | public function num_rows($resultset) |
589 | 589 | { |
590 | - // phpcs:enable |
|
590 | + // phpcs:enable |
|
591 | 591 | |
592 | 592 | // If resultset not provided, we take the last used by connection |
593 | 593 | if (!is_object($resultset)) { |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | return 0; |
600 | 600 | } |
601 | 601 | |
602 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
602 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
603 | 603 | /** |
604 | 604 | * Return number of lines for result of a SELECT |
605 | 605 | * |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | */ |
610 | 610 | public function affected_rows($resultset) |
611 | 611 | { |
612 | - // phpcs:enable |
|
612 | + // phpcs:enable |
|
613 | 613 | |
614 | 614 | // If resultset not provided, we take the last used by connection |
615 | 615 | if (!is_object($resultset)) { |
@@ -748,7 +748,7 @@ discard block |
||
748 | 748 | } |
749 | 749 | } |
750 | 750 | |
751 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
751 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
752 | 752 | /** |
753 | 753 | * Get last ID after an insert INSERT |
754 | 754 | * |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | */ |
759 | 759 | public function last_insert_id($tab, $fieldid = 'rowid') |
760 | 760 | { |
761 | - // phpcs:enable |
|
761 | + // phpcs:enable |
|
762 | 762 | return $this->db->lastInsertRowId(); |
763 | 763 | } |
764 | 764 | |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | } |
824 | 824 | |
825 | 825 | |
826 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
826 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
827 | 827 | /** |
828 | 828 | * Return connection ID |
829 | 829 | * |
@@ -831,12 +831,12 @@ discard block |
||
831 | 831 | */ |
832 | 832 | public function DDLGetConnectId() |
833 | 833 | { |
834 | - // phpcs:enable |
|
834 | + // phpcs:enable |
|
835 | 835 | return '?'; |
836 | 836 | } |
837 | 837 | |
838 | 838 | |
839 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
839 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
840 | 840 | /** |
841 | 841 | * Create a new database |
842 | 842 | * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | */ |
851 | 851 | public function DDLCreateDb($database, $charset = '', $collation = '', $owner = '') |
852 | 852 | { |
853 | - // phpcs:enable |
|
853 | + // phpcs:enable |
|
854 | 854 | if (empty($charset)) { |
855 | 855 | $charset = $this->forcecharset; |
856 | 856 | } |
@@ -868,7 +868,7 @@ discard block |
||
868 | 868 | return $ret; |
869 | 869 | } |
870 | 870 | |
871 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
871 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
872 | 872 | /** |
873 | 873 | * List tables into a database |
874 | 874 | * |
@@ -878,7 +878,7 @@ discard block |
||
878 | 878 | */ |
879 | 879 | public function DDLListTables($database, $table = '') |
880 | 880 | { |
881 | - // phpcs:enable |
|
881 | + // phpcs:enable |
|
882 | 882 | $listtables = array(); |
883 | 883 | |
884 | 884 | $like = ''; |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | return $listtables; |
901 | 901 | } |
902 | 902 | |
903 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
903 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
904 | 904 | /** |
905 | 905 | * List tables into a database with table type |
906 | 906 | * |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | */ |
911 | 911 | public function DDLListTablesFull($database, $table = '') |
912 | 912 | { |
913 | - // phpcs:enable |
|
913 | + // phpcs:enable |
|
914 | 914 | $listtables = array(); |
915 | 915 | |
916 | 916 | $like = ''; |
@@ -932,7 +932,7 @@ discard block |
||
932 | 932 | return $listtables; |
933 | 933 | } |
934 | 934 | |
935 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
935 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
936 | 936 | /** |
937 | 937 | * List information of columns into a table. |
938 | 938 | * |
@@ -942,7 +942,7 @@ discard block |
||
942 | 942 | */ |
943 | 943 | public function DDLInfoTable($table) |
944 | 944 | { |
945 | - // phpcs:enable |
|
945 | + // phpcs:enable |
|
946 | 946 | $infotables = array(); |
947 | 947 | |
948 | 948 | $tmptable = preg_replace('/[^a-z0-9\.\-\_]/i', '', $table); |
@@ -959,7 +959,7 @@ discard block |
||
959 | 959 | return $infotables; |
960 | 960 | } |
961 | 961 | |
962 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
962 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
963 | 963 | /** |
964 | 964 | * Create a table into database |
965 | 965 | * |
@@ -974,7 +974,7 @@ discard block |
||
974 | 974 | */ |
975 | 975 | public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null) |
976 | 976 | { |
977 | - // phpcs:enable |
|
977 | + // phpcs:enable |
|
978 | 978 | // @TODO: $fulltext_keys parameter is unused |
979 | 979 | |
980 | 980 | $sqlk = array(); |
@@ -1054,7 +1054,7 @@ discard block |
||
1054 | 1054 | } |
1055 | 1055 | } |
1056 | 1056 | |
1057 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1057 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1058 | 1058 | /** |
1059 | 1059 | * Drop a table into database |
1060 | 1060 | * |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | */ |
1064 | 1064 | public function DDLDropTable($table) |
1065 | 1065 | { |
1066 | - // phpcs:enable |
|
1066 | + // phpcs:enable |
|
1067 | 1067 | $tmptable = preg_replace('/[^a-z0-9\.\-\_]/i', '', $table); |
1068 | 1068 | |
1069 | 1069 | $sql = "DROP TABLE " . $tmptable; |
@@ -1075,7 +1075,7 @@ discard block |
||
1075 | 1075 | } |
1076 | 1076 | } |
1077 | 1077 | |
1078 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1078 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1079 | 1079 | /** |
1080 | 1080 | * Return a pointer of line with description of a table or field |
1081 | 1081 | * |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | */ |
1086 | 1086 | public function DDLDescTable($table, $field = "") |
1087 | 1087 | { |
1088 | - // phpcs:enable |
|
1088 | + // phpcs:enable |
|
1089 | 1089 | $sql = "DESC " . $table . " " . $field; |
1090 | 1090 | |
1091 | 1091 | dol_syslog(get_class($this) . "::DDLDescTable " . $sql, LOG_DEBUG); |
@@ -1093,7 +1093,7 @@ discard block |
||
1093 | 1093 | return $this->_results; |
1094 | 1094 | } |
1095 | 1095 | |
1096 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1096 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1097 | 1097 | /** |
1098 | 1098 | * Create a new field into table |
1099 | 1099 | * |
@@ -1105,7 +1105,7 @@ discard block |
||
1105 | 1105 | */ |
1106 | 1106 | public function DDLAddField($table, $field_name, $field_desc, $field_position = "") |
1107 | 1107 | { |
1108 | - // phpcs:enable |
|
1108 | + // phpcs:enable |
|
1109 | 1109 | // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra |
1110 | 1110 | // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); |
1111 | 1111 | $sql = "ALTER TABLE " . $table . " ADD " . $field_name . " "; |
@@ -1142,7 +1142,7 @@ discard block |
||
1142 | 1142 | return 1; |
1143 | 1143 | } |
1144 | 1144 | |
1145 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1145 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1146 | 1146 | /** |
1147 | 1147 | * Update format of a field into a table |
1148 | 1148 | * |
@@ -1153,7 +1153,7 @@ discard block |
||
1153 | 1153 | */ |
1154 | 1154 | public function DDLUpdateField($table, $field_name, $field_desc) |
1155 | 1155 | { |
1156 | - // phpcs:enable |
|
1156 | + // phpcs:enable |
|
1157 | 1157 | $sql = "ALTER TABLE " . $this->sanitize($table); |
1158 | 1158 | $sql .= " MODIFY COLUMN " . $this->sanitize($field_name) . " " . $this->sanitize($field_desc['type']); |
1159 | 1159 | if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { |
@@ -1167,7 +1167,7 @@ discard block |
||
1167 | 1167 | return 1; |
1168 | 1168 | } |
1169 | 1169 | |
1170 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1170 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1171 | 1171 | /** |
1172 | 1172 | * Drop a field from table |
1173 | 1173 | * |
@@ -1177,7 +1177,7 @@ discard block |
||
1177 | 1177 | */ |
1178 | 1178 | public function DDLDropField($table, $field_name) |
1179 | 1179 | { |
1180 | - // phpcs:enable |
|
1180 | + // phpcs:enable |
|
1181 | 1181 | $tmp_field_name = preg_replace('/[^a-z0-9\.\-\_]/i', '', $field_name); |
1182 | 1182 | |
1183 | 1183 | $sql = "ALTER TABLE " . $this->sanitize($table) . " DROP COLUMN `" . $this->sanitize($tmp_field_name) . "`"; |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | } |
1190 | 1190 | |
1191 | 1191 | |
1192 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1192 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1193 | 1193 | /** |
1194 | 1194 | * Create a user and privileges to connect to database (even if database does not exists yet) |
1195 | 1195 | * |
@@ -1201,7 +1201,7 @@ discard block |
||
1201 | 1201 | */ |
1202 | 1202 | public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name) |
1203 | 1203 | { |
1204 | - // phpcs:enable |
|
1204 | + // phpcs:enable |
|
1205 | 1205 | $sql = "INSERT INTO user "; |
1206 | 1206 | $sql .= "(Host,User,password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv,Lock_tables_priv)"; |
1207 | 1207 | $sql .= " VALUES ('" . $this->escape($dolibarr_main_db_host) . "','" . $this->escape($dolibarr_main_db_user) . "',password('" . addslashes($dolibarr_main_db_pass) . "')"; |
@@ -1416,7 +1416,7 @@ discard block |
||
1416 | 1416 | } |
1417 | 1417 | } |
1418 | 1418 | |
1419 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1419 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1420 | 1420 | /** |
1421 | 1421 | * calc_daynr |
1422 | 1422 | * |
@@ -1427,7 +1427,7 @@ discard block |
||
1427 | 1427 | */ |
1428 | 1428 | private static function calc_daynr($year, $month, $day) |
1429 | 1429 | { |
1430 | - // phpcs:enable |
|
1430 | + // phpcs:enable |
|
1431 | 1431 | $y = $year; |
1432 | 1432 | if ($y == 0 && $month == 0) { |
1433 | 1433 | return 0; |
@@ -1442,7 +1442,7 @@ discard block |
||
1442 | 1442 | return (int) ($num + floor($y / 4) - $temp); |
1443 | 1443 | } |
1444 | 1444 | |
1445 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1445 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1446 | 1446 | /** |
1447 | 1447 | * calc_weekday |
1448 | 1448 | * |
@@ -1452,12 +1452,12 @@ discard block |
||
1452 | 1452 | */ |
1453 | 1453 | private static function calc_weekday($daynr, $sunday_first_day_of_week) |
1454 | 1454 | { |
1455 | - // phpcs:enable |
|
1455 | + // phpcs:enable |
|
1456 | 1456 | $ret = (int) floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7); |
1457 | 1457 | return $ret; |
1458 | 1458 | } |
1459 | 1459 | |
1460 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1460 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1461 | 1461 | /** |
1462 | 1462 | * calc_days_in_year |
1463 | 1463 | * |
@@ -1466,11 +1466,11 @@ discard block |
||
1466 | 1466 | */ |
1467 | 1467 | private static function calc_days_in_year($year) |
1468 | 1468 | { |
1469 | - // phpcs:enable |
|
1469 | + // phpcs:enable |
|
1470 | 1470 | return (($year & 3) == 0 && ($year % 100 || ($year % 400 == 0 && $year)) ? 366 : 365); |
1471 | 1471 | } |
1472 | 1472 | |
1473 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1473 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1474 | 1474 | /** |
1475 | 1475 | * calc_week |
1476 | 1476 | * |
@@ -1483,7 +1483,7 @@ discard block |
||
1483 | 1483 | */ |
1484 | 1484 | private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year) |
1485 | 1485 | { |
1486 | - // phpcs:enable |
|
1486 | + // phpcs:enable |
|
1487 | 1487 | $daynr = self::calc_daynr($year, $month, $day); |
1488 | 1488 | $first_daynr = self::calc_daynr($year, 1, 1); |
1489 | 1489 | $monday_first = ($week_behaviour & self::WEEK_MONDAY_FIRST) ? 1 : 0; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function stddevpop($nameoffield); |
49 | 49 | |
50 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
50 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
51 | 51 | /** |
52 | 52 | * Return datas as an array |
53 | 53 | * @TODO deprecate this. Use fetch_object() so you can access a field with its name instead of using an index of position of field. |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @return array Array |
57 | 57 | */ |
58 | 58 | public function fetch_row($resultset); |
59 | - // phpcs:enable |
|
59 | + // phpcs:enable |
|
60 | 60 | |
61 | 61 | /** |
62 | 62 | * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function begin($textinlog = ''); |
84 | 84 | |
85 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
85 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
86 | 86 | /** |
87 | 87 | * Create a new database |
88 | 88 | * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @return bool|SQLite3Result|mysqli_result|resource Resource result of the query to create database if OK, null if KO |
96 | 96 | */ |
97 | 97 | public function DDLCreateDb($database, $charset = '', $collation = '', $owner = ''); |
98 | - // phpcs:enable |
|
98 | + // phpcs:enable |
|
99 | 99 | |
100 | 100 | /** |
101 | 101 | * Return version of database server into an array |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function convertSQLFromMysql($line, $type = 'ddl'); |
115 | 115 | |
116 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
116 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
117 | 117 | /** |
118 | 118 | * Return the number of lines in the result of a request INSERT, DELETE or UPDATE |
119 | 119 | * |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @see num_rows() |
123 | 123 | */ |
124 | 124 | public function affected_rows($resultset); |
125 | - // phpcs:enable |
|
125 | + // phpcs:enable |
|
126 | 126 | |
127 | 127 | /** |
128 | 128 | * Return description of last error |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function error(); |
133 | 133 | |
134 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
134 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
135 | 135 | /** |
136 | 136 | * List tables into a database |
137 | 137 | * |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | * @return array List of tables in an array |
141 | 141 | */ |
142 | 142 | public function DDLListTables($database, $table = ''); |
143 | - // phpcs:enable |
|
143 | + // phpcs:enable |
|
144 | 144 | |
145 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
145 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
146 | 146 | /** |
147 | 147 | * List tables into a database with table type |
148 | 148 | * |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @return array List of tables in an array |
152 | 152 | */ |
153 | 153 | public function DDLListTablesFull($database, $table = ''); |
154 | - // phpcs:enable |
|
154 | + // phpcs:enable |
|
155 | 155 | |
156 | 156 | /** |
157 | 157 | * Return last request executed with query() |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function decrypt($value); |
179 | 179 | |
180 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
180 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
181 | 181 | /** |
182 | 182 | * Return datas as an array |
183 | 183 | * |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | * @return array|null|false Result with row |
186 | 186 | */ |
187 | 187 | public function fetch_array($resultset); |
188 | - // phpcs:enable |
|
188 | + // phpcs:enable |
|
189 | 189 | |
190 | 190 | /** |
191 | 191 | * Return last error label |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | */ |
220 | 220 | public function sanitize($stringtosanitize); |
221 | 221 | |
222 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
222 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
223 | 223 | /** |
224 | 224 | * Get last ID after an insert INSERT |
225 | 225 | * |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * @return int Id of row |
229 | 229 | */ |
230 | 230 | public function last_insert_id($tab, $fieldid = 'rowid'); |
231 | - // phpcs:enable |
|
231 | + // phpcs:enable |
|
232 | 232 | |
233 | 233 | /** |
234 | 234 | * Return full path of restore program |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public function getDefaultCollationDatabase(); |
304 | 304 | |
305 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
305 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
306 | 306 | /** |
307 | 307 | * Return number of lines for result of a SELECT |
308 | 308 | * |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | * @see affected_rows() |
312 | 312 | */ |
313 | 313 | public function num_rows($resultset); |
314 | - // phpcs:enable |
|
314 | + // phpcs:enable |
|
315 | 315 | |
316 | 316 | /** |
317 | 317 | * Return full path of dump program |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | */ |
335 | 335 | public function errno(); |
336 | 336 | |
337 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
337 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
338 | 338 | /** |
339 | 339 | * Create a table into database |
340 | 340 | * |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | * @return int Return integer <0 if KO, >=0 if OK |
349 | 349 | */ |
350 | 350 | public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null); |
351 | - // phpcs:enable |
|
351 | + // phpcs:enable |
|
352 | 352 | |
353 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
353 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
354 | 354 | /** |
355 | 355 | * Drop a table into database |
356 | 356 | * |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | * @return int Return integer <0 if KO, >=0 if OK |
359 | 359 | */ |
360 | 360 | public function DDLDropTable($table); |
361 | - // phpcs:enable |
|
361 | + // phpcs:enable |
|
362 | 362 | |
363 | 363 | /** |
364 | 364 | * Return list of available charset that can be used to store data in database |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | */ |
368 | 368 | public function getListOfCharacterSet(); |
369 | 369 | |
370 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
370 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
371 | 371 | /** |
372 | 372 | * Create a new field into table |
373 | 373 | * |
@@ -378,9 +378,9 @@ discard block |
||
378 | 378 | * @return int Return integer <0 if KO, >0 if OK |
379 | 379 | */ |
380 | 380 | public function DDLAddField($table, $field_name, $field_desc, $field_position = ""); |
381 | - // phpcs:enable |
|
381 | + // phpcs:enable |
|
382 | 382 | |
383 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
383 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
384 | 384 | /** |
385 | 385 | * Drop a field from table |
386 | 386 | * |
@@ -389,9 +389,9 @@ discard block |
||
389 | 389 | * @return int Return integer <0 if KO, >0 if OK |
390 | 390 | */ |
391 | 391 | public function DDLDropField($table, $field_name); |
392 | - // phpcs:enable |
|
392 | + // phpcs:enable |
|
393 | 393 | |
394 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
394 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
395 | 395 | /** |
396 | 396 | * Update format of a field into a table |
397 | 397 | * |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | * @return int Return integer <0 if KO, >0 if OK |
402 | 402 | */ |
403 | 403 | public function DDLUpdateField($table, $field_name, $field_desc); |
404 | - // phpcs:enable |
|
404 | + // phpcs:enable |
|
405 | 405 | |
406 | 406 | /** |
407 | 407 | * Return list of available collation that can be used for database |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | */ |
411 | 411 | public function getListOfCollation(); |
412 | 412 | |
413 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
413 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
414 | 414 | /** |
415 | 415 | * Return a pointer of line with description of a table or field |
416 | 416 | * |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | * @return bool|resource|mysqli_result|SQLite3Result Resource |
420 | 420 | */ |
421 | 421 | public function DDLDescTable($table, $field = ""); |
422 | - // phpcs:enable |
|
422 | + // phpcs:enable |
|
423 | 423 | |
424 | 424 | /** |
425 | 425 | * Return version of database server |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | */ |
436 | 436 | public function getDefaultCharacterSetDatabase(); |
437 | 437 | |
438 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
438 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
439 | 439 | /** |
440 | 440 | * Create a user and privileges to connect to database (even if database does not exists yet) |
441 | 441 | * |
@@ -451,9 +451,9 @@ discard block |
||
451 | 451 | $dolibarr_main_db_pass, |
452 | 452 | $dolibarr_main_db_name |
453 | 453 | ); |
454 | - // phpcs:enable |
|
454 | + // phpcs:enable |
|
455 | 455 | |
456 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
456 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
457 | 457 | /** |
458 | 458 | * List information of columns into a table. |
459 | 459 | * |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | * @return array Array with information on table |
462 | 462 | */ |
463 | 463 | public function DDLInfoTable($table); |
464 | - // phpcs:enable |
|
464 | + // phpcs:enable |
|
465 | 465 | |
466 | 466 | /** |
467 | 467 | * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) |
@@ -515,16 +515,16 @@ discard block |
||
515 | 515 | */ |
516 | 516 | public function lastqueryerror(); |
517 | 517 | |
518 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
518 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
519 | 519 | /** |
520 | 520 | * Return connection ID |
521 | 521 | * |
522 | 522 | * @return string Id connection |
523 | 523 | */ |
524 | 524 | public function DDLGetConnectId(); |
525 | - // phpcs:enable |
|
525 | + // phpcs:enable |
|
526 | 526 | |
527 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
527 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
528 | 528 | /** |
529 | 529 | * Returns the current line (as an object) for the resultset cursor |
530 | 530 | * |
@@ -532,9 +532,9 @@ discard block |
||
532 | 532 | * @return Object|false Object result line or false if KO or end of cursor |
533 | 533 | */ |
534 | 534 | public function fetch_object($resultset); |
535 | - // phpcs:enable |
|
535 | + // phpcs:enable |
|
536 | 536 | |
537 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
537 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
538 | 538 | /** |
539 | 539 | * Select a database |
540 | 540 | * |
@@ -542,5 +542,5 @@ discard block |
||
542 | 542 | * @return boolean true if OK, false if KO |
543 | 543 | */ |
544 | 544 | public function select_db($database); |
545 | - // phpcs:enable |
|
545 | + // phpcs:enable |
|
546 | 546 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | if (!defined('NOBROWSERNOTIF')) { |
51 | 51 | define('NOBROWSERNOTIF', '1'); |
52 | 52 | } |
53 | -$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); // Keep $_GET and $_POST here. GETPOST not yet defined. |
|
53 | +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); // Keep $_GET and $_POST here. GETPOST not yet defined. |
|
54 | 54 | if (is_numeric($entity)) { |
55 | 55 | define("DOLENTITY", $entity); |
56 | 56 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | $signature = GETPOST('signaturebase64'); |
63 | 63 | $ref = GETPOST('ref', 'aZ09'); |
64 | -$mode = GETPOST('mode', 'aZ09'); // 'proposal', ... |
|
64 | +$mode = GETPOST('mode', 'aZ09'); // 'proposal', ... |
|
65 | 65 | $SECUREKEY = GETPOST("securekey"); // Secure key |
66 | 66 | $online_sign_name = GETPOST("onlinesignname"); |
67 | 67 | |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | $upload_dir = !empty($conf->propal->multidir_output[$object->entity]) ? $conf->propal->multidir_output[$object->entity] : $conf->propal->dir_output; |
119 | 119 | $upload_dir .= '/' . dol_sanitizeFileName($object->ref) . '/'; |
120 | 120 | |
121 | - $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance |
|
122 | - $default_font = pdf_getPDFFont($langs); // Must be after pdf_getInstance |
|
121 | + $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance |
|
122 | + $default_font = pdf_getPDFFont($langs); // Must be after pdf_getInstance |
|
123 | 123 | $langs->loadLangs(array("main", "companies")); |
124 | 124 | |
125 | 125 | $date = dol_print_date(dol_now(), "%Y%m%d%H%M%S"); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | if (!$error) { |
143 | 143 | // Defined modele of doc |
144 | 144 | $last_main_doc_file = $object->last_main_doc; |
145 | - $directdownloadlink = $object->getLastMainDocLink('proposal'); // url to download the $object->last_main_doc |
|
145 | + $directdownloadlink = $object->getLastMainDocLink('proposal'); // url to download the $object->last_main_doc |
|
146 | 146 | |
147 | 147 | if (preg_match('/\.pdf/i', $last_main_doc_file)) { |
148 | 148 | // TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile |
@@ -170,13 +170,13 @@ discard block |
||
170 | 170 | } |
171 | 171 | |
172 | 172 | //$pdf->Open(); |
173 | - $pagecount = $pdf->setSourceFile($sourcefile); // original PDF |
|
173 | + $pagecount = $pdf->setSourceFile($sourcefile); // original PDF |
|
174 | 174 | |
175 | 175 | $param = array(); |
176 | 176 | $param['online_sign_name'] = $online_sign_name; |
177 | 177 | $param['pathtoimage'] = $upload_dir . $filename; |
178 | 178 | |
179 | - $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); |
|
179 | + $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); |
|
180 | 180 | for ($i = 1; $i < ($pagecount + 1); $i++) { |
181 | 181 | try { |
182 | 182 | $tppl = $pdf->importPage($i); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | if (!$error) { |
333 | 333 | // Defined modele of doc |
334 | 334 | $last_main_doc_file = $object->last_main_doc; |
335 | - $directdownloadlink = $object->getLastMainDocLink('contrat'); // url to download the $object->last_main_doc |
|
335 | + $directdownloadlink = $object->getLastMainDocLink('contrat'); // url to download the $object->last_main_doc |
|
336 | 336 | |
337 | 337 | if (preg_match('/\.pdf/i', $last_main_doc_file)) { |
338 | 338 | // TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile |
@@ -360,13 +360,13 @@ discard block |
||
360 | 360 | } |
361 | 361 | |
362 | 362 | //$pdf->Open(); |
363 | - $pagecount = $pdf->setSourceFile($sourcefile); // original PDF |
|
363 | + $pagecount = $pdf->setSourceFile($sourcefile); // original PDF |
|
364 | 364 | |
365 | 365 | $param = array(); |
366 | 366 | $param['online_sign_name'] = $online_sign_name; |
367 | 367 | $param['pathtoimage'] = $upload_dir . $filename; |
368 | 368 | |
369 | - $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); |
|
369 | + $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); |
|
370 | 370 | for ($i = 1; $i < ($pagecount + 1); $i++) { |
371 | 371 | try { |
372 | 372 | $tppl = $pdf->importPage($i); |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | |
444 | 444 | $langs->loadLangs(array("main", "companies")); |
445 | 445 | |
446 | - $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance |
|
446 | + $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance |
|
447 | 447 | $default_font = pdf_getPDFFont($langs); // Must be |
448 | 448 | |
449 | 449 | $date = dol_print_date(dol_now(), "%Y%m%d%H%M%S"); |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | if (!$error) { |
467 | 467 | // Defined modele of doc |
468 | 468 | $last_main_doc_file = $object->last_main_doc; |
469 | - $directdownloadlink = $object->getLastMainDocLink('fichinter'); // url to download the $object->last_main_doc |
|
469 | + $directdownloadlink = $object->getLastMainDocLink('fichinter'); // url to download the $object->last_main_doc |
|
470 | 470 | |
471 | 471 | if (preg_match('/\.pdf/i', $last_main_doc_file)) { |
472 | 472 | // TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile |
@@ -494,13 +494,13 @@ discard block |
||
494 | 494 | } |
495 | 495 | |
496 | 496 | //$pdf->Open(); |
497 | - $pagecount = $pdf->setSourceFile($sourcefile); // original PDF |
|
497 | + $pagecount = $pdf->setSourceFile($sourcefile); // original PDF |
|
498 | 498 | |
499 | 499 | $param = array(); |
500 | 500 | $param['online_sign_name'] = $online_sign_name; |
501 | 501 | $param['pathtoimage'] = $upload_dir . $filename; |
502 | 502 | |
503 | - $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); |
|
503 | + $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); |
|
504 | 504 | for ($i = 1; $i < ($pagecount + 1); $i++) { |
505 | 505 | try { |
506 | 506 | $tppl = $pdf->importPage($i); |
@@ -578,8 +578,8 @@ discard block |
||
578 | 578 | |
579 | 579 | $upload_dir = $conf->societe->multidir_output[$object->thirdparty->entity] . '/' . dol_sanitizeFileName($object->thirdparty->id) . '/'; |
580 | 580 | |
581 | - $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance |
|
582 | - $default_font = pdf_getPDFFont($langs); // Must be after pdf_getInstance |
|
581 | + $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance |
|
582 | + $default_font = pdf_getPDFFont($langs); // Must be after pdf_getInstance |
|
583 | 583 | $langs->loadLangs(array("main", "companies")); |
584 | 584 | |
585 | 585 | $date = dol_print_date(dol_now(), "%Y%m%d%H%M%S"); |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | // Defined modele of doc |
612 | 612 | $last_main_doc_file = $object->last_main_doc; |
613 | 613 | $last_modelpdf = $object->model_pdf; |
614 | - $directdownloadlink = $object->getLastMainDocLink('company'); // url to download the $object->last_main_doc |
|
614 | + $directdownloadlink = $object->getLastMainDocLink('company'); // url to download the $object->last_main_doc |
|
615 | 615 | |
616 | 616 | if (preg_match('/\.pdf/i', $last_main_doc_file)) { |
617 | 617 | $sourcefile = ''; |
@@ -641,9 +641,9 @@ discard block |
||
641 | 641 | } |
642 | 642 | |
643 | 643 | //$pdf->Open(); |
644 | - $pagecount = $pdf->setSourceFile($sourcefile); // original PDF |
|
644 | + $pagecount = $pdf->setSourceFile($sourcefile); // original PDF |
|
645 | 645 | |
646 | - $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); |
|
646 | + $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); |
|
647 | 647 | for ($i = 1; $i < ($pagecount + 1); $i++) { |
648 | 648 | try { |
649 | 649 | $tppl = $pdf->importPage($i); |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | |
785 | 785 | $langs->loadLangs(array("main", "companies")); |
786 | 786 | |
787 | - $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance |
|
787 | + $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance |
|
788 | 788 | $default_font = pdf_getPDFFont($langs); // Must be |
789 | 789 | |
790 | 790 | $date = dol_print_date(dol_now(), "%Y%m%d%H%M%S"); |
@@ -810,11 +810,11 @@ discard block |
||
810 | 810 | if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT . '/' . $object->last_main_doc)) { |
811 | 811 | // It seems document has never been generated, or was generated and then deleted. |
812 | 812 | // So we try to regenerate it with its default template. |
813 | - $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
813 | + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
814 | 814 | $object->generateDocument($defaulttemplate, $langs); |
815 | 815 | } |
816 | 816 | $last_main_doc_file = $object->last_main_doc; |
817 | - $directdownloadlink = $object->getLastMainDocLink('expedition'); // url to download the $object->last_main_doc |
|
817 | + $directdownloadlink = $object->getLastMainDocLink('expedition'); // url to download the $object->last_main_doc |
|
818 | 818 | |
819 | 819 | if (preg_match('/\.pdf/i', $last_main_doc_file)) { |
820 | 820 | // TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile |
@@ -842,13 +842,13 @@ discard block |
||
842 | 842 | } |
843 | 843 | |
844 | 844 | //$pdf->Open(); |
845 | - $pagecount = $pdf->setSourceFile($sourcefile); // original PDF |
|
845 | + $pagecount = $pdf->setSourceFile($sourcefile); // original PDF |
|
846 | 846 | |
847 | 847 | $param = array(); |
848 | 848 | $param['online_sign_name'] = $online_sign_name; |
849 | 849 | $param['pathtoimage'] = $upload_dir . $filename; |
850 | 850 | |
851 | - $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); |
|
851 | + $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); |
|
852 | 852 | for ($i = 1; $i < ($pagecount + 1); $i++) { |
853 | 853 | try { |
854 | 854 | $tppl = $pdf->importPage($i); |
@@ -907,7 +907,7 @@ discard block |
||
907 | 907 | $db->begin(); |
908 | 908 | |
909 | 909 | $sql = "UPDATE " . MAIN_DB_PREFIX . "expedition"; |
910 | - $sql .= " SET signed_status = " . ((int) $object::STATUS_SIGNED) ; |
|
910 | + $sql .= " SET signed_status = " . ((int) $object::STATUS_SIGNED); |
|
911 | 911 | $sql .= " WHERE rowid = " . ((int) $object->id); |
912 | 912 | |
913 | 913 | dol_syslog(__FILE__, LOG_DEBUG); |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | */ |
951 | 951 | function dolPrintSignatureImage(TCPDF $pdf, $langs, $params) |
952 | 952 | { |
953 | - $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance |
|
953 | + $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance |
|
954 | 954 | $default_font = pdf_getPDFFont($langs); // Must be |
955 | 955 | $xforimgstart = $params['xforimgstart']; |
956 | 956 | $yforimgstart = $params['yforimgstart']; |
@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | $boxid = GETPOSTINT('boxid'); |
47 | 47 | $boxorder = GETPOST('boxorder'); |
48 | -$zone = GETPOST('zone'); // Can be '0' or '1' or 'pagename'... |
|
48 | +$zone = GETPOST('zone'); // Can be '0' or '1' or 'pagename'... |
|
49 | 49 | $userid = GETPOSTINT('userid'); |
50 | 50 | |
51 | 51 | // Security check |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | // Load Dolibarr environment |
40 | 40 | require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php'; |
41 | -require_once constant('DOL_DOCUMENT_ROOT') . '/core/class/fileupload.class.php'; // Class to upload common files |
|
41 | +require_once constant('DOL_DOCUMENT_ROOT') . '/core/class/fileupload.class.php'; // Class to upload common files |
|
42 | 42 | require_once constant('DOL_DOCUMENT_ROOT') . '/core/class/genericobject.class.php'; |
43 | 43 | require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/geturl.lib.php'; |
44 | 44 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | if (!empty($user->socid)) { |
64 | 64 | $socid = $user->socid; |
65 | 65 | if (!empty($object->socid) && $socid != $object->socid) { |
66 | - httponly_accessforbidden("Access on object not allowed for this external user."); // This includes the exit. |
|
66 | + httponly_accessforbidden("Access on object not allowed for this external user."); // This includes the exit. |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 |
@@ -93,9 +93,9 @@ |
||
93 | 93 | $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]); |
94 | 94 | $reg = array(); |
95 | 95 | if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) { |
96 | - $InfoFieldList[4] = $reg[1]; // take the sort field |
|
96 | + $InfoFieldList[4] = $reg[1]; // take the sort field |
|
97 | 97 | } |
98 | - $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
98 | + $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field |
|
99 | 99 | |
100 | 100 | $classname = $InfoFieldList[0]; |
101 | 101 | $classpath = $InfoFieldList[1]; |
@@ -94,7 +94,7 @@ |
||
94 | 94 | $response = array(); |
95 | 95 | while ($i < $num) { |
96 | 96 | $obj = $db->fetch_object($resql); |
97 | - $response[] = array('title' => $obj->question,'ref' => $obj->ref,'answer' => dol_escape_htmltag(preg_replace('/\\r|\\r\\n|\\n/', "", $obj->answer)),'url' => $obj->url); |
|
97 | + $response[] = array('title' => $obj->question, 'ref' => $obj->ref, 'answer' => dol_escape_htmltag(preg_replace('/\\r|\\r\\n|\\n/', "", $obj->answer)), 'url' => $obj->url); |
|
98 | 98 | $i++; |
99 | 99 | } |
100 | 100 | } else { |