| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * Implementation of hook_schema(). 5 */ 6 function bench_chart_schema() { 7 $schema['bench_chart'] = array( 8 'description' => t('Stores statistics of hook execution time.'), 9 'fields' => array( 10 'hook' => array( 11 'type' => 'varchar', 12 'length' => 64, 13 'not null' => TRUE, 14 'default' => '', 15 'description' => t("The name of hook."), 16 ), 17 'path' => array( 18 'type' => 'varchar', 19 'length' => 64, 20 'not null' => TRUE, 21 'default' => '', 22 'description' => t('Path'), 23 ), 24 'time' => array( 25 'type' => 'float', 26 'not null' => TRUE, 27 'default' => 0, 28 'size' => 'tiny', 29 'description' => t('Avarage time.'), 30 ), 31 'totaltime' => array( 32 'type' => 'float', 33 'not null' => TRUE, 34 'default' => 0, 35 'size' => 'tiny', 36 'description' => t('Total time.'), 37 ), 38 'count' => array( 39 'type' => 'int', 40 'not null' => TRUE, 41 'default' => 0, 42 'size' => 'tiny', 43 'description' => t('Execution count'), 44 ), 45 ), 46 'primary key' => array('hook', 'path'), 47 ); 48 49 return $schema; 50 } 51 52 /** 53 * Implementation of hook_install(). 54 */ 55 function bench_chart_install() { 56 // Create tables. 57 drupal_install_schema('bench_chart'); 58 } 59 60 /** 61 * Implementation of hook_install(). 62 */ 63 function bench_chart_enable() { 64 db_query("UPDATE {system} SET weight = '-100' WHERE name = 'bench_chart'"); 65 } 66 67 /** 68 * Implementation of hook_uninstall(). 69 */ 70 function bench_chart_uninstall() { 71 // Remove tables. 72 drupal_uninstall_schema('bench_chart'); 73 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |