You are here

function composer_manager_file_dir in Composer Manager 6

Same name and namespace in other branches
  1. 6.2 composer_manager.writer.inc \composer_manager_file_dir()
  2. 7.2 composer_manager.module \composer_manager_file_dir()
  3. 7 composer_manager.module \composer_manager_file_dir()

Returns the realpath to the Composer file directory.

Return value

string

Throws

\RuntimeException

2 calls to composer_manager_file_dir()
composer_manager_relative_autoload_path in ./composer_manager.writer.inc
Returns the path for the autoloaded directory or class relative to the directory containing the composer.json file.
composer_manager_relative_vendor_dir in ./composer_manager.writer.inc
Returns the vendor directory relative to the composer file directory.
8 string references to 'composer_manager_file_dir'
composer_manager_lockfile_load in ./composer_manager.admin.inc
Loads the composer.lock file if it exists.
composer_manager_rebuild_form in ./composer_manager.admin.inc
Exposes a button that forces a rebuild of the composer.json file.
composer_manager_requirements in ./composer_manager.install
Implements hook_requirements().
composer_manager_settings_form in ./composer_manager.admin.inc
Administrative settings for the Composer Manager module.
composer_manager_settings_form_validate in ./composer_manager.admin.inc
Form validation handler for composer_manager_settings_form().

... See full list

File

./composer_manager.writer.inc, line 253
Functions related to the creation of the consolidated composer.json file.

Code

function composer_manager_file_dir() {
  $dir_uri = variable_get('composer_manager_file_dir', file_directory_path() . '/composer');
  if (!composer_manager_prepare_directory($dir_uri)) {
    throw new \RuntimeException(t('Error creating directory: @dir', array(
      '@dir' => $dir_uri,
    )));
  }
  if (!($realpath = realpath($dir_uri))) {
    throw new \RuntimeException(t('Error resolving directory: @dir', array(
      '@dir' => $dir_uri,
    )));
  }
  return $realpath;
}