/[drupal]/contributions/modules/versioncontrol_svn/versioncontrol_svn.install
ViewVC logotype

Contents of /contributions/modules/versioncontrol_svn/versioncontrol_svn.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.18 - (show annotations) (download) (as text)
Sat Jun 20 10:18:55 2009 UTC (5 months ago) by jpetso
Branch: MAIN
CVS Tags: HEAD
Changes since 1.17: +4 -4 lines
File MIME type: text/x-php
#491544 by chrono325: Correct 'CVS' to 'SVN' in module install file.

Signed-off-by: Dan Hackney <chrono325@gmail.com>
1 <?php
2 // $Id: versioncontrol_svn.install,v 1.17 2009-05-09 23:43:41 sdboyer Exp $
3 /**
4 * @file
5 * Subversion backend for Version Control API - Provides Subversion commit
6 * information and account management as a pluggable backend.
7 *
8 * Copyright 2006 by Karthik ("Zen", http://drupal.org/user/21209)
9 * Copyright 2006, 2007 by Gavin Mogan ("halkeye", http://drupal.org/user/56779)
10 * Copyright 2006, 2007 by Derek Wright ("dww", http://drupal.org/user/46549)
11 * Copyright 2007, 2008, 2009 by Jakob Petsovits ("jpetso", http://drupal.org/user/56020)
12 */
13
14 /**
15 * Implementation of hook_schema().
16 */
17 function versioncontrol_svn_schema() {
18 $schema['versioncontrol_svn_repositories'] = array(
19 'description' => 'This table extends {versioncontrol_repositories} with additional properties specific to SVN repositories.',
20 'fields' => array(
21 'repo_id' => array(
22 'description' => 'The repository identifier referring to {versioncontrol_repositories}.repo_id.',
23 'type' => 'int',
24 'unsigned' => TRUE,
25 'not null' => TRUE,
26 'default' => 0,
27 ),
28 'update_method' => array(
29 'description' =>
30 'Specifies whether the repository is updated via log parsing on cron runs (VERSIONCONTROL_SVN_UPDATE_CRON) or via hook scripts (VERSIONCONTROL_SVN_UPDATE_XSVN). Updating the repository and fetching new revisions into the database are the same thing, by the way.',
31 'type' => 'int',
32 'size' => 'tiny',
33 'unsigned' => TRUE,
34 'not null' => TRUE,
35 'default' => 0,
36 ),
37 'updated' => array(
38 'description' =>
39 'Date/time when the repository was last updated, as Unix timestamp. Unlike the SVN backend, the SVN backend uses this property only for displaying purposes, so it is not required for log parsing. 0 if the repository has never been updated at all.',
40 'type' => 'int',
41 'unsigned' => TRUE,
42 'not null' => TRUE,
43 'default' => 0,
44 ),
45 'last_revision' => array(
46 'description' => 'The last revision that was recorded for the repository. 0 if the repository has never been updated at all (and no revisions have yet been recorded).',
47 'type' => 'int',
48 'unsigned' => TRUE,
49 'not null' => TRUE,
50 'default' => 0,
51 ),
52 'auth_username' => array(
53 'description' => 'Empty if the repository is accessed anonymously, or the login username if credentials are being supplied.',
54 'type' => 'varchar',
55 'length' => 128,
56 'not null' => TRUE,
57 'default' => '',
58 ),
59 'auth_password' => array(
60 'description' => 'Empty if the repository is accessed anonymously, or the login password if credentials are being supplied.',
61 'type' => 'varchar',
62 'length' => 128,
63 'not null' => TRUE,
64 'default' => '',
65 ),
66 'path_trunk' => array(
67 'description' => 'The path of the trunk directory (often "/trunk"), for branch emulation purposes.',
68 'type' => 'varchar',
69 'length' => 128,
70 'not null' => TRUE,
71 'default' => '',
72 ),
73 'path_branches' => array(
74 'description' =>
75 'The path of the branches directory (e.g. "/branches/%project/%branch"), for branch emulation purposes. "%project" is a placeholder for the project\'s short name and "%branch" holds the name of the branch itself.',
76 'type' => 'varchar',
77 'length' => 128,
78 'not null' => TRUE,
79 'default' => '',
80 ),
81 'path_tags' => array(
82 'description' =>
83 'The path of the tags directory (e.g. "/tags/%project/%branch/%tag"), for tag emulation purposes. "%project" is a placeholder for the project\'s short name, "%branch" optionally denotes a branch specific directory part (but may be left out), and "%tag" holds the name of the tag itself.',
84 'type' => 'varchar',
85 'length' => 128,
86 'not null' => TRUE,
87 'default' => '',
88 ),
89 'is_working_copy' => array(
90 'description' => 'Whether or not the "repository" is actually a subversion working copy.',
91 'type' => 'int',
92 'size' => 'tiny',
93 'unsigned' => TRUE,
94 'not null' => TRUE,
95 'default' => 0,
96 ),
97 ),
98 'primary key' => array('repo_id'),
99 );
100
101 return $schema;
102 }
103
104 /**
105 * Implementation of hook_install().
106 */
107 function versioncontrol_svn_install() {
108 // Create tables.
109 drupal_install_schema('versioncontrol_svn');
110 }
111
112 /**
113 * Implementation of hook_uninstall().
114 */
115 function versioncontrol_svn_uninstall() {
116 // Make sure we can access the required functions even from the .install file.
117 include_once(drupal_get_path('module', 'versioncontrol') .'/versioncontrol.module');
118 include_once(drupal_get_path('module', 'versioncontrol_svn') .'/versioncontrol_svn.module');
119
120 if (db_table_exists('versioncontrol_repositories')) {
121 $result = db_query("SELECT repo_id FROM {versioncontrol_repositories}
122 WHERE vcs = 'svn'");
123 while ($repository = db_fetch_array($result)) {
124 versioncontrol_delete_repository($repository);
125 }
126 }
127
128 // Remove tables.
129 drupal_uninstall_schema('versioncontrol_svn');
130 }
131
132
133 // Update functions. To be named versioncontrol_svn_update_xyzz(), where x is
134 // the major version of Drupal core, y is the major version of the SVN backend
135 // for this version of Drupal core, and zz is a consecutive number.
136
137 // versioncontrol_svn_update_3() was the last update on Drupal 5.x (-2.x).
138
139 /**
140 * Update 6100: Blah blah blah.
141 */
142 /* function versioncontrol_svn_update_6100() {
143 $ret = array();
144 $ret[] = update_sql('UPDATE {versioncontrol_svn_blah} SET value = othervalue');
145 return $ret;
146 }*/
147
148 function versioncontrol_svn_update_6200() {
149 $ret = array();
150 $spec = array(
151 'description' => 'Whether or not the "repository" is actually a subversion working copy.',
152 'type' => 'int',
153 'size' => 'tiny',
154 'unsigned' => TRUE,
155 'not null' => TRUE,
156 'default' => 0,
157 );
158 db_add_field($ret, 'versioncontrol_svn_repositories', 'is_working_copy', $spec);
159 return $ret;
160 }

  ViewVC Help
Powered by ViewVC 1.1.2