You are here

function composer_manager_beta5_compatibility in Composer Manager 7

Ensures that sites don't break after upgrading from <= 7.x-1.0-beta5.

In versions <= 7.x-1.0-beta5, the default vendor directory was defined as "sites/all/libraries/composer'". In versions > 7.x-1.0-beta5, the default vendor directory is "sites/all/vendor". This check ensures that the vendor directory doesn't unexpectedly change for people who upgraded the module from an earlier version and haven't changed any of the default settings.

Composer Manager explicitly sets the "composer_manager_vendor_dir" to "sites/all/vendor" during installation, so we know that the module was upgraded if the variable isn't set.

2 calls to composer_manager_beta5_compatibility()
composer_manager_settings_form in ./composer_manager.admin.inc
Administrative settings for the Composer Manager module.
composer_manager_vendor_dir in ./composer_manager.module
Returns the path to the vendor directory.

File

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

Code

function composer_manager_beta5_compatibility() {
  if (NULL === ($default = variable_get('composer_manager_vendor_dir', NULL))) {

    // Set the variable to the old default so it doesn't change unexpectedly.
    variable_set('composer_manager_vendor_dir', 'sites/all/libraries/composer');
  }
}