@@ -23,10 +23,19 @@ discard block |
||
| 23 | 23 | # retourne le chapeau d'un article, et seulement s'il est publie |
| 24 | 24 | |
| 25 | 25 | // http://doc.spip.org/@quete_chapo |
| 26 | +/** |
|
| 27 | + * @param integer $id_article |
|
| 28 | + * @param string $connect |
|
| 29 | + * |
|
| 30 | + * @return string |
|
| 31 | + */ |
|
| 26 | 32 | function quete_chapo($id_article, $connect) { |
| 27 | 33 | return sql_getfetsel('chapo', 'spip_articles', array("id_article=".intval($id_article), "statut='publie'"), '','','','',$connect); |
| 28 | 34 | } |
| 29 | 35 | |
| 36 | +/** |
|
| 37 | + * @param string $table |
|
| 38 | + */ |
|
| 30 | 39 | function quete_parent_lang($table,$id,$connect=''){ |
| 31 | 40 | static $cache_quete = array(); |
| 32 | 41 | |
@@ -53,6 +62,9 @@ discard block |
||
| 53 | 62 | # retourne la rubrique d'un article |
| 54 | 63 | |
| 55 | 64 | // http://doc.spip.org/@quete_rubrique |
| 65 | +/** |
|
| 66 | + * @param string $serveur |
|
| 67 | + */ |
|
| 56 | 68 | function quete_rubrique($id_article, $serveur) { |
| 57 | 69 | $id_parent = quete_parent_lang('spip_articles',$id_article,$serveur); |
| 58 | 70 | return $id_parent['id_rubrique']; |
@@ -126,6 +138,10 @@ discard block |
||
| 126 | 138 | |
| 127 | 139 | // recuperer une meta sur un site distant (en local il y a plus simple) |
| 128 | 140 | // http://doc.spip.org/@quete_meta |
| 141 | +/** |
|
| 142 | + * @param string $nom |
|
| 143 | + * @param string $serveur |
|
| 144 | + */ |
|
| 129 | 145 | function quete_meta($nom, $serveur) { |
| 130 | 146 | return sql_getfetsel("valeur", "spip_meta", "nom=" . sql_quote($nom), |
| 131 | 147 | '','','','',$serveur); |
@@ -61,6 +61,9 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | // http://doc.spip.org/@index_tables_en_pile |
| 64 | +/** |
|
| 65 | + * @param string $nom_champ |
|
| 66 | + */ |
|
| 64 | 67 | function index_tables_en_pile($idb, $nom_champ, &$boucles) { |
| 65 | 68 | global $exceptions_des_tables; |
| 66 | 69 | |
@@ -467,6 +470,9 @@ discard block |
||
| 467 | 470 | |
| 468 | 471 | // Filtres et,ou,oui,non,sinon,xou,xor,and,or,not,yes |
| 469 | 472 | // et comparateurs |
| 473 | +/** |
|
| 474 | + * @param string $arg |
|
| 475 | + */ |
|
| 470 | 476 | function filtre_logique($fonc, $code, $arg) |
| 471 | 477 | { |
| 472 | 478 | global $table_criteres_infixes; |
@@ -490,6 +496,9 @@ discard block |
||
| 490 | 496 | } |
| 491 | 497 | |
| 492 | 498 | // http://doc.spip.org/@compose_filtres_args |
| 499 | +/** |
|
| 500 | + * @param string $sep |
|
| 501 | + */ |
|
| 493 | 502 | function compose_filtres_args($p, $args, $sep) |
| 494 | 503 | { |
| 495 | 504 | $arglist = ""; |
@@ -531,6 +540,10 @@ discard block |
||
| 531 | 540 | // |
| 532 | 541 | |
| 533 | 542 | // http://doc.spip.org/@rindex_pile |
| 543 | +/** |
|
| 544 | + * @param string $champ |
|
| 545 | + * @param string $motif |
|
| 546 | + */ |
|
| 534 | 547 | function rindex_pile($p, $champ, $motif) |
| 535 | 548 | { |
| 536 | 549 | $n = 0; |
@@ -36,6 +36,9 @@ |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | // http://doc.spip.org/@trace_query_chrono |
| 39 | +/** |
|
| 40 | + * @param string $m2 |
|
| 41 | + */ |
|
| 39 | 42 | function trace_query_chrono($m1, $m2, $query, $result, $serveur='') |
| 40 | 43 | { |
| 41 | 44 | static $tt = 0, $nb=0; |
@@ -27,6 +27,9 @@ |
||
| 27 | 27 | // distingue champ numerique et non numerique |
| 28 | 28 | |
| 29 | 29 | // http://doc.spip.org/@vertebrer_sort |
| 30 | +/** |
|
| 31 | + * @param string $direction |
|
| 32 | + */ |
|
| 30 | 33 | function vertebrer_sort($fields, $direction) |
| 31 | 34 | { |
| 32 | 35 | $res = ''; |
@@ -229,6 +229,9 @@ discard block |
||
| 229 | 229 | // Pas portable malheureusement, on laisse pour le moment. |
| 230 | 230 | |
| 231 | 231 | // http://doc.spip.org/@spip_mysql_order |
| 232 | +/** |
|
| 233 | + * @param string $orderby |
|
| 234 | + */ |
|
| 232 | 235 | function spip_mysql_order($orderby) |
| 233 | 236 | { |
| 234 | 237 | return (is_array($orderby)) ? join(", ", $orderby) : $orderby; |
@@ -258,6 +261,9 @@ discard block |
||
| 258 | 261 | } |
| 259 | 262 | |
| 260 | 263 | // http://doc.spip.org/@calculer_mysql_expression |
| 264 | +/** |
|
| 265 | + * @param string $expression |
|
| 266 | + */ |
|
| 261 | 267 | function calculer_mysql_expression($expression, $v, $join = 'AND'){ |
| 262 | 268 | if (empty($v)) |
| 263 | 269 | return ''; |
@@ -340,6 +346,9 @@ discard block |
||
| 340 | 346 | } |
| 341 | 347 | |
| 342 | 348 | // http://doc.spip.org/@spip_mysql_selectdb |
| 349 | +/** |
|
| 350 | + * @param string $db |
|
| 351 | + */ |
|
| 343 | 352 | function spip_mysql_selectdb($db) { |
| 344 | 353 | $ok = mysql_select_db($db); |
| 345 | 354 | if (!$ok) |
@@ -600,6 +609,9 @@ discard block |
||
| 600 | 609 | } |
| 601 | 610 | |
| 602 | 611 | // http://doc.spip.org/@spip_mysql_insert |
| 612 | +/** |
|
| 613 | + * @param string $champs |
|
| 614 | + */ |
|
| 603 | 615 | function spip_mysql_insert($table, $champs, $valeurs, $desc='', $serveur='',$requeter=true) { |
| 604 | 616 | |
| 605 | 617 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
@@ -105,6 +105,11 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | // Par ou ca passe une fois les traductions faites |
| 107 | 107 | // http://doc.spip.org/@spip_pg_trace_query |
| 108 | +/** |
|
| 109 | + * @param string $query |
|
| 110 | + * |
|
| 111 | + * @return resource |
|
| 112 | + */ |
|
| 108 | 113 | function spip_pg_trace_query($query, $serveur='') |
| 109 | 114 | { |
| 110 | 115 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
@@ -238,6 +243,9 @@ discard block |
||
| 238 | 243 | } |
| 239 | 244 | |
| 240 | 245 | // http://doc.spip.org/@spip_pg_alter_change |
| 246 | +/** |
|
| 247 | + * @param string $arg |
|
| 248 | + */ |
|
| 241 | 249 | function spip_pg_alter_change($table, $arg, $serveur='',$requeter=true) |
| 242 | 250 | { |
| 243 | 251 | if (!preg_match('/^`?(\w+)`?\s+`?(\w+)`?\s+(.*?)\s*(DEFAULT .*?)?(NOT\s+NULL)?\s*(DEFAULT .*?)?$/i',$arg, $r)) { |
@@ -357,7 +365,7 @@ discard block |
||
| 357 | 365 | * |
| 358 | 366 | * @param string $nom : nom de l'index |
| 359 | 367 | * @param string $table : table sql de l'index |
| 360 | - * @param string/array $champs : liste de champs sur lesquels s'applique l'index |
|
| 368 | + * @param string $champs : liste de champs sur lesquels s'applique l'index |
|
| 361 | 369 | * @param string $serveur : nom de la connexion sql utilisee |
| 362 | 370 | * @param bool $requeter : true pour executer la requete ou false pour retourner le texte de la requete |
| 363 | 371 | * |
@@ -484,6 +492,9 @@ discard block |
||
| 484 | 492 | } |
| 485 | 493 | |
| 486 | 494 | // http://doc.spip.org/@spip_pg_orderby |
| 495 | +/** |
|
| 496 | + * @param string $order |
|
| 497 | + */ |
|
| 487 | 498 | function spip_pg_orderby($order, $select) |
| 488 | 499 | { |
| 489 | 500 | $res = array(); |
@@ -631,6 +642,9 @@ discard block |
||
| 631 | 642 | } |
| 632 | 643 | |
| 633 | 644 | // http://doc.spip.org/@calculer_pg_where |
| 645 | +/** |
|
| 646 | + * @param string $v |
|
| 647 | + */ |
|
| 634 | 648 | function calculer_pg_where($v) |
| 635 | 649 | { |
| 636 | 650 | if (!is_array($v)) |
@@ -654,6 +668,9 @@ discard block |
||
| 654 | 668 | |
| 655 | 669 | |
| 656 | 670 | // http://doc.spip.org/@calculer_pg_expression |
| 671 | +/** |
|
| 672 | + * @param string $expression |
|
| 673 | + */ |
|
| 657 | 674 | function calculer_pg_expression($expression, $v, $join = 'AND'){ |
| 658 | 675 | if (empty($v)) |
| 659 | 676 | return ''; |
@@ -700,6 +717,9 @@ discard block |
||
| 700 | 717 | } |
| 701 | 718 | |
| 702 | 719 | // http://doc.spip.org/@spip_pg_fetch |
| 720 | +/** |
|
| 721 | + * @param resource $res |
|
| 722 | + */ |
|
| 703 | 723 | function spip_pg_fetch($res, $t='', $serveur='',$requeter=true) { |
| 704 | 724 | |
| 705 | 725 | if ($res) $res = pg_fetch_array($res, NULL, PGSQL_ASSOC); |
@@ -756,6 +776,10 @@ discard block |
||
| 756 | 776 | } |
| 757 | 777 | |
| 758 | 778 | // http://doc.spip.org/@spip_pg_insert |
| 779 | +/** |
|
| 780 | + * @param string $champs |
|
| 781 | + * @param string $valeurs |
|
| 782 | + */ |
|
| 759 | 783 | function spip_pg_insert($table, $champs, $valeurs, $desc=array(), $serveur='',$requeter=true) { |
| 760 | 784 | $connexion = &$GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]; |
| 761 | 785 | $prefixe = $connexion['prefixe']; |
@@ -1061,6 +1085,9 @@ discard block |
||
| 1061 | 1085 | } |
| 1062 | 1086 | |
| 1063 | 1087 | // http://doc.spip.org/@spip_pg_error |
| 1088 | +/** |
|
| 1089 | + * @param string $serveur |
|
| 1090 | + */ |
|
| 1064 | 1091 | function spip_pg_error($query='', $serveur, $requeter=true) { |
| 1065 | 1092 | $link = $GLOBALS['connexions'][$serveur ? strtolower($serveur) : 0]['link']; |
| 1066 | 1093 | $s = $link ? pg_last_error($link) : pg_last_error(); |
@@ -85,6 +85,9 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | // permet au besoin de charger des fonctions ailleurs par _sqlite_init_functions(); |
| 87 | 87 | // http://doc.spip.org/@_sqlite_add_function |
| 88 | +/** |
|
| 89 | + * @param string $f |
|
| 90 | + */ |
|
| 88 | 91 | function _sqlite_add_function(&$sqlite, &$f, &$r){ |
| 89 | 92 | if (_sqlite_is_version(3, $sqlite)){ |
| 90 | 93 | isset($r[1]) |
@@ -246,6 +249,9 @@ discard block |
||
| 246 | 249 | |
| 247 | 250 | |
| 248 | 251 | // http://doc.spip.org/@_sqlite_func_unix_timestamp |
| 252 | +/** |
|
| 253 | + * @param string $d |
|
| 254 | + */ |
|
| 249 | 255 | function _sqlite_func_unix_timestamp($d) { |
| 250 | 256 | //2005-12-02 20:53:53 |
| 251 | 257 | #spip_log("Passage avec UNIX_TIMESTAMP : $d",'debug'); |
@@ -728,6 +728,10 @@ discard block |
||
| 728 | 728 | |
| 729 | 729 | |
| 730 | 730 | // http://doc.spip.org/@spip_sqlite_insert |
| 731 | +/** |
|
| 732 | + * @param string $champs |
|
| 733 | + * @param string $valeurs |
|
| 734 | + */ |
|
| 731 | 735 | function spip_sqlite_insert($table, $champs, $valeurs, $desc='', $serveur='',$requeter=true) { |
| 732 | 736 | |
| 733 | 737 | $connexion = $GLOBALS['connexions'][$serveur ? $serveur : 0]; |
@@ -1182,6 +1186,9 @@ discard block |
||
| 1182 | 1186 | |
| 1183 | 1187 | // renvoie grosso modo "$expression join($join, $v)" |
| 1184 | 1188 | // http://doc.spip.org/@_sqlite_calculer_expression |
| 1189 | +/** |
|
| 1190 | + * @param string $expression |
|
| 1191 | + */ |
|
| 1185 | 1192 | function _sqlite_calculer_expression($expression, $v, $join = 'AND'){ |
| 1186 | 1193 | if (empty($v)) |
| 1187 | 1194 | return ''; |
@@ -1203,6 +1210,9 @@ discard block |
||
| 1203 | 1210 | |
| 1204 | 1211 | // pour conversion 0+x ? (pas la peine en sqlite) |
| 1205 | 1212 | // http://doc.spip.org/@_sqlite_calculer_order |
| 1213 | +/** |
|
| 1214 | + * @param string $orderby |
|
| 1215 | + */ |
|
| 1206 | 1216 | function _sqlite_calculer_order($orderby) { |
| 1207 | 1217 | return (is_array($orderby)) ? join(", ", $orderby) : $orderby; |
| 1208 | 1218 | } |
@@ -1692,6 +1702,9 @@ discard block |
||
| 1692 | 1702 | // lancer la requete $this->query, |
| 1693 | 1703 | // faire le tracage si demande |
| 1694 | 1704 | // http://doc.spip.org/@executer_requete |
| 1705 | + /** |
|
| 1706 | + * @return string |
|
| 1707 | + */ |
|
| 1695 | 1708 | function executer_requete(){ |
| 1696 | 1709 | $err = ""; |
| 1697 | 1710 | if ($this->tracer) { |
@@ -62,6 +62,9 @@ |
||
| 62 | 62 | // Retire les marqueurs de type dans une URL propre ancienne maniere |
| 63 | 63 | |
| 64 | 64 | // http://doc.spip.org/@retirer_marqueurs_url_propre |
| 65 | +/** |
|
| 66 | + * @param string $url_propre |
|
| 67 | + */ |
|
| 65 | 68 | function retirer_marqueurs_url_propre($url_propre) { |
| 66 | 69 | if (preg_match(',^[+][-](.*?)[-][+]$,', $url_propre, $regs)) { |
| 67 | 70 | return $regs[1]; |