bluecadet / bc_drupal_package_manager
Adds functionality to check for updates for custom Drupal modules built by Bluecadet.
Installs: 7 841
Dependents: 11
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^7.4||^8.0
- z4kn4fein/php-semver: ^2.0
This package is auto-updated.
Last update: 2024-10-28 16:09:16 UTC
README
Adds functionality to check for updates for custom Drupal modules built by Bluecadet.
EX.
use Bluecadet\DrupalPackageManager\Checker; /** * Implements hook_update_status_alter(). */ function HOOK_update_status_alter(&$projects) { $modules['bluecadet'] = [ 'bluecadet_utilities', 'bluecadet_file_struct', ]; $filtered_projects = []; foreach ($modules as $user => $user_data) { $filtered_projects += array_filter($projects, function($v) use ($user_data) { return in_array($v, $user_data); }, ARRAY_FILTER_USE_KEY); } $checker = new Checker($modules, $filtered_projects); foreach ($modules as $user => $user_data) { foreach ($user_data as $module_name) { if (in_array($module_name, array_keys($projects))) { $projects[$module_name] = $checker->updateDrupalModulePackage($projects[$module_name], $user, $module_name); } } } }