[Koha-devel] $query vs $query

Jesse pianohacker at gmail.com
Thu Jul 9 19:58:06 CEST 2009


2009/7/9 Kyle Hall <kyle.m.hall at gmail.com>

> Is there any way to limit access to Context->dbh to only the C4
> Modules? Being able to enforce coding guidelines would be nice.
>
> Kyle
>
> http://www.kylehall.info
> Information Technology
> Crawford County Federated Library System ( http://www.ccfls.org )
>

This might, in theory, be possible. It might be easier to simply excise the
offending statements, however.

The following quickly written shell command brings up a list of all CGI
scripts that reference C4::Context->dbh:

$ find -name '*.pl' | xargs grep -l 'new CGI' | grep -v sms | xargs grep -l
'C4::Context->dbh'

Some of these entries are due to older, crustier parts of the API that still
require passing $dbh, which is fairly easy to fix.

The admin/ scripts are the worst offenders, but there is plenty else to keep
us busy. (Creating a module like C4::Admin to house the necessary SQL from
the admin scripts would be a worthwhile separate discussion.)

A quick search on Bugzilla didn't find anything related to this, but I could
easily have missed it. If not, we should create a tracking bug for this
purpose.

-- 
Jesse Weaver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-devel/attachments/20090709/43e070a1/attachment-0003.htm>


More information about the Koha-devel mailing list