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')) return; |
---|
14 | |
---|
15 | /** |
---|
16 | * Declarer les interfaces |
---|
17 | * |
---|
18 | * @param array $interfaces |
---|
19 | * @return array |
---|
20 | */ |
---|
21 | function urls_declarer_tables_interfaces($interfaces) { |
---|
22 | $interfaces['table_des_tables']['urls']='urls'; |
---|
23 | return $interfaces; |
---|
24 | } |
---|
25 | /** |
---|
26 | * Tables de jointures |
---|
27 | * |
---|
28 | * @param array $tables_auxiliaires |
---|
29 | * @return array |
---|
30 | */ |
---|
31 | function urls_declarer_tables_auxiliaires($tables_auxiliaires){ |
---|
32 | |
---|
33 | $spip_urls = array( |
---|
34 | // un id parent eventuel, pour discriminer les doublons arborescents |
---|
35 | "id_parent" => "bigint(21) DEFAULT '0' NOT NULL", |
---|
36 | "url" => "VARCHAR(255) NOT NULL", |
---|
37 | // la table cible |
---|
38 | "type" => "varchar(25) DEFAULT 'article' NOT NULL", |
---|
39 | // l'id dans la table |
---|
40 | "id_objet" => "bigint(21) NOT NULL", |
---|
41 | // pour connaitre la plus recente. |
---|
42 | // ATTENTION, pas on update CURRENT_TIMESTAMP implicite |
---|
43 | // et pas le nom maj, surinterprete par inc/import_1_3 |
---|
44 | "date" => "DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL", |
---|
45 | // nombre de segments dans url |
---|
46 | "segments" => "SMALLINT(3) DEFAULT '1' NOT NULL", |
---|
47 | // URL permanente, prioritaire |
---|
48 | "perma" => "TINYINT(1) DEFAULT '0' NOT NULL", |
---|
49 | ); |
---|
50 | |
---|
51 | $spip_urls_key = array( |
---|
52 | "PRIMARY KEY" => "id_parent, url", |
---|
53 | "KEY type" => "type, id_objet"); |
---|
54 | |
---|
55 | $tables_auxiliaires['spip_urls'] = array( |
---|
56 | 'field' => &$spip_urls, |
---|
57 | 'key' => &$spip_urls_key); |
---|
58 | |
---|
59 | return $tables_auxiliaires; |
---|
60 | } |
---|
61 | |
---|
62 | |
---|
63 | ?> |
---|