cash-1.0.0/cash.install
cash.install
<?php
/**
* @file
* Installation actions for Cash.
*/
/**
* Implements hook_requirements().
*/
function cash_requirements($phase) {
$requirements = [];
if ($phase === 'runtime') {
$path = cash()->path() ?: cash()->path('cash');
$exists = FALSE;
if ($path && is_dir($path)) {
$exists = is_file($path . '/dist/cash.min.js');
}
$requirements['cash_library'] = [
'title' => t('Cash DOM library'),
'description' => $exists ? '' : t('The <a href=":url">Cash DOM library</a> should be installed at <strong>/libraries/[cash|cash-dom]/dist/cash.min.js</strong>, or any path supported by core library finder or libraries.module if installed. If using npm-asset or packagist, the folder is `cash-dom`. Check out file or folder permissions if troubled.', [':url' => 'https://github.com/fabiospampinato/cash']),
'severity' => $exists ? REQUIREMENT_OK : REQUIREMENT_ERROR,
'value' => $exists ? t('Installed') : t('Not installed'),
];
}
return $requirements;
}
