This is part of #2299715: [meta] Move core hooks from system.api.php to core.api.php or other files

We have various database-related documentation that is scattered around in Core files.

It should all be centralized in a new file:
core/modules/system/database.api.php

So, in this task:

a) Make a new file core/modules/system/database.api.php. It should have a @file doc block similar to what you see at the top of other *.api.php files in that directory. Use menu.api.php as a guide.

b) Move the "Database abstraction layer" topic documentation from core/includes/database.inc to this new file. This starts with:

/**
 * @defgroup database Database abstraction layer
 * @{

c) Take out this comment in database.inc:


/**
 * The following utility functions are simply convenience wrappers.
 *
 * They should never, ever have any database-specific code in them.
 */

d) Where the @defgroup was in database.inc, add an @addtogroup database block -- see
https://www.drupal.org/node/1354#defgroup

e) Move all of the database-related hooks that are currently in core/modules/system/system.api.php to the new database.api.php file. These include: hook_schema*, hook_query*

f) At the end of the database.api.php file, make sure there is an end @} tag to close out the defgroup.

g) Make sure that the database hooks all have @ingroup hooks in their documentation block near the end.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wadmiraal’s picture

Assigned: Unassigned » wadmiraal

On it.

wadmiraal’s picture

Quick question: do we move the Schema API there as well (currently in lib/core/Drupal/Core/Database/Schema.php)?

jhodgdon’s picture

yes good idea

wadmiraal’s picture

Status: Active » Needs review
FileSize
47.11 KB
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Perfect, thanks!

  • webchick committed 182bc04 on 8.0.x
    Issue #2469941 by wadmiraal, jhodgdon: Move database-related hook docs...
webchick’s picture

Status: Reviewed & tested by the community » Fixed

This is definitely a lot cleaner, thanks.

Committed and pushed to 8.0.x!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.