From 75054e18251df9269bbffffb6ab2c0b67a45ec1e Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 2 Dec 2021 13:24:59 -0800 Subject: [PATCH] mixin/mgd-php - Convert live `*.mgd.php` from `hook_managed` to `` --- ext/afform/admin/afform_admin.civix.php | 24 ------------------------ ext/afform/admin/afform_admin.php | 12 ------------ ext/afform/admin/info.xml | 1 + ext/afform/core/afform.civix.php | 24 ------------------------ ext/afform/core/afform.php | 2 -- ext/afform/core/info.xml | 1 + ext/ewaysingle/ewaysingle.civix.php | 24 ------------------------ ext/ewaysingle/ewaysingle.php | 12 ------------ ext/ewaysingle/info.xml | 3 +++ ext/payflowpro/info.xml | 3 +++ ext/payflowpro/payflowpro.civix.php | 24 ------------------------ ext/payflowpro/payflowpro.php | 12 ------------ ext/search_kit/info.xml | 1 + ext/search_kit/search_kit.civix.php | 24 ------------------------ ext/search_kit/search_kit.php | 12 ------------ 15 files changed, 9 insertions(+), 170 deletions(-) diff --git a/ext/afform/admin/afform_admin.civix.php b/ext/afform/admin/afform_admin.civix.php index 203e4ccaec..33d14e07cf 100644 --- a/ext/afform/admin/afform_admin.civix.php +++ b/ext/afform/admin/afform_admin.civix.php @@ -220,30 +220,6 @@ function _afform_admin_civix_find_files($dir, $pattern) { return CRM_Utils_File::findFiles($dir, $pattern); } -/** - * (Delegated) Implements hook_civicrm_managed(). - * - * Find any *.mgd.php files, merge their content, and return. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed - */ -function _afform_admin_civix_civicrm_managed(&$entities) { - $mgdFiles = _afform_admin_civix_find_files(__DIR__, '*.mgd.php'); - sort($mgdFiles); - foreach ($mgdFiles as $file) { - $es = include $file; - foreach ($es as $e) { - if (empty($e['module'])) { - $e['module'] = E::LONG_NAME; - } - if (empty($e['params']['version'])) { - $e['params']['version'] = '3'; - } - $entities[] = $e; - } - } -} - /** * Glob wrapper which is guaranteed to return an array. * diff --git a/ext/afform/admin/afform_admin.php b/ext/afform/admin/afform_admin.php index 4d2fba42a0..61b588aa97 100644 --- a/ext/afform/admin/afform_admin.php +++ b/ext/afform/admin/afform_admin.php @@ -66,18 +66,6 @@ function afform_admin_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { return _afform_admin_civix_civicrm_upgrade($op, $queue); } -/** - * Implements hook_civicrm_managed(). - * - * Generate a list of entities to create/deactivate/delete when this module - * is installed, disabled, uninstalled. - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_managed - */ -function afform_admin_civicrm_managed(&$entities) { - _afform_admin_civix_civicrm_managed($entities); -} - /** * Implements hook_civicrm_entityTypes(). * diff --git a/ext/afform/admin/info.xml b/ext/afform/admin/info.xml index 07f398ce3d..101e033468 100644 --- a/ext/afform/admin/info.xml +++ b/ext/afform/admin/info.xml @@ -32,5 +32,6 @@ ang-php@1.0.0 menu-xml@1.0.0 + mgd-php@1.0.0 diff --git a/ext/afform/core/afform.civix.php b/ext/afform/core/afform.civix.php index ae87df3e49..7b375e21cb 100644 --- a/ext/afform/core/afform.civix.php +++ b/ext/afform/core/afform.civix.php @@ -220,30 +220,6 @@ function _afform_civix_find_files($dir, $pattern) { return CRM_Utils_File::findFiles($dir, $pattern); } -/** - * (Delegated) Implements hook_civicrm_managed(). - * - * Find any *.mgd.php files, merge their content, and return. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed - */ -function _afform_civix_civicrm_managed(&$entities) { - $mgdFiles = _afform_civix_find_files(__DIR__, '*.mgd.php'); - sort($mgdFiles); - foreach ($mgdFiles as $file) { - $es = include $file; - foreach ($es as $e) { - if (empty($e['module'])) { - $e['module'] = E::LONG_NAME; - } - if (empty($e['params']['version'])) { - $e['params']['version'] = '3'; - } - $entities[] = $e; - } - } -} - /** * Glob wrapper which is guaranteed to return an array. * diff --git a/ext/afform/core/afform.php b/ext/afform/core/afform.php index 693439979e..daaa23b3e4 100644 --- a/ext/afform/core/afform.php +++ b/ext/afform/core/afform.php @@ -126,8 +126,6 @@ function afform_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_managed */ function afform_civicrm_managed(&$entities) { - _afform_civix_civicrm_managed($entities); - /** @var \CRM_Afform_AfformScanner $scanner */ if (\Civi::container()->has('afform_scanner')) { $scanner = \Civi::service('afform_scanner'); diff --git a/ext/afform/core/info.xml b/ext/afform/core/info.xml index eebdba395e..58e9a9790e 100644 --- a/ext/afform/core/info.xml +++ b/ext/afform/core/info.xml @@ -27,5 +27,6 @@ ang-php@1.0.0 + mgd-php@1.0.0 diff --git a/ext/ewaysingle/ewaysingle.civix.php b/ext/ewaysingle/ewaysingle.civix.php index e09f39bfc2..6937009b31 100644 --- a/ext/ewaysingle/ewaysingle.civix.php +++ b/ext/ewaysingle/ewaysingle.civix.php @@ -244,30 +244,6 @@ function _ewaysingle_civix_find_files($dir, $pattern) { return $result; } -/** - * (Delegated) Implements hook_civicrm_managed(). - * - * Find any *.mgd.php files, merge their content, and return. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed - */ -function _ewaysingle_civix_civicrm_managed(&$entities) { - $mgdFiles = _ewaysingle_civix_find_files(__DIR__, '*.mgd.php'); - sort($mgdFiles); - foreach ($mgdFiles as $file) { - $es = include $file; - foreach ($es as $e) { - if (empty($e['module'])) { - $e['module'] = E::LONG_NAME; - } - if (empty($e['params']['version'])) { - $e['params']['version'] = '3'; - } - $entities[] = $e; - } - } -} - /** * Glob wrapper which is guaranteed to return an array. * diff --git a/ext/ewaysingle/ewaysingle.php b/ext/ewaysingle/ewaysingle.php index a1be18b892..9347754258 100644 --- a/ext/ewaysingle/ewaysingle.php +++ b/ext/ewaysingle/ewaysingle.php @@ -68,18 +68,6 @@ function ewaysingle_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { return _ewaysingle_civix_civicrm_upgrade($op, $queue); } -/** - * Implements hook_civicrm_managed(). - * - * Generate a list of entities to create/deactivate/delete when this module - * is installed, disabled, uninstalled. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed - */ -function ewaysingle_civicrm_managed(&$entities) { - _ewaysingle_civix_civicrm_managed($entities); -} - /** * Implements hook_civicrm_entityTypes(). * diff --git a/ext/ewaysingle/info.xml b/ext/ewaysingle/info.xml index e4130715f5..05a177ab85 100644 --- a/ext/ewaysingle/info.xml +++ b/ext/ewaysingle/info.xml @@ -27,6 +27,9 @@ + + mgd-php@1.0.0 + CRM/Ewaysingle diff --git a/ext/payflowpro/info.xml b/ext/payflowpro/info.xml index f65bc78e02..f373ea0a0b 100644 --- a/ext/payflowpro/info.xml +++ b/ext/payflowpro/info.xml @@ -24,6 +24,9 @@ + + mgd-php@1.0.0 + CRM/Payflowpro diff --git a/ext/payflowpro/payflowpro.civix.php b/ext/payflowpro/payflowpro.civix.php index e8653c1e20..e5f788828b 100644 --- a/ext/payflowpro/payflowpro.civix.php +++ b/ext/payflowpro/payflowpro.civix.php @@ -244,30 +244,6 @@ function _payflowpro_civix_find_files($dir, $pattern) { return $result; } -/** - * (Delegated) Implements hook_civicrm_managed(). - * - * Find any *.mgd.php files, merge their content, and return. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed - */ -function _payflowpro_civix_civicrm_managed(&$entities) { - $mgdFiles = _payflowpro_civix_find_files(__DIR__, '*.mgd.php'); - sort($mgdFiles); - foreach ($mgdFiles as $file) { - $es = include $file; - foreach ($es as $e) { - if (empty($e['module'])) { - $e['module'] = E::LONG_NAME; - } - if (empty($e['params']['version'])) { - $e['params']['version'] = '3'; - } - $entities[] = $e; - } - } -} - /** * Glob wrapper which is guaranteed to return an array. * diff --git a/ext/payflowpro/payflowpro.php b/ext/payflowpro/payflowpro.php index 561f59dec1..e4f8cd8ab7 100644 --- a/ext/payflowpro/payflowpro.php +++ b/ext/payflowpro/payflowpro.php @@ -68,18 +68,6 @@ function payflowpro_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) { return _payflowpro_civix_civicrm_upgrade($op, $queue); } -/** - * Implements hook_civicrm_managed(). - * - * Generate a list of entities to create/deactivate/delete when this module - * is installed, disabled, uninstalled. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed - */ -function payflowpro_civicrm_managed(&$entities) { - _payflowpro_civix_civicrm_managed($entities); -} - /** * Implements hook_civicrm_entityTypes(). * diff --git a/ext/search_kit/info.xml b/ext/search_kit/info.xml index db23837312..a8b9967fde 100644 --- a/ext/search_kit/info.xml +++ b/ext/search_kit/info.xml @@ -29,6 +29,7 @@ ang-php@1.0.0 menu-xml@1.0.0 + mgd-php@1.0.0 CRM/Search diff --git a/ext/search_kit/search_kit.civix.php b/ext/search_kit/search_kit.civix.php index 898c559606..c2cf820990 100644 --- a/ext/search_kit/search_kit.civix.php +++ b/ext/search_kit/search_kit.civix.php @@ -220,30 +220,6 @@ function _search_kit_civix_find_files($dir, $pattern) { return CRM_Utils_File::findFiles($dir, $pattern); } -/** - * (Delegated) Implements hook_civicrm_managed(). - * - * Find any *.mgd.php files, merge their content, and return. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed - */ -function _search_kit_civix_civicrm_managed(&$entities) { - $mgdFiles = _search_kit_civix_find_files(__DIR__, '*.mgd.php'); - sort($mgdFiles); - foreach ($mgdFiles as $file) { - $es = include $file; - foreach ($es as $e) { - if (empty($e['module'])) { - $e['module'] = E::LONG_NAME; - } - if (empty($e['params']['version'])) { - $e['params']['version'] = '3'; - } - $entities[] = $e; - } - } -} - /** * Glob wrapper which is guaranteed to return an array. * diff --git a/ext/search_kit/search_kit.php b/ext/search_kit/search_kit.php index e67149ea04..24a0e76058 100644 --- a/ext/search_kit/search_kit.php +++ b/ext/search_kit/search_kit.php @@ -38,18 +38,6 @@ function search_kit_civicrm_alterApiRoutePermissions(&$permissions, $entity, $ac } } -/** - * Implements hook_civicrm_managed(). - * - * Generate a list of entities to create/deactivate/delete when this module - * is installed, disabled, uninstalled. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed - */ -function search_kit_civicrm_managed(&$entities) { - _search_kit_civix_civicrm_managed($entities); -} - /** * Implements hook_civicrm_angularModules(). * -- 2.25.1