Split up mollom.module to mollom.*.inc

Freso - August 16, 2008 - 09:57
Project:Mollom
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Dave Reid
Status:closed
Description

Mollom has a bunch of functions that are only called certain places (not just admin stuff). Let's split them up and use the awesome 'file' => 'mollom.*.inc' now that it's available!

#1

Dave Reid - March 22, 2009 - 20:06
Assigned to:Freso» Dave Reid

Agreed. I will look into splitting at least an admin.inc out. Not sure if a pages.inc is needed.

#2

Dave Reid - March 25, 2009 - 22:01
Status:active» needs review

Patch ready for review. The only other function able to be split out into the mollom.admin.inc file was _mollom_verify_keys().

AttachmentSize
296063-mollom-admin-inc-D6.patch 15.26 KB

#3

Freso - March 27, 2009 - 20:12
Assigned to:Dave Reid» Anonymous

There are eight functions (a little more than 150 lines) that are possible to take out to a mollom.pages.inc, for the various mollom/* callbacks. I think that's enough reason to do this split as well.

AttachmentSize
296063-splitting_mollom-3-d6.patch 29.1 KB

#4

Freso - March 28, 2009 - 06:11

And all (563) tests pass with the patch from #2.

#5

Dave Reid - March 28, 2009 - 20:04
Status:needs review» reviewed & tested by the community

Fixed a very minor coding style change in mollom_report_contact() in mollom.pages.inc. Confirmed all tests pass and manually reviewed the CAPTCHAs work and the report pages work as well.

AttachmentSize
296063-mollom-admin-pages-inc-D6.patch 29.11 KB

#6

Dave Reid - March 29, 2009 - 06:27

Rerolled with coder patch landing.

AttachmentSize
296063-mollom-admin-pages-inc-D6.patch 29.12 KB

#7

Dries - April 4, 2009 - 10:55
Status:reviewed & tested by the community» postponed

I don't think this is important. I'd prefer to keep everything in a single file for the time being. There is no real performance advantage to splitting things up, and it makes it more difficult to develop.

#8

Dave Reid - June 10, 2009 - 02:40
Assigned to:Anonymous» Dave Reid

Re-rolled to split out a few functions into mollom.inc that don't need to be loaded on every full bootstrap.

AttachmentSize
296063-split-incs.patch 33.8 KB

#9

Dave Reid - July 3, 2009 - 23:20

I'd really like this to be re-considered. Performance was the primary reason we can split modules into .admin.inc and .pages.inc in Drupal 6. There's no need to have the admin settings code (a fairly largish function) loaded on every single page request, and the same thing with all the report node/comment/mail code. After working with D6 for so long, having a larger module file is harder for me to scan. Any developer on an IDE with code completion shouldn't have any problems dealing with separate files. But that's still a personal preference. The main reason for this is its-the-way-Drupal-core-does-it. Looking forward to Drupal 7 and it's higher memory usage, splitting module files will be even more important.

#10

Dave Reid - July 30, 2009 - 17:30
Status:postponed» needs review

I'd also very much like this to land before any work on the UI refresh as part of the any-forms patch. Having a mollom.admin.inc will make things a *lot* easier since there will be a lot more code added.

#11

Dave Reid - July 30, 2009 - 20:29
Status:needs review» fixed

Committed to CVS. Thanks Freso for helping!

#12

System Message - August 13, 2009 - 20:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.