From c2c8d1be3e50a5876c7f7155bc04eabf0412f072 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Jan 2012 17:22:02 +0100 Subject: [PATCH] Doxygen --- htdocs/core/boxes/box_bookmarks.php | 3 +- htdocs/core/boxes/box_clients.php | 3 +- htdocs/core/boxes/box_commandes.php | 3 +- htdocs/core/boxes/box_comptes.php | 3 +- htdocs/core/boxes/box_contacts.php | 3 +- htdocs/core/boxes/box_contracts.php | 3 +- htdocs/core/boxes/box_external_rss.php | 5 +- htdocs/core/boxes/box_factures.php | 3 +- htdocs/core/boxes/box_factures_fourn.php | 3 +- htdocs/core/boxes/box_factures_fourn_imp.php | 3 +- htdocs/core/boxes/box_factures_imp.php | 3 +- htdocs/core/boxes/box_fournisseurs.php | 3 +- htdocs/core/boxes/box_members.php | 5 +- htdocs/core/boxes/box_osc_client.php | 3 +- htdocs/core/boxes/box_produits.php | 3 +- htdocs/core/boxes/box_propales.php | 3 +- htdocs/core/boxes/box_prospect.php | 3 +- htdocs/core/boxes/box_services_expired.php | 3 +- htdocs/core/boxes/box_services_vendus.php | 3 +- htdocs/core/db/mssql.class.php | 126 +++++----- htdocs/core/db/mysql.class.php | 115 +++++----- htdocs/core/db/mysqli.class.php | 94 ++++---- htdocs/core/db/pgsql.class.php | 11 +- htdocs/core/db/sqlite.class.php | 228 ++++++++++--------- 24 files changed, 347 insertions(+), 288 deletions(-) diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index 0f5872e20ba..9427b64b721 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -25,7 +25,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show bookmarks */ -class box_bookmarks extends ModeleBoxes { +class box_bookmarks extends ModeleBoxes +{ var $boxcode="bookmarks"; var $boximg="object_bookmark"; diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 593d6ca2ce8..3fee3837ef1 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -29,7 +29,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show last thirdparties */ - class box_clients extends ModeleBoxes { + class box_clients extends ModeleBoxes + { var $boxcode="lastcustomers"; var $boximg="object_company"; diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index b61a0685d0b..bea55ca2d9f 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -29,7 +29,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show last orders */ - class box_commandes extends ModeleBoxes { + class box_commandes extends ModeleBoxes + { var $boxcode="lastcustomerorders"; var $boximg="object_order"; diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 4238547c65a..7cc328d6294 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -29,7 +29,8 @@ include_once(DOL_DOCUMENT_ROOT."/compta/bank/class/account.class.php"); /** * Class to manage the box to show last users */ - class box_comptes extends ModeleBoxes { + class box_comptes extends ModeleBoxes + { var $boxcode="currentaccounts"; var $boximg="object_bill"; diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 73808c6277f..36d9448c337 100755 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -30,7 +30,8 @@ include_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); /** * Class to manage the box to show last contacts */ - class box_contacts extends ModeleBoxes { + class box_contacts extends ModeleBoxes + { var $boxcode="lastcontacts"; var $boximg="object_contact"; diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 86ad58486ac..a1c3e673c56 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -27,7 +27,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show last contracts */ - class box_contracts extends ModeleBoxes { + class box_contracts extends ModeleBoxes + { var $boxcode="lastcontracts"; var $boximg="object_contract"; diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index 604349ef8d9..d0dbe88e278 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -31,7 +31,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show RSS feeds */ - class box_external_rss extends ModeleBoxes { + class box_external_rss extends ModeleBoxes + { var $boxcode="lastrssinfos"; var $boximg="object_rss"; @@ -46,7 +47,7 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Constructor - * + * * @param DoliDB $db Database handler */ function box_external_rss($db,$param) diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 9cda954eef5..bcbb167eecb 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -28,7 +28,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show last invoices */ - class box_factures extends ModeleBoxes { + class box_factures extends ModeleBoxes + { var $boxcode="lastcustomerbills"; var $boximg="object_bill"; diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 43ff65f0a30..e30440b4674 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -28,7 +28,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show last supplier invoices */ - class box_factures_fourn extends ModeleBoxes { + class box_factures_fourn extends ModeleBoxes + { var $boxcode="lastsupplierbills"; var $boximg="object_bill"; diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 95eaeeda4b9..dacc305976c 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -27,7 +27,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show not payed suppliers invoices */ - class box_factures_fourn_imp extends ModeleBoxes { + class box_factures_fourn_imp extends ModeleBoxes + { var $boxcode="oldestunpaidsupplierbills"; var $boximg="object_bill"; diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index f265c4c6a52..c0cbcb0be35 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -30,7 +30,8 @@ require_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'); /** * Class to manage the box to show last invoices */ - class box_factures_imp extends ModeleBoxes { + class box_factures_imp extends ModeleBoxes + { var $boxcode="oldestunpaidcustomerbills"; var $boximg="object_bill"; diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 19fa11414d7..15c7bb1ddc3 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -28,7 +28,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show last suppliers */ - class box_fournisseurs extends ModeleBoxes { + class box_fournisseurs extends ModeleBoxes + { var $boxcode="lastsuppliers"; var $boximg="object_company"; diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index e08e910aa4b..2bfb498fd4b 100755 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -29,7 +29,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show last members */ - class box_members extends ModeleBoxes { + class box_members extends ModeleBoxes + { var $boxcode="lastmembers"; var $boximg="object_user"; @@ -96,7 +97,7 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); $memberstatic->nom=$objp->lastname; $memberstatic->prenom=$objp->firstname; - + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT."/adherents/fiche.php?rowid=".$objp->rowid); diff --git a/htdocs/core/boxes/box_osc_client.php b/htdocs/core/boxes/box_osc_client.php index 3f43a4785d8..72c97013881 100644 --- a/htdocs/core/boxes/box_osc_client.php +++ b/htdocs/core/boxes/box_osc_client.php @@ -28,7 +28,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show last customers of shop */ - class box_osc_clients extends ModeleBoxes { + class box_osc_clients extends ModeleBoxes + { var $boxcode="nbofcustomers"; var $boximg="object_company"; diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 8dd89c76661..46fa860eef1 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -30,7 +30,8 @@ include_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); /** * Class to manage the box to show last products */ - class box_produits extends ModeleBoxes { + class box_produits extends ModeleBoxes + { var $boxcode="lastproducts"; var $boximg="object_product"; diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index e02cdfb6fce..fa0afed279f 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -29,7 +29,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show last proposals */ - class box_propales extends ModeleBoxes { + class box_propales extends ModeleBoxes + { var $boxcode="lastpropals"; var $boximg="object_propal"; diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 6c9380ef750..3793694019f 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -31,7 +31,8 @@ include_once(DOL_DOCUMENT_ROOT."/comm/prospect/class/prospect.class.php"); /** * Class to manage the box to show last prospects */ - class box_prospect extends ModeleBoxes { + class box_prospect extends ModeleBoxes + { var $boxcode="lastprospects"; var $boximg="object_company"; diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 4dd7ea79201..4b2e9a857aa 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -27,7 +27,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show expired services */ - class box_services_expired extends ModeleBoxes { + class box_services_expired extends ModeleBoxes + { var $boxcode="expiredservices"; var $boximg="object_contract"; diff --git a/htdocs/core/boxes/box_services_vendus.php b/htdocs/core/boxes/box_services_vendus.php index a5761db0ef0..c99a0c327a2 100644 --- a/htdocs/core/boxes/box_services_vendus.php +++ b/htdocs/core/boxes/box_services_vendus.php @@ -29,7 +29,8 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); /** * Class to manage the box to show last services lines */ - class box_services_vendus extends ModeleBoxes { + class box_services_vendus extends ModeleBoxes + { var $boxcode="lastproductsincontract"; var $boximg="object_product"; diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index a9a3ac1afd4..04952615a0a 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -467,10 +467,11 @@ class DoliDBMssql } /** - \brief Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE - \see num_rows - \param resultset Curseur de la requete voulue - \return int Nombre de lignes + * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE + * + * @param resultset $resultset Curseur de la requete voulue + * @return int Nombre de lignes + * @see num_rows */ function affected_rows($resultset) { @@ -485,8 +486,10 @@ class DoliDBMssql /** - * \brief Libere le dernier resultset utilise sur cette connexion. - * \param resultset Curseur de la requete voulue + * Free last resultset used. + * + * @param resultset $resultset Curseur de la requete voulue + * @return void */ function free($resultset=0) { @@ -498,10 +501,11 @@ class DoliDBMssql /** - * \brief Defini les limites de la requete. - * \param limit nombre maximum de lignes retournees - * \param offset numero de la ligne a partir de laquelle recuperer les ligne - * \return string chaine exprimant la syntax sql de la limite + * Define limits of request + * + * @param int $limit nombre maximum de lignes retournees + * @param int $offset numero de la ligne a partir de laquelle recuperer les ligne + * @return string chaine exprimant la syntax sql de la limite */ function plimit($limit=0,$offset=0) { @@ -514,10 +518,11 @@ class DoliDBMssql /** * Define sort criteria of request - * @param sortfield List of sort fields - * @param sortorder Sort order - * @return string String to provide syntax of a sort sql string - * TODO Mutualized this into a mother class + * + * @param string $sortfield List of sort fields + * @param string $sortorder Sort order + * @return string String to provide syntax of a sort sql string + * TODO Mutualized this into a mother class */ function order($sortfield=0,$sortorder=0) { @@ -543,10 +548,10 @@ class DoliDBMssql /** - * Escape a string to insert data. + * Escape a string to insert data * - * @param stringtoencode String to escape - * @return string String escaped + * @param string $stringtoencode String to escape + * @return string String escaped */ function escape($stringtoencode) { @@ -582,11 +587,12 @@ class DoliDBMssql } /** - * Formate a SQL IF - * @param test chaine test - * @param resok resultat si test egal - * @param resko resultat si test non egal - * @return string chaine formate SQL + * Formate a SQL IF + * + * @param string $test chaine test + * @param string $resok resultat si test egal + * @param string $resko resultat si test non egal + * @return string SQL string */ function ifsql($test,$resok,$resko) { @@ -595,8 +601,9 @@ class DoliDBMssql /** - * \brief Renvoie la derniere requete soumise par la methode query() - * \return lastquery + * Return last request executed with query() + * + * @return string Last query */ function lastquery() { @@ -604,8 +611,9 @@ class DoliDBMssql } /** - \brief Renvoie la derniere requete en erreur - \return string lastqueryerror + * Return last query in error + * + * @return string lastqueryerror */ function lastqueryerror() { @@ -613,8 +621,9 @@ class DoliDBMssql } /** - \brief Renvoie le libelle derniere erreur - \return string lasterror + * Return last error label + * + * @return string lasterror */ function lasterror() { @@ -622,8 +631,9 @@ class DoliDBMssql } /** - \brief Renvoie le code derniere erreur - \return string lasterrno + * Return last error code + * + * @return string lasterrno */ function lasterrno() { @@ -631,16 +641,19 @@ class DoliDBMssql } /** - \brief Renvoie le code erreur generique de l'operation precedente. - \return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * Return generic error code of last operation. + * + * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ function errno() { - if (! $this->connected) { + if (! $this->connected) + { // Si il y a eu echec de connexion, $this->db n'est pas valide. return 'DB_ERROR_FAILED_TO_CONNECT'; } - else { + else + { // Constants to convert a MSSql error code to a generic Dolibarr error code $errorcode_map = array( 1004 => 'DB_ERROR_CANNOT_CREATE', @@ -680,8 +693,9 @@ class DoliDBMssql } /** - \brief Renvoie le texte de l'erreur mssql de l'operation precedente. - \return error_text + * Return description of last error + * + * @return string Error text */ function error() { @@ -717,9 +731,10 @@ class DoliDBMssql /** * Encrypt sensitive data in database * Warning: This function includes the escape, so it must use direct value - * @param fieldorvalue Field name or value to encrypt - * @param withQuotes Return string with quotes - * @return return XXX(field) or XXX('value') or field or 'value' + * + * @param string $fieldorvalue Field name or value to encrypt + * @param int $withQuotes Return string with quotes + * @return return XXX(field) or XXX('value') or field or 'value' */ function encrypt($fieldorvalue, $withQuotes=0) { @@ -736,9 +751,10 @@ class DoliDBMssql } /** - * \brief Decrypt sensitive data in database - * \param value Value to decrypt - * \return return Decrypted value if used + * Decrypt sensitive data in database + * + * @param string $value Value to decrypt + * @return string Decrypted value if used */ function decrypt($value) { @@ -755,12 +771,10 @@ class DoliDBMssql } - // Next function are not required. Only minor features use them. - //-------------------------------------------------------------- - /** - * \brief Renvoie l'id de la connexion - * \return string Id connexion + * Return connexion ID + * + * @return string Id connexion */ function DDLGetConnectId() { @@ -770,15 +784,17 @@ class DoliDBMssql } /** - * \brief Create a new database - * \param database Database name to create - * \param charset Charset used to store data - * \param collation Charset used to sort data - * \return resource resource defined if OK, null if KO - * \remarks Ne pas utiliser les fonctions xxx_create_db (xxx=mssql, ...) car elles sont deprecated - * We force to create database with charset this->forcecharset and collate this->forcecollate + * Create a new database + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate + * + * @param string $database Database name to create + * @param string $charset Charset used to store data + * @param string $collation Charset used to sort data + * @param string $owner Username of database owner + * @return resource resource defined if OK, null if KO */ - function DDLCreateDb($database,$charset='',$collation='') + function DDLCreateDb($database,$charset='',$collation='',$owner='') { // ALTER DATABASE dolibarr_db DEFAULT CHARACTER SET latin DEFAULT COLLATE latin1_swedish_ci $sql = 'CREATE DATABASE '.$database; diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 1ff3a201be2..73850cc70a5 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -446,9 +446,9 @@ class DoliDBMysql /** * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * - * @see num_rows - * @param resultset Curseur de la requete voulue - * @return int Nombre de lignes + * @param resultset $resultset Curseur de la requete voulue + * @return int Nombre de lignes + * @see num_rows */ function affected_rows($resultset) { @@ -461,9 +461,10 @@ class DoliDBMysql /** - * Libere le dernier resultset utilise sur cette connexion. + * Free last resultset used. * - * @param resultset Curseur de la requete voulue + * @param resultset $resultset Curseur de la requete voulue + * @return void */ function free($resultset=0) { @@ -475,11 +476,11 @@ class DoliDBMysql /** - * Defini les limites de la requete + * Define limits of request * - * @param limit nombre maximum de lignes retournees - * @param offset numero de la ligne a partir de laquelle recuperer les ligne - * @return string chaine exprimant la syntax sql de la limite + * @param int $limit nombre maximum de lignes retournees + * @param int $offset numero de la ligne a partir de laquelle recuperer les ligne + * @return string chaine exprimant la syntax sql de la limite */ function plimit($limit=0,$offset=0) { @@ -493,10 +494,10 @@ class DoliDBMysql /** * Define sort criteria of request * - * @param sortfield List of sort fields - * @param sortorder Sort order - * @return string String to provide syntax of a sort sql string - * TODO Mutualized this into a mother class + * @param string $sortfield List of sort fields + * @param string $sortorder Sort order + * @return string String to provide syntax of a sort sql string + * TODO Mutualized this into a mother class */ function order($sortfield=0,$sortorder=0) { @@ -522,10 +523,10 @@ class DoliDBMysql /** - * Escape a string to insert data + * Escape a string to insert data * - * @param stringtoencode String to escape - * @return string String escaped + * @param string $stringtoencode String to escape + * @return string String escaped */ function escape($stringtoencode) { @@ -534,11 +535,11 @@ class DoliDBMysql /** - * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. - * Function to use to build INSERT, UPDATE or WHERE predica + * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. + * Function to use to build INSERT, UPDATE or WHERE predica * - * @param string $param Date TMS to convert - * @return string Date in a string YYYYMMDDHHMMSS + * @param string $param Date TMS to convert + * @return string Date in a string YYYYMMDDHHMMSS */ function idate($param) { @@ -563,10 +564,10 @@ class DoliDBMysql /** * Formate a SQL IF * - * @param test chaine test - * @param resok resultat si test egal - * @param resko resultat si test non egal - * @return string SQL string + * @param string $test chaine test + * @param string $resok resultat si test egal + * @param string $resko resultat si test non egal + * @return string SQL string */ function ifsql($test,$resok,$resko) { @@ -575,8 +576,9 @@ class DoliDBMysql /** - * \brief Renvoie la derniere requete soumise par la methode query() - * \return lastquery + * Return last request executed with query() + * + * @return string Last query */ function lastquery() { @@ -584,8 +586,9 @@ class DoliDBMysql } /** - * \brief Renvoie la derniere requete en erreur - * \return string lastqueryerror + * Return last query in error + * + * @return string lastqueryerror */ function lastqueryerror() { @@ -593,8 +596,9 @@ class DoliDBMysql } /** - * \brief Renvoie le libelle derniere erreur - * \return string lasterror + * Return last error label + * + * @return string lasterror */ function lasterror() { @@ -602,8 +606,9 @@ class DoliDBMysql } /** - * \brief Renvoie le code derniere erreur - * \return string lasterrno + * Return last error code + * + * @return string lasterrno */ function lasterrno() { @@ -611,16 +616,19 @@ class DoliDBMysql } /** - * \brief Renvoie le code erreur generique de l'operation precedente. - * \return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * Return generic error code of last operation. + * + * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ function errno() { - if (! $this->connected) { + if (! $this->connected) + { // Si il y a eu echec de connexion, $this->db n'est pas valide. return 'DB_ERROR_FAILED_TO_CONNECT'; } - else { + else + { // Constants to convert a MySql error code to a generic Dolibarr error code $errorcode_map = array( 1004 => 'DB_ERROR_CANNOT_CREATE', @@ -661,8 +669,9 @@ class DoliDBMysql } /** - \brief Renvoie le texte de l'erreur mysql de l'operation precedente. - \return error_text + * Return description of last error + * + * @return string Error text */ function error() { @@ -728,9 +737,10 @@ class DoliDBMysql } /** - * \brief Decrypt sensitive data in database - * \param value Value to decrypt - * \return return Decrypted value if used + * Decrypt sensitive data in database + * + * @param string $value Value to decrypt + * @return string Decrypted value if used */ function decrypt($value) { @@ -761,9 +771,9 @@ class DoliDBMysql /** - * Renvoie l'id de la connexion + * Return connexion ID * - * @return string Id connexion + * @return string Id connexion */ function DDLGetConnectId() { @@ -774,14 +784,15 @@ class DoliDBMysql /** - * \brief Create a new database - * \param database Database name to create - * \param charset Charset used to store data - * \param collation Charset used to sort data - * \param owner Username of database owner - * \return resource resource defined if OK, null if KO - * \remarks Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated - * We force to create database with charset this->forcecharset and collate this->forcecollate + * Create a new database + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate + * + * @param string $database Database name to create + * @param string $charset Charset used to store data + * @param string $collation Charset used to sort data + * @param string $owner Username of database owner + * @return resource resource defined if OK, null if KO */ function DDLCreateDb($database,$charset='',$collation='',$owner='') { @@ -1132,7 +1143,7 @@ class DoliDBMysql /** * Return list of available collation that can be used for database * - * @return array Liste of Collation + * @return array List of Collation */ function getListOfCollation() { diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index cd5a8cc13b8..5384dfb0517 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -455,9 +455,10 @@ class DoliDBMysqli /** * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE - * @see num_rows - * @param resultset Curseur de la requete voulue - * @return int Nombre de lignes + * + * @param resultset $resultset Curseur de la requete voulue + * @return int Nombre de lignes + * @see num_rows */ function affected_rows($resultset) @@ -473,7 +474,8 @@ class DoliDBMysqli /** * Libere le dernier resultset utilise sur cette connexion * - * @param resultset Curseur de la requete voulue + * @param resultset $resultset Curseur de la requete voulue + * @return void */ function free($resultset=0) { @@ -487,9 +489,9 @@ class DoliDBMysqli /** * Defini les limites de la requete * - * @param limit nombre maximum de lignes retournees - * @param offset numero de la ligne a partir de laquelle recuperer les ligne - * @return string chaine exprimant la syntax sql de la limite + * @param int $limit nombre maximum de lignes retournees + * @param int $offset numero de la ligne a partir de laquelle recuperer les ligne + * @return string chaine exprimant la syntax sql de la limite */ function plimit($limit=0,$offset=0) { @@ -503,10 +505,10 @@ class DoliDBMysqli /** * Define sort criteria of request * - * @param sortfield List of sort fields - * @param sortorder Sort order - * @return string String to provide syntax of a sort sql string - * TODO Mutualized this into a mother class + * @param string $sortfield List of sort fields + * @param string $sortorder Sort order + * @return string String to provide syntax of a sort sql string + * TODO Mutualized this into a mother class */ function order($sortfield=0,$sortorder=0) { @@ -534,8 +536,8 @@ class DoliDBMysqli /** * Escape a string to insert data * - * @param stringtoencode String to escape - * @return string String escaped + * @param string $stringtoencode String to escape + * @return string String escaped */ function escape($stringtoencode) { @@ -572,10 +574,10 @@ class DoliDBMysqli /** * Formate a SQL IF * - * @param test chaine test - * @param resok resultat si test egal - * @param resko resultat si test non egal - * @return string SQL string + * @param string $test chaine test + * @param string $resok resultat si test egal + * @param string $resko resultat si test non egal + * @return string SQL string */ function ifsql($test,$resok,$resko) { @@ -584,8 +586,9 @@ class DoliDBMysqli /** - * \brief Renvoie la derniere requete soumise par la methode query() - * \return lastquery + * Return last request executed with query() + * + * @return string Last query */ function lastquery() { @@ -593,8 +596,9 @@ class DoliDBMysqli } /** - * \brief Renvoie la derniere requete en erreur - * \return string lastqueryerror + * Renvoie la derniere requete en erreur + * + * @return string lastqueryerror */ function lastqueryerror() { @@ -602,8 +606,9 @@ class DoliDBMysqli } /** - * \brief Renvoie le libelle derniere erreur - * \return string lasterror + * Renvoie le libelle derniere erreur + * + * @return string lasterror */ function lasterror() { @@ -611,8 +616,9 @@ class DoliDBMysqli } /** - * \brief Renvoie le code derniere erreur - * \return string lasterrno + * Renvoie le code derniere erreur + * + * @return string lasterrno */ function lasterrno() { @@ -620,8 +626,9 @@ class DoliDBMysqli } /** - * \brief Renvoie le code erreur generique de l'operation precedente. - * \return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * Return generic error code of last operation. + * + * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ function errno() { @@ -670,8 +677,9 @@ class DoliDBMysqli } /** - * \brief Renvoie le texte de l'erreur mysql de l'operation precedente. - * \return error_text + * Return description of last error + * + * @return string Error text */ function error() { @@ -733,9 +741,10 @@ class DoliDBMysqli } /** - * \brief Decrypt sensitive data in database - * \param value Value to decrypt - * \return return Decrypted value if used + * Decrypt sensitive data in database + * + * @param string $value Value to decrypt + * @return string Decrypted value if used */ function decrypt($value) { @@ -766,9 +775,9 @@ class DoliDBMysqli /** - * Renvoie l'id de la connexion + * Return connexion ID * - * @return string Id connexion + * @return string Id connexion */ function DDLGetConnectId() { @@ -778,14 +787,15 @@ class DoliDBMysqli } /** - * \brief Create a new database - * \param database Database name to create - * \param charset Charset used to store data - * \param collation Charset used to sort data - * \param owner Username of database owner - * \return resource resource defined if OK, null if KO - * \remarks Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated - * We force to create database with charset this->forcecharset and collate this->forcecollate + * Create a new database + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate + * + * @param string $database Database name to create + * @param string $charset Charset used to store data + * @param string $collation Charset used to sort data + * @param string $owner Username of database owner + * @return resource resource defined if OK, null if KO */ function DDLCreateDb($database,$charset='',$collation='',$owner='') { diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index a28d6762a30..e0e3716473a 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -940,12 +940,8 @@ class DoliDBPgsql } - // Next function are not required. Only minor features use them. - //-------------------------------------------------------------- - - /** - * Renvoie l'id de la connexion + * Return connexion ID * * @return string Id connexion */ @@ -958,13 +954,14 @@ class DoliDBPgsql /** * Create a new database - * Ne pas utiliser les fonctions xxx_create_db (xxx=mysql, ...) car elles sont deprecated + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate * * @param string $database Database name to create * @param string $charset Charset used to store data * @param string $collation Charset used to sort data * @param string $owner Username of database owner - * @return resource Resource defined if OK, null if KO + * @return resource resource defined if OK, null if KO */ function DDLCreateDb($database,$charset='',$collation='',$owner='') { diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index 9155baa830b..52d6a05d4ce 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -585,13 +585,12 @@ class DoliDBSqlite } /** - * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE + * Return number of lines for result of a SELECT * - * @see num_rows - * @param resultset Curseur de la requete voulue - * @return int Nombre de lignes + * @param Resultset $resultset Resulset of requests + * @return int Nb of lines + * @see affected_rows */ - function affected_rows($resultset) { // If resultset not provided, we take the last used by connexion @@ -602,11 +601,12 @@ class DoliDBSqlite } - /** - * Libere le dernier resultset utilise sur cette connexion - * - * @param resultset Curseur de la requete voulue - */ + /** + * Free last resultset used. + * + * @param resultset $resultset Curseur de la requete voulue + * @return void + */ function free($resultset=0) { // If resultset not provided, we take the last used by connexion @@ -616,13 +616,13 @@ class DoliDBSqlite } - /** - * Defini les limites de la requete - * - * @param limit nombre maximum de lignes retournees - * @param offset numero de la ligne a partir de laquelle recuperer les ligne - * @return string chaine exprimant la syntax sql de la limite - */ + /** + * Define limits of request + * + * @param int $limit nombre maximum de lignes retournees + * @param int $offset numero de la ligne a partir de laquelle recuperer les ligne + * @return string chaine exprimant la syntax sql de la limite + */ function plimit($limit=0,$offset=0) { global $conf; @@ -632,14 +632,14 @@ class DoliDBSqlite } - /** - * Define sort criteria of request - * - * @param sortfield List of sort fields - * @param sortorder Sort order - * @return string String to provide syntax of a sort sql string - * TODO Mutualized this into a mother class - */ + /** + * Define sort criteria of request + * + * @param string $sortfield List of sort fields + * @param string $sortorder Sort order + * @return string String to provide syntax of a sort sql string + * TODO Mutualized this into a mother class + */ function order($sortfield=0,$sortorder=0) { if ($sortfield) @@ -663,12 +663,12 @@ class DoliDBSqlite } - /** - * Escape a string to insert data - * - * @param stringtoencode String to escape - * @return string String escaped - */ + /** + * Escape a string to insert data + * + * @param string $stringtoencode String to escape + * @return string String escaped + */ function escape($stringtoencode) { return PDO::quote($stringtoencode); @@ -701,14 +701,14 @@ class DoliDBSqlite return $date; } - /** - * Formate a SQL IF - * - * @param test chaine test - * @param resok resultat si test egal - * @param resko resultat si test non egal - * @return string chaine formatee SQL - */ + /** + * Formate a SQL IF + * + * @param string $test chaine test + * @param string $resok resultat si test egal + * @param string $resko resultat si test non egal + * @return string SQL string + */ function ifsql($test,$resok,$resko) { return 'IF('.$test.','.$resok.','.$resko.')'; @@ -725,31 +725,31 @@ class DoliDBSqlite return $this->lastquery; } - /** - * Renvoie la derniere requete en erreur - * - * @return string lastqueryerror - */ + /** + * Return last query in error + * + * @return string lastqueryerror + */ function lastqueryerror() { return $this->lastqueryerror; } - /** - * Renvoie le libelle derniere erreur - * - * @return string lasterror - */ + /** + * Return last error label + * + * @return string lasterror + */ function lasterror() { return $this->lasterror; } - /** - * Renvoie le code derniere erreur - * - * @return string lasterrno - */ + /** + * Return last error code + * + * @return string lasterrno + */ function lasterrno() { return $this->lasterrno; @@ -846,13 +846,12 @@ class DoliDBSqlite } /** - * Encrypt sensitive data in database + * Encrypt sensitive data in database * Warning: This function includes the escape, so it must use direct value * - * @param fieldorvalue Field name or value to encrypt - * @param withQuotes Return string with quotes - * @return return XXX(field) or XXX('value') or field or 'value' - * + * @param string $fieldorvalue Field name or value to encrypt + * @param int $withQuotes Return string with quotes + * @return return XXX(field) or XXX('value') or field or 'value' */ function encrypt($fieldorvalue, $withQuotes=0) { @@ -882,9 +881,10 @@ class DoliDBSqlite } /** - * \brief Decrypt sensitive data in database - * \param value Value to decrypt - * \return return Decrypted value if used + * Decrypt sensitive data in database + * + * @param string $value Value to decrypt + * @return string Decrypted value if used */ function decrypt($value) { @@ -914,29 +914,27 @@ class DoliDBSqlite } - // Next functions are not required. Only minor features use them. - //--------------------------------------------------------------- - /** - * \brief Renvoie l'id de la connexion - * \return string Id connexion + * Return connexion ID + * + * @return string Id connexion */ function DDLGetConnectId() { - $resql=$this->query('SELECT CONNECTION_ID()'); - $row=$this->fetch_row($resql); - return $row[0]; + return '?'; } + /** - * \brief Create a new database - * \param database Database name to create - * \param charset Charset used to store data - * \param collation Charset used to sort data - * \param owner Username of database owner - * \return resource resource defined if OK, null if KO - * \remarks Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated - * We force to create database with charset this->forcecharset and collate this->forcecollate + * Create a new database + * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated + * We force to create database with charset this->forcecharset and collate this->forcecollate + * + * @param string $database Database name to create + * @param string $charset Charset used to store data + * @param string $collation Charset used to sort data + * @param string $owner Username of database owner + * @return resource resource defined if OK, null if KO */ function DDLCreateDb($database,$charset='',$collation='',$owner='') { @@ -1234,19 +1232,21 @@ class DoliDBSqlite return 1; } - /** - * \brief Return charset used to store data in database - * \return string Charset - */ + /** + * Return charset used to store data in database + * + * @return string Charset + */ function getDefaultCharacterSetDatabase() { return 'UTF-8'; } - /** - * \brief Return list of available charset that can be used to store data in database - * \return array List of Charset - */ + /** + * Return list of available charset that can be used to store data in database + * + * @return array List of Charset + */ function getListOfCharacterSet() { $liste = array(); @@ -1256,19 +1256,21 @@ class DoliDBSqlite return $liste; } - /** - * \brief Return collation used in database - * \return string Collation value - */ + /** + * Return collation used in database + * + * @return string Collation value + */ function getDefaultCollationDatabase() { return 'UTF-8'; } - /** - * \brief Return list of available collation that can be used for database - * \return array Liste of Collation - */ + /** + * Return list of available collation that can be used for database + * + * @return array List of Collation + */ function getListOfCollation() { $liste = array(); @@ -1278,11 +1280,12 @@ class DoliDBSqlite return $liste; } - /** + /** * Return full path of dump program + * * @return string Full path of dump program - */ - function getPathOfDump() + */ + function getPathOfDump() { $fullpathofdump='/pathtomysqldump/mysqldump'; @@ -1296,10 +1299,11 @@ class DoliDBSqlite return $fullpathofdump; } - /** - * Return full path of restore program - * @return string Full path of restore program - */ + /** + * Return full path of restore program + * + * @return string Full path of restore program + */ function getPathOfRestore() { $fullpathofimport='/pathtomysql/mysql'; @@ -1314,11 +1318,12 @@ class DoliDBSqlite return $fullpathofimport; } - /** - * \brief Return value of server parameters - * \param filter Filter list on a particular value - * \return string Value for parameter - */ + /** + * Return value of server parameters + * + * @param string $filter Filter list on a particular value + * @return string Value for parameter + */ function getServerParametersValues($filter='') { $result=array(); @@ -1335,11 +1340,12 @@ class DoliDBSqlite return $result; } - /** - * \brief Return value of server status - * \param filter Filter list on a particular value - * \return string Value for parameter - */ + /** + * Return value of server status + * + * @param string $filter Filter list on a particular value + * @return string Value for parameter + */ function getServerStatusValues($filter='') { $result=array();