simple_instagram_feed.install in Simple Instagram Feed Block 8.3
Same filename and directory in other branches
Install, update and uninstall for simple instagram feed module.
File
simple_instagram_feed.installView source
<?php
use Drupal\Core\Installer\InstallerKernel;
/**
* @file
* Install, update and uninstall for simple instagram feed module.
*/
/**
* Implements hook_install().
*/
function simple_instagram_feed_install() {
if (function_exists('drupal_installation_attempted')) {
if (!drupal_installation_attempted()) {
\Drupal::service('simple_instagram_feed.library')
->isAvailable(TRUE);
}
}
else {
if (!InstallerKernel::installationAttempted()) {
\Drupal::service('simple_instagram_feed.library')
->isAvailable(TRUE);
}
}
}
/**
* Implements hook_requirements().
*/
function simple_instagram_feed_requirements($phase) {
if ($phase !== 'runtime') {
return [];
}
$simpleInstagramFeedLibrary = \Drupal::service('simple_instagram_feed.library');
$exists = $simpleInstagramFeedLibrary
->isAvailable();
return [
'simple_instagram_feed_library' => [
'title' => t('Simple instagram feed library'),
'description' => $exists ? '' : $simpleInstagramFeedLibrary
->getWarningMessage(),
'severity' => $exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
'value' => $exists ? t('Installed') : t('Not installed'),
],
];
}
Functions
Name | Description |
---|---|
simple_instagram_feed_install | Implements hook_install(). |
simple_instagram_feed_requirements | Implements hook_requirements(). |