You are here

function composer_manager_has_composer_file in Composer Manager 7

Same name and namespace in other branches
  1. 6 composer_manager.module \composer_manager_has_composer_file()
  2. 7.2 composer_manager.module \composer_manager_has_composer_file()

Returns TRUE if at least one module has a composer.json file.

Parameters

array $modules: An array of modules being checked.

Return value

boolean

Deprecated

since 7.x-1.6 https://www.drupal.org/node/2297413

See also

composer_manager_packages_have_changed()

File

./composer_manager.module, line 150
Provides consolidated management of third-party Composer-compatible packages required by contributed modules.

Code

function composer_manager_has_composer_file(array $modules) {
  foreach ($modules as $module) {
    $module_path = drupal_get_path('module', $module);
    if (file_exists($module_path . '/composer.json')) {
      return TRUE;
    }
  }
  return FALSE;
}