Code coverage for /20081101/modules/blogapi/blogapi.install

Line #Times calledCode
1
<?php
2
// $Id: blogapi.install,v 1.3 2008/10/12 02:58:23 webchick Exp $
3
4
/**
5
 * Implementation of hook_install().
6
 */
71
function blogapi_install() {
8
  // Create tables.
91
  drupal_install_schema('blogapi');
101
}
11
12
/**
13
 * Implementation of hook_uninstall().
14
 */
151
function blogapi_uninstall() {
16
  // Remove tables.
170
  drupal_uninstall_schema('blogapi');
180
}
19
20
21
/**
22
 * Implementation of hook_schema().
23
 */
241
function blogapi_schema() {
251
  $schema['blogapi_files'] = array(
261
    'description' => t('Stores information for files uploaded via the
blogapi.'),
27
    'fields' => array(
28
      'fid' => array(
291
        'description' => t('Primary Key: Unique file ID.'),
301
        'type' => 'serial',
311
      ),
32
      'uid' => array(
331
        'description' => t('The {users}.uid of the user who is associated
with the file.'),
341
        'type' => 'int',
351
        'unsigned' => TRUE,
361
        'not null' => TRUE,
371
        'default' => 0,
381
      ),
39
      'filepath' => array(
401
        'description' => t('Path of the file relative to Drupal root.'),
411
        'type' => 'varchar',
421
        'length' => 255,
431
        'not null' => TRUE,
441
        'default' => '',
451
      ),
46
      'filesize' => array(
471
        'description' => t('The size of the file in bytes.'),
481
        'type' => 'int',
491
        'unsigned' => TRUE,
501
        'not null' => TRUE,
511
        'default' => 0,
521
      ),
531
    ),
541
    'primary key' => array('fid'),
55
    'indexes' => array(
561
      'uid' => array('uid'),
571
    ),
58
  );
59
601
  return $schema;
610
}
62
63
/**
64
 * @defgroup updates-5.x-to-6.x Blog API updates from 5.x to 6.x
65
 * @{
66
 */
67
68
/**
69
 * Inform users about the new permission.
70
 */
711
function blogapi_update_6000() {
720
  drupal_set_message("Blog API module does not depend on blog module's
permissions anymore, but provides its own 'administer content with blog
api' permission instead. Until <a href=\"" . url('admin/user/permissions',
array('fragment' => 'module-blogapi')) . '">this permission is assigned</a>
to at least one user role, only the site administrator will be able to use
Blog API features.');
730
  return array();
740
}
75
76
/**
77
 * Add blogapi_files table to enable size restriction for BlogAPI file
uploads.
78
 *
79
 * This table was introduced in Drupal 6.4.
80
 */
811
function blogapi_update_6001() {
820
  $ret = array();
83
840
  if (!db_table_exists('blogapi_files')) {
850
    $schema = blogapi_schema();
860
    db_create_table($ret, 'blogapi_files', $schema['blogapi_files']);
870
  }
88
890
  return $ret;
900
}
91
92
/**
93
 * @} End of "defgroup updates-5.x-to-6.x"
94
 * The next series of updates should start at 7000.
95
 */
961