1 | <?php |
---|
2 | |
---|
3 | /***************************************************************************\ |
---|
4 | * SPIP, Systeme de publication pour l'internet * |
---|
5 | * * |
---|
6 | * Copyright (c) 2001-2015 * |
---|
7 | * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * |
---|
8 | * * |
---|
9 | * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * |
---|
10 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
---|
11 | \***************************************************************************/ |
---|
12 | |
---|
13 | if (!defined('_ECRIRE_INC_VERSION')) { |
---|
14 | return; |
---|
15 | } |
---|
16 | |
---|
17 | /** |
---|
18 | * Declarer les interfaces |
---|
19 | * |
---|
20 | * @param array $interfaces |
---|
21 | * @return array |
---|
22 | */ |
---|
23 | function urls_declarer_tables_interfaces($interfaces) { |
---|
24 | $interfaces['table_des_tables']['urls'] = 'urls'; |
---|
25 | |
---|
26 | return $interfaces; |
---|
27 | } |
---|
28 | |
---|
29 | /** |
---|
30 | * Tables de jointures |
---|
31 | * |
---|
32 | * @param array $tables_auxiliaires |
---|
33 | * @return array |
---|
34 | */ |
---|
35 | function urls_declarer_tables_auxiliaires($tables_auxiliaires) { |
---|
36 | |
---|
37 | $spip_urls = array( |
---|
38 | // un id parent eventuel, pour discriminer les doublons arborescents |
---|
39 | "id_parent" => "bigint(21) DEFAULT '0' NOT NULL", |
---|
40 | "url" => "VARCHAR(255) NOT NULL", |
---|
41 | // la table cible |
---|
42 | "type" => "varchar(25) DEFAULT 'article' NOT NULL", |
---|
43 | // l'id dans la table |
---|
44 | "id_objet" => "bigint(21) NOT NULL", |
---|
45 | // pour connaitre la plus recente. |
---|
46 | // ATTENTION, pas on update CURRENT_TIMESTAMP implicite |
---|
47 | // et pas le nom maj, surinterprete par inc/import_1_3 |
---|
48 | "date" => "DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL", |
---|
49 | // nombre de segments dans url |
---|
50 | "segments" => "SMALLINT(3) DEFAULT '1' NOT NULL", |
---|
51 | // URL permanente, prioritaire |
---|
52 | "perma" => "TINYINT(1) DEFAULT '0' NOT NULL", |
---|
53 | ); |
---|
54 | |
---|
55 | $spip_urls_key = array( |
---|
56 | "PRIMARY KEY" => "id_parent, url", |
---|
57 | "KEY type" => "type, id_objet" |
---|
58 | ); |
---|
59 | |
---|
60 | $tables_auxiliaires['spip_urls'] = array( |
---|
61 | 'field' => &$spip_urls, |
---|
62 | 'key' => &$spip_urls_key |
---|
63 | ); |
---|
64 | |
---|
65 | return $tables_auxiliaires; |
---|
66 | } |
---|
67 | |
---|
68 | |
---|
69 | ?> |
---|