function composer_manager_file_dir in Composer Manager 7
Same name and namespace in other branches
- 6.2 composer_manager.writer.inc \composer_manager_file_dir()
- 6 composer_manager.writer.inc \composer_manager_file_dir()
- 7.2 composer_manager.module \composer_manager_file_dir()
Returns the realpath to the Composer file directory.
Return value
string
Throws
\RuntimeException
9 calls to composer_manager_file_dir()
- composer_manager_lockfile_load in ./
composer_manager.admin.inc - Loads the composer.lock file if it exists.
- composer_manager_lock_file in ./
composer_manager.module - Return the URI to the composer.lock file.
- composer_manager_rebuild_form in ./
composer_manager.admin.inc - Exposes a button that forces a rebuild of the composer.json file.
- 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.
2 string references to 'composer_manager_file_dir'
- composer_manager_settings_form_validate in ./
composer_manager.admin.inc - Form validation handler for composer_manager_settings_form().
- composer_manager_uninstall in ./
composer_manager.install - Implements hook_uninstall().
File
- ./
composer_manager.module, line 288 - Provides consolidated management of third-party Composer-compatible packages required by contributed modules.
Code
function composer_manager_file_dir() {
module_load_include('inc', 'composer_manager', 'composer_manager.writer');
$scheme = file_default_scheme();
// Composer can only be run on a locally mounted file system. If the scheme is
// set to something different like S3, we fall back to the public scheme.
if (!in_array($scheme, array(
'public',
'private',
))) {
$scheme = 'public';
}
$dir_uri = variable_get('composer_manager_file_dir', $scheme . '://composer');
composer_manager_prepare_directory($dir_uri);
if (!($realpath = drupal_realpath($dir_uri))) {
throw new \RuntimeException(t('Error resolving directory: @dir', array(
'@dir' => $dir_uri,
)));
}
return $realpath;
}