Head code cleaning (continuing)
Hi, The TGV travels 300km per hour, except when there is a problem on the high speed line. In this case, he travels at 100km per hour and needs 6 hours to do Paris => Marseille (with >400km on 850 at full speed). Fortunatly, there is power available for laptops computers, so I could work on Koha HEAD, to do some cleaning. I tried to test as many things as possible, but for sure i've introduced new Internal Server Errors or bugs !!! I mainly worked on C4::Search.pm that contained various subs, most of them being not at the right place. So I moved to a better location, modified scripts using the moved sub, and also removed some subs that where useless. Now, the Search.pm contains only search related subs. As the Search API will be deeply modified for 3.0/Zebra, the Search.pm will probably disappear soon, or be 100% rewritten !! I also : * continued to modify code & template to use biblionumber instead of : bib, bn or biblio... * continued to normalize API : sub to read things should be called getXXX. (subs to add should be newXXX, subs to modify modXXX, and subs to delete delXXX) Here are moved/modified subs from Search.pm: itemnodata => become getbibliofromitemnumber, moved to Biblio.pm getborrowercategory => moved to Koha.pm getbranchname => moved to Koha.pm isbnsearch => removed, unused getwebbiblioitems => moved to Biblio.pm getwebsites => moved to Biblio.pm QUESTION about websites : is this code used by someone ? not by me and not by anyone with MARC=ON probably, as there are no way to reach websites pages. barcodes => moved to Biblio.pm bibitems => moved to Biblio.pm ItemType => removed (replaced by a Koha.pm getitemtypeinfo) itemcount2 => removed, unused getborracctrecord => moved to Members.pm borrdata2 => moved to Members.pm allissues => moved to Members.pm borrissues => moved to Members.pm borrdata => moved to Members.pm BornameSearch => moved to Members.pm catalogueserach, KeywordSearch, CatSearch, subsearch => nothing changed. But should disappear in Koha 3.0, with new zebra search API. itemdata => moved to Biblio.pm. Renamed get_item_from_barcode bibdata => moved to Biblio.pm. Should be merged with getbiblio ? bibitemdata => moved to Biblio.pm. should be merged with bibitems ? subject => moved to Biblio.pm and renamed as getsubject (used only once in modbib.pl) addauthor => moved to Biblio.pm and renamed getaddauthor (used only once in modbib.pl) subtitle => moved to Biblio.pm and renamed getsubtitle (used only once in modbib.pl) itemissues => moved to Biblio.pm (could have been in Circ.pm as well as in Biblio.pm, but it's used in biblio detail, so when we have to read other biblio info) SUGGESTION : We have many subs to read the catalogue. Imho, we have too many. So we could probably clean the code a little bit more. Another idea would be to split catalogue add/modify/delete and catalogue read in 2 subs, as we usually don't need to read and write the catalogue in the same script. Would be more clear and could fasten a little the code compiling in cgi mode (no effect with mod-perl) TODO : Scripts related to members that are in KOHAROOT should be moved to another directory (pay, maninvoice...). Probably something like /members/ or a new /accounting/ -- Paul POULAIN Consultant indépendant en logiciels libres responsable francophone de koha (SIGB libre http://www.koha-fr.org)
On Thu, Sep 22, 2005 at 11:06:23AM +0200, Paul POULAIN wrote:
Now, the Search.pm contains only search related subs. As the Search API will be deeply modified for 3.0/Zebra, the Search.pm will probably disappear soon, or be 100% rewritten !! Sounds great Paul. Thanks for taking care of this.
getwebbiblioitems => moved to Biblio.pm getwebsites => moved to Biblio.pm QUESTION about websites : is this code used by someone ? not by me and not by anyone with MARC=ON probably, as there are no way to reach websites pages. I don't use those ...
SUGGESTION : We have many subs to read the catalogue. Imho, we have too many. So we could probably clean the code a little bit more. Great idea.
Another idea would be to split catalogue add/modify/delete and catalogue read in 2 subs, as we usually don't need to read and write the catalogue in the same script. Would be more clear and could fasten a little the code compiling in cgi mode (no effect with mod-perl) As far as mod_perl goes, I've experimented with using mod_perl2 on Apache2 and the OPAC seems to work fine ... but the Intranet doesn't. When I turned on warnings to troubleshoot I was met with too many warnings to be useful (mainly because we don't normally program with warnings on so some code will throw warnings).
So ... I'd like to institute a policy with HEAD. If you're working on something, please develop and commit with warnings on. When we're ready to do a release I'll go in and turn off warnings, but in the meantime, it will be very useful to ensure that we clean up the code. (and then I can return to troubleshooting mod_perl2) In fact, many of the code changes that need to be made to clean things up (like checking for existance of a variable before using it) should also speed things up (a bit). To help 'kick off' the new policy, I'd like to hold a 'Koha Warnings Meeting' sometime in the next couple of weeks (where we actually go through and turn on warnings and start fixin stuff ;-)). If you'd like to attend and have a time preference, send it to me.
TODO : Scripts related to members that are in KOHAROOT should be moved to another directory (pay, maninvoice...). Probably something like /members/ or a new /accounting/ I like /members/
Cheers, -- Joshua Ferraro VENDOR SERVICES FOR OPEN-SOURCE SOFTWARE President, Technology migration, training, maintenance, support LibLime Featuring Koha Open-Source ILS jmf@liblime.com |Full Demos at http://liblime.com/koha |1(888)KohaILS
Joshua Ferraro wrote:
On Thu, Sep 22, 2005 at 11:06:23AM +0200, Paul POULAIN wrote:
Now, the Search.pm contains only search related subs. As the Search API will be deeply modified for 3.0/Zebra, the Search.pm will probably disappear soon, or be 100% rewritten !!
Sounds great Paul. Thanks for taking care of this.
Yay, while you are in there, can you kill its dependency on Date::Manip :)
getwebbiblioitems => moved to Biblio.pm getwebsites => moved to Biblio.pm QUESTION about websites : is this code used by someone ? not by me and not by anyone with MARC=ON probably, as there are no way to reach websites pages.
I don't use those ...
I do, for libraries with MARC=OFF, eg http://library.lgnz.co.nz/cgi-bin/koha/opac-detail.pl?bib=3424 Chris -- Chris Cormack Katipo Communications Programmer www.katipo.co.nz 027 4500 789
Joshua Ferraro said: <snip>
So ... I'd like to institute a policy with HEAD. If you're working on something, please develop and commit with warnings on. When we're ready to do a release I'll go in and turn off warnings, but in the meantime, it will be very useful to ensure that we clean up the code.
I've added this to the "Koha Coding Standards and Guidelines for Contributors." -- Stephen Hedges Skemotah Solutions, USA www.skemotah.com -- shedges@skemotah.com
participants (4)
-
Chris Cormack -
Joshua Ferraro -
Paul POULAIN -
Stephen Hedges