Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRUP-803] Prevent installation alongside of the `apigee_edge_apidocs… #7

Merged
merged 3 commits into from
May 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions apigee_api_catalog.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/**
* @file
* Copyright 2019 Google Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

/**
* @file
* Install file for Apigee API Catalog.
*/

/**
* Implements hook_requirements().
*/
function apigee_api_catalog_requirements($phase) {
// Prevent installation alongside of the `apigee_edge_apidocs` module.
if ($phase === 'install' && \Drupal::moduleHandler()->moduleExists('apigee_edge_apidocs')) {
return [
'apigee_api_catalog_module_conflict' => [
'title' => t('Apigee API Catalog'),
'description' => t('The "Apigee Edge API Docs" module is currently installed. It is deprecated and should be uninstalled before installing the Apigee API Catalog module.'),
'severity' => REQUIREMENT_ERROR,
],
];
}

return [];
}