aboutsummaryrefslogtreecommitdiff
path: root/video.install
diff options
context:
space:
mode:
authorHeshan <heshan@heidisoft.com>2011-03-04 23:20:28 +0530
committerHeshan <heshan@heidisoft.com>2011-03-04 23:20:28 +0530
commit72f7b7109d1cdf3ec1f5fb022170dedc8c9dc5e1 (patch)
tree4df43cb8b1a5371f792ca5bf657fdf0c4de32cf6 /video.install
parent554508a1df489a8634e876ada1fa3ddd66375f7a (diff)
downloadvideo-72f7b7109d1cdf3ec1f5fb022170dedc8c9dc5e1.tar.gz
video-72f7b7109d1cdf3ec1f5fb022170dedc8c9dc5e1.tar.bz2
Creating presets which can be exported with features, chostools and move subsidary module to modules directory
Diffstat (limited to 'video.install')
-rw-r--r--video.install108
1 files changed, 67 insertions, 41 deletions
diff --git a/video.install b/video.install
index 956f6ef..3250513 100644
--- a/video.install
+++ b/video.install
@@ -2,61 +2,60 @@
/**
* @file
- * Provides installation functions for video.module.
- *
- * @author Heshan Wanigasooriya <heshan at heidisoft dot com>
+ * Provides installation schema for video.module
+ * @author Heshan Wanigasooriya <heshan@heidisoft.com>
*
- * @todo
*/
/**
* Implementation of hook_schema().
*/
function video_schema() {
+ // video files
$schema['video_files'] = array(
- 'description' => 'Store video transcoding queue',
+ 'description' => 'Store video transcoding queue.',
'fields' => array(
'vid' => array(
- 'description' => t('Video id'),
+ 'description' => t('Video id, the primary identifier'),
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'fid' => array(
- 'description' => 'Original file id',
+ 'description' => 'The {file_managed}.fid being referenced in this field.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'nid' => array(
- 'description' => 'Node id',
+ 'description' => 'The {node}.nid being referenced in this field.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'status' => array(
- 'description' => 'Status of the transcoding',
+ 'description' => 'Status of the transcoding, possible values are 1, 5, 10, 20',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'dimensions' => array(
+ 'description' => 'The dimensions of the output video.',
'type' => 'varchar',
'length' => '255',
'default' => '',
- 'description' => 'The dimensions of the video.',
),
'started' => array(
- 'description' => t('Started transcodings'),
+ 'description' => t('Start timestamp of transcodings'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'completed' => array(
- 'description' => 'Transcoding completed',
+ 'description' => 'Transcoding completed timestamp',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
@@ -65,7 +64,8 @@ function video_schema() {
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
- 'description' => 'A serialized array of converted files. Use of this field is discouraged and it will likely disappear in a future version of Drupal.',
+ 'description' => 'A serialized array of converted files.
+ Use of this field is discouraged and it will likely disappear in a future version of Drupal.',
),
),
'indexes' => array(
@@ -74,38 +74,46 @@ function video_schema() {
),
'primary key' => array('vid'),
);
+ // video preset
+ $schema['video_preset'] = array(
+ 'description' => 'The preset table.',
+ 'fields' => array(
+ 'pid' => array(
+ 'description' => 'The primary identifier for a video preset.',
+ 'type' => 'serial',
+ 'unsigned' => TRUE,
+ 'not null' => TRUE,
+ ),
+ 'name' => array(
+ 'description' => 'The name of this preset.',
+ 'type' => 'varchar',
+ 'length' => 64,
+ 'not null' => TRUE,
+ 'default' => '',
+ ),
+ 'description' => array(
+ 'description' => 'A brief description of this preset.',
+ 'type' => 'text',
+ 'size' => 'medium',
+ 'translatable' => TRUE,
+ ),
+ 'settings' => array(
+ 'type' => 'text',
+ 'size' => 'medium',
+ 'serialize' => TRUE,
+ 'description' => 'Serialized player settings that do not warrant a dedicated column.
+ Use of this field is discouraged and it will likely disappear in a future version of Drupal.',
+ ),
+ ),
+ 'unique keys' => array(
+ 'name' => array('name'),
+ ),
+ 'primary key' => array('pid'),
+ );
return $schema;
}
/**
- * Implementation of hook_install().
- */
-function video_install() {
- // Create the videos directory and ensure it's writable.
- $directory = file_default_scheme() . '://videos';
- file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
-}
-
-/**
- * Implementation of hook_uninstall().
- */
-function video_uninstall() {
- drupal_uninstall_schema('video');
-// Delete all variables which begin with the namespaced "video_*".
-// $video_vars = array();
-// $query = "SELECT name FROM {variable} WHERE name LIKE '%video_%'";
-// $video_vars = db_query($query);
-// while ($result = db_fetch_array($video_vars)) {
-// if (strpos($result['name'], 'video') === 0) {
-// variable_del($result['name']);
-// }
-// }
-//
- // Remove the video directory and generated images.
- file_unmanaged_delete_recursive(file_default_scheme() . '://videos');
-}
-
-/**
* Implements hook_field_schema().
*/
function video_field_schema($field) {
@@ -146,4 +154,22 @@ function video_field_schema($field) {
),
),
);
+}
+
+/**
+ * Implementation of hook_install().
+ */
+function video_install() {
+ // Create the videos directory and ensure it's writable.
+ $directory = file_default_scheme() . '://videos';
+ file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
+}
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function video_uninstall() {
+ drupal_uninstall_schema('video');
+ // Remove the video directory and generated images.
+ file_unmanaged_delete_recursive(file_default_scheme() . '://videos');
} \ No newline at end of file