fancy_file_delete.install in Fancy File Delete 8
Same filename and directory in other branches
Install File for Fancy File Delete.
File
fancy_file_delete.installView source
<?php
/**
* @file
* Install File for Fancy File Delete.
*/
/**
* Implements hook_uninstall().
*/
function fancy_file_delete_uninstall() {
$schema = \Drupal::database()
->schema();
if ($schema
->tableExists('unmanaged_files')) {
$schema
->dropTable('unmanaged_files');
}
}
/**
* Implements hook_schema().
*/
function fancy_file_delete_schema() {
$schema = [];
$schema['unmanaged_files'] = [
'description' => 'Ironically adding Unmanaged files to the DB so we can use this to delete the files.',
'fields' => [
'unfid' => [
'description' => 'The primary identifier for the entity.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
],
'path' => [
'description' => 'The path of the file.',
'type' => 'text',
'size' => 'big',
'serialize' => TRUE,
'object default' => [],
],
],
'primary key' => [
'unfid',
],
];
return $schema;
}
/**
* Implements hook_enable().
*/
function fancy_file_delete_enable() {
// So the hook_menu items in views shows up.
drupal_flush_all_caches();
}
Functions
Name | Description |
---|---|
fancy_file_delete_enable | Implements hook_enable(). |
fancy_file_delete_schema | Implements hook_schema(). |
fancy_file_delete_uninstall | Implements hook_uninstall(). |