Skip to content
Snippets Groups Projects
Commit 352c99aa authored by Neil Drumm's avatar Neil Drumm :wave:
Browse files

Issue #3342516: Remove old menu callback

parent 65108370
No related branches found
No related tags found
No related merge requests found
......@@ -27,13 +27,6 @@ define('PROJECT_COMPOSER_CATEGORY_EXTERNAL', "external");
* Implements hook_menu().
*/
function project_composer_menu() {
$items['packages/%project_composer_endpoint/packages.json'] = [
'page callback' => 'project_composer_root_metadata',
'page arguments' => [1],
'access arguments' => ['access content'],
'type' => MENU_CALLBACK,
];
$items['packages/%project_composer_endpoint/search.json'] = [
'page callback' => 'project_composer_search',
'page arguments' => [1],
......@@ -320,19 +313,6 @@ function project_composer_manage_provider_includes($includes) {
}
}
/**
* Menu callback for /packages.json.
*
* @param string $release_category
* Either 'legacy' or 'current'.
*/
function project_composer_root_metadata($release_category) {
// Hey Kid, Stop all the page cachin'
drupal_page_is_cacheable(FALSE);
drupal_json_output(project_composer_root_metadata_data($release_category));
}
/**
* Returns the data structure for the root composer.json.
*
......@@ -1855,11 +1835,8 @@ function project_composer_write_json($release_category, $json, $packagename = NU
$full_project_dir = $project_dir . '/' . $subdir;
if (!file_prepare_directory($full_project_dir , FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS)) {
$wrapper = file_stream_wrapper_get_instance_by_uri($project_dir);
watchdog('project_composer', '%path does not exist or is not writable.', array('%path' => $wrapper->realpath()));
if (function_exists('drush_main')) {
drush_set_error('NO_DIRECTORY', dt('@path does not exist or is not writable.', ['@path' => $wrapper->realpath()]));
}
return array('hash' => 'error', 'filename' => 'error');
watchdog('project_composer', '%path does not exist or is not writable.', ['%path' => $wrapper->realpath()], WATCHDOG_ERROR);
return ['hash' => 'error', 'filename' => 'error'];
}
// Write out file.
......@@ -1892,11 +1869,8 @@ function project_composer_write_include_json($release_category, $json, $groupnam
$project_dir = _project_composer_get_metadata_file_dir($release_category);
if (!file_prepare_directory($project_dir, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS)) {
$wrapper = file_stream_wrapper_get_instance_by_uri($project_dir);
watchdog('project_composer', '%path does not exist or is not writable.', array('%path' => $wrapper->realpath()));
if (function_exists('drush_main')){
drush_set_error('NO_DIRECTORY', dt('@path does not exist or is not writable.', ['@path' => $wrapper->realpath()]));
}
return array('hash' => 'error', 'filename' => 'error');
watchdog('project_composer', '%path does not exist or is not writable.', ['%path' => $wrapper->realpath()], WATCHDOG_ERROR);
return ['hash' => 'error', 'filename' => 'error'];
}
// Write out file.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment