/[drupal]/contributions/sandbox/crell/registry/registry.install
ViewVC logotype

Contents of /contributions/sandbox/crell/registry/registry.install

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


Revision 1.2 - (show annotations) (download) (as text)
Mon Nov 12 03:17:48 2007 UTC (2 years ago) by crell
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
File MIME type: text/x-php
- Add groupings.
- Switch from Reflection to token parsing.
1 <?php
2
3 function registry_schema() {
4 $schema['registry'] = array(
5 'description' => t('The index of loadable code in the system.'),
6 'fields' => array(
7 'name' => array(
8 'description' => t('The name of the function or class.'),
9 'type' => 'varchar',
10 'length' => 255,
11 'not null' => TRUE
12 ),
13 'type' => array(
14 'description' => t('The type of code being saved (function, class, etc.).'),
15 'type' => 'varchar',
16 'length' => 25,
17 'not null' => TRUE,
18 ),
19 'grouping' => array(
20 'description' => t('The "group" in which this code resides. The group is defined as the second part of the file name.'),
21 'type' => 'varchar',
22 'length' => 25,
23 'not null' => TRUE,
24 ),
25 'file' => array(
26 'description' => t('The file in which this code resides.'),
27 'type' => 'varchar',
28 'length' => 255,
29 'not null' => TRUE,
30 ),
31 ),
32 'indexes' => array(
33 'registry_name' => array('name'),
34 'registry_grouping' => array('grouping'),
35 ),
36 'unique keys' => array(
37 'names' => array('name'),
38 ),
39 'primary key' => array('name'),
40 );
41 return $schema;
42 }
43
44 function registry_install() {
45 // Create my tables.
46 drupal_install_schema('registry');
47
48 // Initialize the registry.
49 drupal_load('module', 'registry');
50 registry_rebuild();
51 }
52
53 function registry_uninstall() {
54 // Drop my tables.
55 drupal_uninstall_schema('registry');
56 }

  ViewVC Help
Powered by ViewVC 1.1.2