Some notes from the first review of 6--2.
General
-- Please use braces for all logic statements in accordance with Drupal code standards.
if {
}
See lines 79, 81, 101. Coder module can help here.
See also lines 270-274 for improperly nested logic statements.
-- We really can't use submodules titles like 'jpeg' or even 'word_xml' simply
because we don't want to hog the namespace.
-- JPEG module is only a tester, but it should really be a generic image handler, since
JPEG, GIF, PNG can be treated identically. Call it docapi_image() and you can do some good
mimetype checking / handling on the different image types.
-- Be extra careful that you hook names don't step on other hooks.
docapi_menu()
-- #title and #description no longer use t().
docapi_perm()
-- module needs its own configuration permission instead of 'administer site configuration'
-- permissions should be all lowercase.
docapi_cron()
-- Is cron the best place to do this? Why not just call this at the configuration page.
-- Or -- better -- require modules that use the API to use hook_enable()
function myplugin_enable() {
docapi_find_plugins();
}
docapi_find_plugins()
-- Does this function also clear "dead" plugins from the {docapi_plugins} table?
Or, you just require that modules clear themselves on hook_disable().
Comments
Comment #1
bradfordcp commentedI think I snagged all of these changes.
hook_enable() and hook_disable() have been implemented in the new docapi_image module. The word_xml module has been dropped as it is now obsolete and the image parser will provide a better example.
docapi_find_plugins has been removed and now the only function in cron is docapi_update_mimes(), which will query the parsers to verify which mimetypes are being checked / in use. Also old mimetypes will be removed if they are no longer supported.
Coder module has been installed and hopefully most of the code will be clean of formatting mistakes.
Comment #2
agentrickardCool.
Remember, we want to get the framework and workflow down first. Then we can start adding parsers -- and opening the API for other developers!
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.