Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
documentation
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
5 Jan 2015 at 11:05 UTC
Updated:
25 Jun 2015 at 15:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jhodgdonThis is a fine plan, although I think maybe it should just go in the top-level core directory, or maybe core/lib? I think it would be easier to find there.
We should also move the other *.api.php files in core/modules/system, like theme.api.php, etc. Only system.api.php is supposed to have stuff that is part of the System module itself... not that it actually does -- see #2299715: [meta] Move core hooks from system.api.php to core.api.php or other files, which still needs to be finished, and moves hooks from system.api.php to other files.
Comment #2
tadityar commentedUpdate Issue title and summary
Comment #3
tadityar commentedPostponed until several issues regarding core.api.php like [meta]#2299715 Move core hooks from system.api.php to core.api.php are fixed.
Comment #4
jhodgdonAll of the other issues have been resolved.
This can now be done, and I think it's a good idea. The question is where to move the *.api.php files. They do not belong in the System module (except system.api.php). But where?
Possible locations that may make sense:
core
core/lib
core/includes
core/documentation [new directory]
core/docs [new directory]
Any votes?
Comment #5
jhodgdonretitling
Comment #6
botrisI would vote for a dedicated (new) folder.
core/api [new directory] ?
Comment #7
jhodgdonI talked to @alexpott in IRC just now...
We think the best thing to do would be to move each file to near the code it is documenting.
Example:
database.api.php ==> core/lib/Drupal/Core/Database
This seems like it might be a good Novice issue... hopefully the patch will be small since it will just move a bunch of files. Use git mv and it should keep the patch tiny.
Oh and the core.api.php file can be moved to the top-level core directory.
Comment #8
lahoosascoots commentedThis is what I've got so far.
Everything look good?
What about module.api.php and token.api.php?
Comment #9
jhodgdonExcellent! Those mostly look like good places for those files.
Let's see. The Token class is in core/lib/Drupal/Core/Utility, so we can put the token file there.
The module-related classes are in core/lib/Drupal/Core/Extension, so we can put the module file there.
And I think the theme.api.php file is mostly about the render system, so let's actually put that in core/lib/Drupal/Core/Render instead of Theme.
Thanks for the research; just need a patch!
Comment #10
lahoosascoots commentedThis should do it.
Comment #11
lahoosascoots commentedNevermind. That failed miserably for some reason.
Comment #12
lahoosascoots commentedAll fixed. Not sure what banana I slipped on for that last one.
Comment #13
lahoosascoots commentedComment #14
jhodgdonHm. Can you make a patch using "git mv" commands? It should be a lot smaller, like just saying the files are moved, rather than containing the entire text of all the files.
Comment #15
lahoosascoots commentedI did use git mv and the above patch is what I ended up with.
Here are my steps:
Did I miss something from my normal process to fix this?
Comment #16
jhodgdonHm. I don't usually use the branch/commit workflow; I use git diff --cached. So I just tested with one file:
a) git mv core/modules/system/core.api.php core/core.api.php
b) git diff --cached
This ended up with a very small patch that looks like this:
Maybe you can try that?
Comment #17
lahoosascoots commentedRound 3.
Comment #18
lahoosascoots commentedComment #19
jhodgdonThanks! Looks good to me. I checked all the directories and I think they are the right places for those files. Assigning to @alexpott for final review/commit, since I discussed it with him earlier.
Comment #20
jhodgdonComment #23
chananapeeyush commentedPatch applied locally and tests also returned no errors.So retesting the patch.
Comment #24
jhodgdonComment #25
alexpottCommitted 0afbdd4 and pushed to 8.0.x. Thanks!
Docs are exempt from beta evaluation.