/[drupal]/contributions/sandbox/antinomia/modules/druplet/druplet.install
ViewVC logotype

Contents of /contributions/sandbox/antinomia/modules/druplet/druplet.install

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


Revision 1.1 - (show annotations) (download) (as text)
Tue Jun 26 23:16:17 2007 UTC (2 years, 5 months ago) by antinomia
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
Druplet sandbox generator module for 5.x
1 <?php
2 // $Id $
3
4 /**
5 * Implementation of hook_install().
6 */
7 function druplet_install() {
8 switch ($GLOBALS['db_type']) {
9 case 'mysql':
10 case 'mysqli':
11 db_query("
12 CREATE TABLE `druplet` (
13 `vid` int(10) unsigned NOT NULL default '0',
14 `nid` int(10) unsigned NOT NULL default '0',
15 `db_name` varchar(255) NOT NULL default '',
16 `db_user` varchar(255) NOT NULL default '',
17 `db_password` varchar(255) NOT NULL default '',
18 `profile` varchar(64) NOT NULL default '',
19 PRIMARY KEY (`vid`,`nid`)
20 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
21 ");
22 break;
23 case 'pgsql':
24 // todo: write me
25 break;
26 }
27 }
28
29 /**
30 * Implementation of hook_uninstall().
31 */
32 function druplet_uninstall() {
33 switch ($GLOBALS['db_type']) {
34 case 'mysql':
35 case 'mysqli':
36 case 'pgsql':
37 db_query("DROP TABLE `druplet`");
38 //to-do: remove applicable settings
39 break;
40 }
41 }

  ViewVC Help
Powered by ViewVC 1.1.2