On Thu, Jun 14, 2012 at 12:58 AM, Chanaka Dharmarathna <pe.chanaka.ck@gmail.com> wrote:


On Tue, Jun 12, 2012 at 1:32 AM, Chanaka Dharmarathna <pe.chanaka.ck@gmail.com> wrote:


On Sun, Jun 10, 2012 at 11:21 PM, Dieter Adriaenssens <dieter.adriaenssens@gmail.com> wrote:
2012/6/9 Chanaka Dharmarathna <pe.chanaka.ck@gmail.com>:
>
>
> On Fri, Jun 8, 2012 at 10:58 AM, Chanaka Dharmarathna
> <pe.chanaka.ck@gmail.com> wrote:
>>
>> Hi All,
>>
>> I have a doubt of using @see tag in Docblock comments for functions.
>> In the comments of functions PMA_getTable() and PMA_getTableBody() in
>> display_tbl.lib.php file, @see tag is used for different purposes.
>> As I feel PMA_getTableBody() used that corrrectly.
>> What should be the actual behavior ?
>>
>> Regards !
>> --
>> ____________________________________
>>
>> Chanaka Indrajith
>> Bsc.Computer Engineering Undergraduate
>> Faculty of Engineering
>> University of Peradeniya
>> Sri Lanka
>> ____________________________________
>>
>
> Hi All,
>
> I am fixing some code violations in my code now.
> For remove code violation of large comparison in a if condition, what would
> be the better approach ?
>
> Ex:-
> if ((PMA_strlen($wkbval) > $GLOBALS['cfg']['LimitChars'])
>     && ($_SESSION['tmp_user_values']['display_text'] ==
> self::DISPLAY_PARTIAL_TEXT)
> ) {
> // code
> }
>
> Is that good to use tempory variable insted of using
> $_SESSION['tmp_user_values']['display_text'] ?

It depends :

If the value of $_SESSION['tmp_user_values']['display_text'] is used
later on in the code, you could assign it to a shorter local
(temporary) variable, and use that variable with a shorter name, in
the if statement and further on in the code.

If it is used only oncet you might consider assigning the result of

$_SESSION['tmp_user_values']['display_text'] == self::DISPLAY_PARTIAL_TEXT

to a local (temporary) variable and use that variable in the if statement.

Hope this helps!

--
Kind regards,

Dieter Adriaenssens

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Phpmyadmin-devel mailing list
Phpmyadmin-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel

Hi Dieter,

Thanks for your reply.
I agreed your first point.
But I feels little odd in the second point because only for one place we use an additional variable.
Its better if we can put that kind of conditions to two lines. Currently it gives errors by code sniffer.


Regards !
--
____________________________________

Chanaka Indrajith
Bsc.Computer Engineering Undergraduate
Faculty of Engineering
University of Peradeniya
Sri Lanka
____________________________________


Hi Michal,

I'll moving into refactoring common.lib.php file.
I'm intending to use the same improvements for this file as DisplayResults.class.php , including creating common.lib.php as a class.
Is there any suggestions from your side ?


Regards !
--
____________________________________

Chanaka Indrajith
Bsc.Computer Engineering Undergraduate
Faculty of Engineering
University of Peradeniya
Sri Lanka
____________________________________


Hi All,

I have already create a class for display_tbl.lib.php and PMA_getDataCellForBlobField() in master used the PMA_mimeDefaultFunction() function as a global function.
EX :
$str = 'PMA_mimeDefaultFunction';
$str($parameters);

I have moved the PMA_mimeDefaultFunction() from display_tbl.lib.php (in master) to common.lib.php file due to the way it has used inside display_tbl.lib.php.

Now I'm implementing class behavior in common.lib.php file.
So can anyone tell me a file, which contain global function, to where I should again move this PMA_mimeDefaultFunction().

Regards !
--
____________________________________

Chanaka Indrajith
Bsc.Computer Engineering Undergraduate
Faculty of Engineering
University of Peradeniya
Sri Lanka
____________________________________