[Koha-devel] $query vs $query

Mason James mason.loves.sushi at gmail.com
Fri Jul 10 00:12:34 CEST 2009




>
> On Thu, Jul 9, 2009 at 12:16 PM, Marc
> Chantreux<marc.chantreux at biblibre.com> wrote:
>> hello koha coders,
>>
>> Koha naming convention drove us to a stupid bug: $query is used  
>> both for
>> the CGI object and the SQL statements.
>>
>> 1. Change the sql statement name
>>   a) to $statement
>>   b) to $sql
>>   c) to $smt
>>   d) to an explicit name (as $select_old_borrowers or  
>> $update_items ...)
>>   e) to your own idea
>> 2. Change the CGI object
>>   a) to $cgi (i have no idea why ...)
>>   b) to $r (as there is a lot of perl code still using this  
>> convention)
>>   c) to $input (because a part of koha already use it)
>>   d) to your own idea
>> 3. I don't want to change because *you* did errors ... $query is  
>> ok for me!
>>
>> for myself, i'm fan of 1d *and* 2a ($query is too generic and  
>> $input has
>> no sense when i write print $input->header).



On 2009/07/10, at 5:06 AM, Kyle Hall wrote:
> I would go with 1b and 2a myself.


i agree with 1b and 2a :)

yeah, $input and $query are pretty general :/
$cgi and $sql are much more explicit

with the exception that $sql could be something more verbose where  
needed
eg: like $sql_all_expired_borrowers etc..


if other people agree, i will try to do this in the future.




More information about the Koha-devel mailing list