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.
Comment | File | Size | Author |
---|---|---|---|
#4 | drupal_database-api-documentation_2469941_4.patch | 47.11 KB | wadmiraal |
Comments
Comment #1
wadmiraal CreditAttribution: wadmiraal commentedOn it.
Comment #2
wadmiraal CreditAttribution: wadmiraal commentedQuick question: do we move the Schema API there as well (currently in lib/core/Drupal/Core/Database/Schema.php)?
Comment #3
jhodgdonyes good idea
Comment #4
wadmiraal CreditAttribution: wadmiraal commentedComment #5
jhodgdonPerfect, thanks!
Comment #7
webchickThis is definitely a lot cleaner, thanks.
Committed and pushed to 8.0.x!