Hi Michal,
I'm identifying the refactoring points in 'display_tbl.lib.php' file. I am trying to break the tasks on following areas.
* As a library file this should not render the HTML codes in functions it selves. First, all the HTML content in functions stored in string and render at the bottom of the function. Next, return the string having the HTML content, instead of rendering it inside the function itself and, from the calling end render that content. Probably method names will be modified with adding 'get' phrase.
* Some naming conventions are used incorrectly. For method name in lib file, naming convention is used generally used as 'PMA_methodName'. But some are not following this. While correcting them, suggested conventions in my proposal [0] is going to applied.
* There are several functions having more than 200 lines. I'm intending to divide those functions to smaller ones. (PMA_displayTableNavigation(), PMA_displayTableHeaders(), PMA_displayTableBody(), PMA_displayVerticalTable(), PMA_displayTable())
I am looking for your suggestions to identify more important points and modifications on suggested points. So that I can do more research by digging code more. As well, I'm using NetBeans IDE with PHP support, meld tool, Mozilla Firefox with Firebug, command line git client in Linux environment. Are there any other special tools which are more useful ?
[0] : http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/chanaka77...
Regards !
Hi
Dne Tue, 1 May 2012 02:02:38 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I'm identifying the refactoring points in 'display_tbl.lib.php' file. I am trying to break the tasks on following areas.
- As a library file this should not render the HTML codes in functions it
selves. First, all the HTML content in functions stored in string and render at the bottom of the function. Next, return the string having the HTML content, instead of rendering it inside the function itself and, from the calling end render that content. Probably method names will be modified with adding 'get' phrase.
- Some naming conventions are used incorrectly. For method name in lib
file, naming convention is used generally used as 'PMA_methodName'. But some are not following this. While correcting them, suggested conventions in my proposal [0] is going to applied.
- There are several functions having more than 200 lines. I'm intending to
divide those functions to smaller ones. (PMA_displayTableNavigation(), PMA_displayTableHeaders(), PMA_displayTableBody(), PMA_displayVerticalTable(), PMA_displayTable())
I think all this should be rather wrapped in object, so it would be PMA_Display::someFunction.
On Thu, May 3, 2012 at 4:38 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Tue, 1 May 2012 02:02:38 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I'm identifying the refactoring points in 'display_tbl.lib.php' file. I
am
trying to break the tasks on following areas.
- As a library file this should not render the HTML codes in functions it
selves. First, all the HTML content in functions stored in string and render at the bottom of the function. Next, return the string having the HTML content, instead of rendering it inside the function itself and, from the calling end render that content. Probably method names will be modified with adding 'get' phrase.
- Some naming conventions are used incorrectly. For method name in lib
file, naming convention is used generally used as 'PMA_methodName'. But some are not following this. While correcting them, suggested conventions in my proposal [0] is going
to
applied.
- There are several functions having more than 200 lines. I'm intending
to
divide those functions to smaller ones. (PMA_displayTableNavigation(), PMA_displayTableHeaders(), PMA_displayTableBody(), PMA_displayVerticalTable(), PMA_displayTable())
I think all this should be rather wrapped in object, so it would be PMA_Display::someFunction.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for your reply. I got the point Michal. After the mentioned tasks plus making this as a class, I can use 'PMA_Display::someFunction' where needed.
Regards !
On Sat, May 5, 2012 at 1:16 AM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Thu, May 3, 2012 at 4:38 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Tue, 1 May 2012 02:02:38 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I'm identifying the refactoring points in 'display_tbl.lib.php' file. I
am
trying to break the tasks on following areas.
- As a library file this should not render the HTML codes in functions
it
selves. First, all the HTML content in functions stored in string and render at the bottom of the function. Next, return the string having the HTML content, instead of rendering it inside the function itself and, from the calling end render that
content.
Probably method names will be modified with adding 'get' phrase.
- Some naming conventions are used incorrectly. For method name in lib
file, naming convention is used generally used as 'PMA_methodName'. But some are not following this. While correcting them, suggested conventions in my proposal [0] is
going to
applied.
- There are several functions having more than 200 lines. I'm intending
to
divide those functions to smaller ones. (PMA_displayTableNavigation(), PMA_displayTableHeaders(), PMA_displayTableBody(), PMA_displayVerticalTable(), PMA_displayTable())
I think all this should be rather wrapped in object, so it would be PMA_Display::someFunction.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for your reply. I got the point Michal. After the mentioned tasks plus making this as a class, I can use 'PMA_Display::someFunction' where needed.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I am involving with some refactoring in "PMA_displayTableHeaders" function in "display_tbl.lib.php" file. As I mentioned in my previous mail, first I'm trying to render all HTML at the bottom of the function itself. But I'm facing some problems.
While current code rendering HTML codes using "echo", there are some function calls which does not return anything but render HTML inside that. Ex : "PMA_generate_slider_effect" function in common.lib.php file -> call by 739 line in "display_tbl.lib.php" file.
There are several situations like that, in this function. Since they have used in other files also (test cases also implemented for them), I do not think to change those functions.
What I'm going to do is, remove HTML renderings everywhere inside the function, as well as possible by assigning those HTML to a variable, and render existing content in the variable before calling that kind of function (as above mentioned).
Ex : func { $tableHeadersHTML .= ''; ---- ---- $tableHeadersHTML .= '<div>' . 'some html content'; ---- *echo $tableHeadersHTML; // render HTML content before another function call which not just return a string of HTML* PMA_generate_slider_effect(params); ---- // repeat the procedure }
Before doing this, I would like to hear your suggestions on this.
Regards !
On 07/05/12 09:27, Chanaka Dharmarathna wrote:
On Sat, May 5, 2012 at 1:16 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Thu, May 3, 2012 at 4:38 PM, Michal Čihařmichal@cihar.com wrote:
Hi
Dne Tue, 1 May 2012 02:02:38 +0530 Chanaka Dharmarathnape.chanaka.ck@gmail.com napsal(a):
I'm identifying the refactoring points in 'display_tbl.lib.php' file. I
am
trying to break the tasks on following areas.
- As a library file this should not render the HTML codes in functions
it
selves. First, all the HTML content in functions stored in string and render at the bottom of the function. Next, return the string having the HTML content, instead of rendering it inside the function itself and, from the calling end render that
content.
Probably method names will be modified with adding 'get' phrase.
- Some naming conventions are used incorrectly. For method name in lib
file, naming convention is used generally used as 'PMA_methodName'. But some are not following this. While correcting them, suggested conventions in my proposal [0] is
going to
applied.
- There are several functions having more than 200 lines. I'm intending
to
divide those functions to smaller ones. (PMA_displayTableNavigation(), PMA_displayTableHeaders(), PMA_displayTableBody(), PMA_displayVerticalTable(), PMA_displayTable())
I think all this should be rather wrapped in object, so it would be PMA_Display::someFunction.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for your reply. I got the point Michal. After the mentioned tasks plus making this as a class, I can use 'PMA_Display::someFunction' where needed.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I am involving with some refactoring in "PMA_displayTableHeaders" function in "display_tbl.lib.php" file. As I mentioned in my previous mail, first I'm trying to render all HTML at the bottom of the function itself. But I'm facing some problems.
While current code rendering HTML codes using "echo", there are some function calls which does not return anything but render HTML inside that. Ex : "PMA_generate_slider_effect" function in common.lib.php file -> call by 739 line in "display_tbl.lib.php" file.
There are several situations like that, in this function. Since they have used in other files also (test cases also implemented for them), I do not think to change those functions.
What I'm going to do is, remove HTML renderings everywhere inside the function, as well as possible by assigning those HTML to a variable, and render existing content in the variable before calling that kind of function (as above mentioned).
Ex : func { $tableHeadersHTML .= ''; ---- ---- $tableHeadersHTML .= '<div>' . 'some html content'; ---- *echo $tableHeadersHTML; // render HTML content before another function call which not just return a string of HTML* PMA_generate_slider_effect(params); ---- // repeat the procedure }
Before doing this, I would like to hear your suggestions on this.
Regards !
I think that you should rewrite the PMA_generate_slider_effect function to output a string, like it should. I'd say don't worry about breaking test cases for functions that do things the wrong way around, besides those should simple enough to fix. As far as spotting other occurrences of the function in the code base, there are only 4 of them in total (and that includes the function declaration), so there is no excuse not to fix all of them. To find every occurrence, run:
git grep PMA_generate_slider_effect
Bye, Rouslan
On Mon, May 7, 2012 at 6:24 PM, Rouslan Placella rouslan@placella.comwrote:
On 07/05/12 09:27, Chanaka Dharmarathna wrote:
On Sat, May 5, 2012 at 1:16 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Thu, May 3, 2012 at 4:38 PM, Michal Čihařmichal@cihar.com wrote:
Hi
Dne Tue, 1 May 2012 02:02:38 +0530 Chanaka Dharmarathnape.chanaka.ck@gmail.com napsal(a):
I'm identifying the refactoring points in 'display_tbl.lib.php' file.
I
am
trying to break the tasks on following areas.
- As a library file this should not render the HTML codes in functions
it
selves. First, all the HTML content in functions stored in string and render at the bottom of the function. Next, return the string having the HTML content, instead of rendering
it
inside the function itself and, from the calling end render that
content.
Probably method names will be modified with adding 'get' phrase.
- Some naming conventions are used incorrectly. For method name in lib
file, naming convention is used generally used as 'PMA_methodName'.
But
some are not following this. While correcting them, suggested conventions in my proposal [0] is
going to
applied.
- There are several functions having more than 200 lines. I'm
intending
to
divide those functions to smaller ones. (PMA_displayTableNavigation(), PMA_displayTableHeaders(), PMA_displayTableBody(), PMA_displayVerticalTable(), PMA_displayTable())
I think all this should be rather wrapped in object, so it would be PMA_Display::someFunction.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for your reply. I got the point Michal. After the mentioned tasks plus making this as a class, I can use 'PMA_Display::someFunction' where needed.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I am involving with some refactoring in "PMA_displayTableHeaders"
function
in "display_tbl.lib.php" file. As I mentioned in my previous mail, first I'm trying to render all HTML
at
the bottom of the function itself. But I'm facing some problems.
While current code rendering HTML codes using "echo", there are some function calls which does not return anything but render HTML inside
that.
Ex : "PMA_generate_slider_effect" function in common.lib.php file ->
call
by 739 line in "display_tbl.lib.php" file.
There are several situations like that, in this function. Since they have used in other files also (test cases also implemented for them), I do not think to change those functions.
What I'm going to do is, remove HTML renderings everywhere inside the function, as well as possible by assigning those HTML to a variable, and render existing content in the variable before calling that kind of function (as above mentioned).
Ex : func { $tableHeadersHTML .= ''; ---- ---- $tableHeadersHTML .= '<div>' . 'some html content'; ---- *echo $tableHeadersHTML; // render HTML content before another
function
call which not just return a string of HTML* PMA_generate_slider_effect(params); ---- // repeat the procedure }
Before doing this, I would like to hear your suggestions on this.
Regards !
I think that you should rewrite the PMA_generate_slider_effect function to output a string, like it should. I'd say don't worry about breaking test cases for functions that do things the wrong way around, besides those should simple enough to fix. As far as spotting other occurrences of the function in the code base, there are only 4 of them in total (and that includes the function declaration), so there is no excuse not to fix all of them. To find every occurrence, run:
git grep PMA_generate_slider_effect
Bye, Rouslan
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 Rouslan,
That's good idea. Its better to correct those things in good manner. I'll try to rewrite that kind of functions. As well the tests.
Regards !
On Mon, May 7, 2012 at 10:07 PM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Mon, May 7, 2012 at 6:24 PM, Rouslan Placella rouslan@placella.comwrote:
On 07/05/12 09:27, Chanaka Dharmarathna wrote:
On Sat, May 5, 2012 at 1:16 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Thu, May 3, 2012 at 4:38 PM, Michal Čihařmichal@cihar.com wrote:
Hi
Dne Tue, 1 May 2012 02:02:38 +0530 Chanaka Dharmarathnape.chanaka.ck@gmail.com napsal(a):
I'm identifying the refactoring points in 'display_tbl.lib.php'
file. I
am
trying to break the tasks on following areas.
- As a library file this should not render the HTML codes in
functions
it
selves. First, all the HTML content in functions stored in string and render at the bottom of the function. Next, return the string having the HTML content, instead of
rendering it
inside the function itself and, from the calling end render that
content.
Probably method names will be modified with adding 'get' phrase.
- Some naming conventions are used incorrectly. For method name in
lib
file, naming convention is used generally used as 'PMA_methodName'.
But
some are not following this. While correcting them, suggested conventions in my proposal [0] is
going to
applied.
- There are several functions having more than 200 lines. I'm
intending
to
divide those functions to smaller ones.
(PMA_displayTableNavigation(),
PMA_displayTableHeaders(), PMA_displayTableBody(), PMA_displayVerticalTable(), PMA_displayTable())
I think all this should be rather wrapped in object, so it would be PMA_Display::someFunction.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for your reply. I got the point Michal. After the mentioned
tasks
plus making this as a class, I can use 'PMA_Display::someFunction'
where
needed.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I am involving with some refactoring in "PMA_displayTableHeaders"
function
in "display_tbl.lib.php" file. As I mentioned in my previous mail, first I'm trying to render all HTML
at
the bottom of the function itself. But I'm facing some problems.
While current code rendering HTML codes using "echo", there are some function calls which does not return anything but render HTML inside
that.
Ex : "PMA_generate_slider_effect" function in common.lib.php file ->
call
by 739 line in "display_tbl.lib.php" file.
There are several situations like that, in this function. Since they
have
used in other files also (test cases also implemented for them), I do
not
think to change those functions.
What I'm going to do is, remove HTML renderings everywhere inside the function, as well as possible by assigning those HTML to a variable, and render existing content in the variable before calling that kind of function (as above mentioned).
Ex : func { $tableHeadersHTML .= ''; ---- ---- $tableHeadersHTML .= '<div>' . 'some html content'; ---- *echo $tableHeadersHTML; // render HTML content before another
function
call which not just return a string of HTML* PMA_generate_slider_effect(params); ---- // repeat the procedure }
Before doing this, I would like to hear your suggestions on this.
Regards !
I think that you should rewrite the PMA_generate_slider_effect function to output a string, like it should. I'd say don't worry about breaking test cases for functions that do things the wrong way around, besides those should simple enough to fix. As far as spotting other occurrences of the function in the code base, there are only 4 of them in total (and that includes the function declaration), so there is no excuse not to fix all of them. To find every occurrence, run:
git grep PMA_generate_slider_effect
Bye, Rouslan
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 Rouslan,
That's good idea. Its better to correct those things in good manner. I'll try to rewrite that kind of functions. As well the tests.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Rouslan,
Do you have any idea of using different naming conventions for this ('PMA_generate_slider_effect') function than general. (not only this, there are several functions) Generally function names are like 'PMA_meaningfulDescription()'. This does not use underscores after 'PMA_' part and use camel caps. But here it is 'PMA_generate_slider_effect()'. Its different.
As well, Since this function is going to return a string after modifying, the name should be change to give a meaning to the user (developer). I'm thinking modify the name with 'get' phrase for that kind of functions. Ex :- 'PMA_getSliderEffectGeneratingHtml()' instead of 'PMA_generate_slider_effect' (existing one) Do you have any suggestions on that ?
Regards !
Le 2012-05-08 04:57, Chanaka Dharmarathna a écrit :
On Mon, May 7, 2012 at 10:07 PM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Mon, May 7, 2012 at 6:24 PM, Rouslan Placella rouslan@placella.comwrote:
On 07/05/12 09:27, Chanaka Dharmarathna wrote:
On Sat, May 5, 2012 at 1:16 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Thu, May 3, 2012 at 4:38 PM, Michal Čihařmichal@cihar.com wrote:
Hi
Dne Tue, 1 May 2012 02:02:38 +0530 Chanaka Dharmarathnape.chanaka.ck@gmail.com napsal(a):
> I'm identifying the refactoring points in 'display_tbl.lib.php'
file. I
am > trying to break the tasks on following areas. > > * As a library file this should not render the HTML codes in
functions
it > selves. First, all the HTML content in functions stored in string and > render at the bottom of the function. > Next, return the string having the HTML content, instead of
rendering it
> inside the function itself and, from the calling end render that content. > Probably method names will be modified with adding 'get' phrase. > > * Some naming conventions are used incorrectly. For method name in
lib
> file, naming convention is used generally used as 'PMA_methodName'.
But
> some are not following this. > While correcting them, suggested conventions in my proposal [0] is going to > applied. > > * There are several functions having more than 200 lines. I'm
intending
to > divide those functions to smaller ones.
(PMA_displayTableNavigation(),
> PMA_displayTableHeaders(), PMA_displayTableBody(), > PMA_displayVerticalTable(), PMA_displayTable())
I think all this should be rather wrapped in object, so it would be PMA_Display::someFunction.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for your reply. I got the point Michal. After the mentioned
tasks
plus making this as a class, I can use 'PMA_Display::someFunction'
where
needed.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I am involving with some refactoring in "PMA_displayTableHeaders"
function
in "display_tbl.lib.php" file. As I mentioned in my previous mail, first I'm trying to render all HTML
at
the bottom of the function itself. But I'm facing some problems.
While current code rendering HTML codes using "echo", there are some function calls which does not return anything but render HTML inside
that.
Ex : "PMA_generate_slider_effect" function in common.lib.php file ->
call
by 739 line in "display_tbl.lib.php" file.
There are several situations like that, in this function. Since they
have
used in other files also (test cases also implemented for them), I do
not
think to change those functions.
What I'm going to do is, remove HTML renderings everywhere inside the function, as well as possible by assigning those HTML to a variable, and render existing content in the variable before calling that kind of function (as above mentioned).
Ex : func { $tableHeadersHTML .= ''; ---- ---- $tableHeadersHTML .= '<div>' . 'some html content'; ---- *echo $tableHeadersHTML; // render HTML content before another
function
call which not just return a string of HTML* PMA_generate_slider_effect(params); ---- // repeat the procedure }
Before doing this, I would like to hear your suggestions on this.
Regards !
I think that you should rewrite the PMA_generate_slider_effect function to output a string, like it should. I'd say don't worry about breaking test cases for functions that do things the wrong way around, besides those should simple enough to fix. As far as spotting other occurrences of the function in the code base, there are only 4 of them in total (and that includes the function declaration), so there is no excuse not to fix all of them. To find every occurrence, run:
git grep PMA_generate_slider_effect
Bye, Rouslan
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 Rouslan,
That's good idea. Its better to correct those things in good manner. I'll try to rewrite that kind of functions. As well the tests.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Rouslan,
Do you have any idea of using different naming conventions for this ('PMA_generate_slider_effect') function than general. (not only this, there are several functions) Generally function names are like 'PMA_meaningfulDescription()'. This does not use underscores after 'PMA_' part and use camel caps. But here it is 'PMA_generate_slider_effect()'. Its different.
As well, Since this function is going to return a string after modifying, the name should be change to give a meaning to the user (developer). I'm thinking modify the name with 'get' phrase for that kind of functions. Ex :- 'PMA_getSliderEffectGeneratingHtml()' instead of 'PMA_generate_slider_effect' (existing one) Do you have any suggestions on that ?
Regards !
PMA_getDivForSliderEffect()
By the way, this is the naming convention for a global function (outside a class). Will this be inside a class?
On Tue, May 8, 2012 at 3:06 PM, Marc Delisle marc@infomarc.info wrote:
Le 2012-05-08 04:57, Chanaka Dharmarathna a écrit :
On Mon, May 7, 2012 at 10:07 PM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Mon, May 7, 2012 at 6:24 PM, Rouslan Placella <rouslan@placella.com
wrote:
On 07/05/12 09:27, Chanaka Dharmarathna wrote:
On Sat, May 5, 2012 at 1:16 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Thu, May 3, 2012 at 4:38 PM, Michal Čihařmichal@cihar.com
wrote:
> Hi > > Dne Tue, 1 May 2012 02:02:38 +0530 > Chanaka Dharmarathnape.chanaka.ck@gmail.com napsal(a): > >> I'm identifying the refactoring points in 'display_tbl.lib.php'
file. I
> am >> trying to break the tasks on following areas. >> >> * As a library file this should not render the HTML codes in
functions
> it >> selves. First, all the HTML content in functions stored in string
and
>> render at the bottom of the function. >> Next, return the string having the HTML content, instead of
rendering it
>> inside the function itself and, from the calling end render that > content. >> Probably method names will be modified with adding 'get' phrase. >> >> * Some naming conventions are used incorrectly. For method name in
lib
>> file, naming convention is used generally used as 'PMA_methodName'.
But
>> some are not following this. >> While correcting them, suggested conventions in my proposal [0] is > going to >> applied. >> >> * There are several functions having more than 200 lines. I'm
intending
> to >> divide those functions to smaller ones.
(PMA_displayTableNavigation(),
>> PMA_displayTableHeaders(), PMA_displayTableBody(), >> PMA_displayVerticalTable(), PMA_displayTable()) > > I think all this should be rather wrapped in object, so it would be > PMA_Display::someFunction. > > -- > Michal Čihař | http://cihar.com | http://blog.cihar.com > > >
> 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 Michal,
Thanks for your reply. I got the point Michal. After the mentioned
tasks
plus making this as a class, I can use 'PMA_Display::someFunction'
where
needed.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I am involving with some refactoring in "PMA_displayTableHeaders"
function
in "display_tbl.lib.php" file. As I mentioned in my previous mail, first I'm trying to render all
HTML
at
the bottom of the function itself. But I'm facing some problems.
While current code rendering HTML codes using "echo", there are some function calls which does not return anything but render HTML inside
that.
Ex : "PMA_generate_slider_effect" function in common.lib.php file ->
call
by 739 line in "display_tbl.lib.php" file.
There are several situations like that, in this function. Since they
have
used in other files also (test cases also implemented for them), I do
not
think to change those functions.
What I'm going to do is, remove HTML renderings everywhere inside the function, as well as possible by assigning those HTML to a variable,
and
render existing content in the variable before calling that kind of function (as above mentioned).
Ex : func { $tableHeadersHTML .= ''; ---- ---- $tableHeadersHTML .= '<div>' . 'some html content'; ---- *echo $tableHeadersHTML; // render HTML content before another
function
call which not just return a string of HTML* PMA_generate_slider_effect(params); ---- // repeat the procedure }
Before doing this, I would like to hear your suggestions on this.
Regards !
I think that you should rewrite the PMA_generate_slider_effect function to output a string, like it should. I'd say don't worry about breaking test cases for functions that do things the wrong way around, besides those should simple enough to fix. As far as spotting other occurrences of the function in the code base, there are only 4 of them in total
(and
that includes the function declaration), so there is no excuse not to fix all of them. To find every occurrence, run:
git grep PMA_generate_slider_effect
Bye, Rouslan
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 Rouslan,
That's good idea. Its better to correct those things in good manner. I'll try to rewrite that kind of functions. As well the tests.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Rouslan,
Do you have any idea of using different naming conventions for this ('PMA_generate_slider_effect') function than general. (not only this,
there
are several functions) Generally function names are like 'PMA_meaningfulDescription()'. This
does
not use underscores after 'PMA_' part and use camel caps. But here it is 'PMA_generate_slider_effect()'. Its different.
As well, Since this function is going to return a string after modifying, the name should be change to give a meaning to the user (developer). I'm thinking modify the name with 'get' phrase for that kind of
functions.
Ex :- 'PMA_getSliderEffectGeneratingHtml()' instead of 'PMA_generate_slider_effect' (existing one) Do you have any suggestions on that ?
Regards !
PMA_getDivForSliderEffect()
By the way, this is the naming convention for a global function (outside a class). Will this be inside a class?
-- Marc Delisle http://infomarc.info
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 Marc,
That name is seems pretty good. Thanks for suggesting. And Marc, what about the naming convention of local (for a class) methods.
As I feel common.lib.php file should contain a class and this function will be inside that.
Regards !
Le 2012-05-08 09:01, Chanaka Dharmarathna a écrit : (...)
Hi Rouslan,
Do you have any idea of using different naming conventions for this ('PMA_generate_slider_effect') function than general. (not only this,
there
are several functions) Generally function names are like 'PMA_meaningfulDescription()'. This
does
not use underscores after 'PMA_' part and use camel caps. But here it is 'PMA_generate_slider_effect()'. Its different.
As well, Since this function is going to return a string after modifying, the name should be change to give a meaning to the user (developer). I'm thinking modify the name with 'get' phrase for that kind of
functions.
Ex :- 'PMA_getSliderEffectGeneratingHtml()' instead of 'PMA_generate_slider_effect' (existing one) Do you have any suggestions on that ?
Regards !
PMA_getDivForSliderEffect()
By the way, this is the naming convention for a global function (outside a class). Will this be inside a class?
Hi Marc,
That name is seems pretty good. Thanks for suggesting. And Marc, what about the naming convention of local (for a class) methods.
As I feel common.lib.php file should contain a class and this function will be inside that.
Regards !
See "Class Variables and Methods" in [0].
[0] http://pear.php.net/manual/en/standards.naming.php
On Tue, May 8, 2012 at 6:42 PM, Marc Delisle marc@infomarc.info wrote:
Le 2012-05-08 09:01, Chanaka Dharmarathna a écrit : (...)
Hi Rouslan,
Do you have any idea of using different naming conventions for this ('PMA_generate_slider_effect') function than general. (not only this,
there
are several functions) Generally function names are like 'PMA_meaningfulDescription()'. This
does
not use underscores after 'PMA_' part and use camel caps. But here it is 'PMA_generate_slider_effect()'. Its different.
As well, Since this function is going to return a string after
modifying,
the name should be change to give a meaning to the user (developer). I'm thinking modify the name with 'get' phrase for that kind of
functions.
Ex :- 'PMA_getSliderEffectGeneratingHtml()' instead of 'PMA_generate_slider_effect' (existing one) Do you have any suggestions on that ?
Regards !
PMA_getDivForSliderEffect()
By the way, this is the naming convention for a global function (outside a class). Will this be inside a class?
Hi Marc,
That name is seems pretty good. Thanks for suggesting. And Marc, what about the naming convention of local (for a class)
methods.
As I feel common.lib.php file should contain a class and this function
will
be inside that.
Regards !
See "Class Variables and Methods" in [0].
[0] http://pear.php.net/manual/en/standards.naming.php
-- Marc Delisle http://infomarc.info
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 Marc,
I went through that document. If the function is global, it will be like 'PMA_getDivForSliderEffect()' And if it is a local function (for particular class), it will be like 'getDivForSliderEffect()'.
Though I went through that document before this, I couldn't get that point. Thanks for pointing out that.
Regards !
Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit :
See "Class Variables and Methods" in [0].
Hi Marc,
I went through that document. If the function is global, it will be like 'PMA_getDivForSliderEffect()' And if it is a local function (for particular class), it will be like 'getDivForSliderEffect()'.
If this is a public method, yes. If a private one, prefix its name with an underscore.
Though I went through that document before this, I couldn't get that point. Thanks for pointing out that.
On Tue, May 8, 2012 at 7:08 PM, Marc Delisle marc@infomarc.info wrote:
Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit :
See "Class Variables and Methods" in [0].
Hi Marc,
I went through that document. If the function is global, it will be like 'PMA_getDivForSliderEffect()' And if it is a local function (for particular class), it will be like 'getDivForSliderEffect()'.
If this is a public method, yes. If a private one, prefix its name with an underscore.
Though I went through that document before this, I couldn't get that
point.
Thanks for pointing out that.
-- Marc Delisle http://infomarc.info
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
Got it Marc. Thanks.
On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Tue, May 8, 2012 at 7:08 PM, Marc Delisle marc@infomarc.info wrote:
Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit :
See "Class Variables and Methods" in [0].
Hi Marc,
I went through that document. If the function is global, it will be like 'PMA_getDivForSliderEffect()' And if it is a local function (for particular class), it will be like 'getDivForSliderEffect()'.
If this is a public method, yes. If a private one, prefix its name with an underscore.
Though I went through that document before this, I couldn't get that
point.
Thanks for pointing out that.
-- Marc Delisle http://infomarc.info
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
Got it Marc. Thanks.
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I just did my first commit to my repository [0]. In that commit I have done some refactoring on "PMA_displayTableHeaders()" function in "display_tbl.php" file. All HTML renderings by "echo"s were removed and those HTML was rendered at the bottom of the function at once. As well some related functions in "common.lib.php" file also were modified in order to return a string of HTML content. But the tests were not yet modified according to my modifications. Since there was a conflict after my first local commit [1] (git commit), I had to resolve conflicts and commit again. (that is [0])
I have already installed phpUnit framework. It will be very helpful if you can suggest me some documentation to setup and run tests in PMA (selenium etc).
I'm intending to do the above refactoring procedure to all the functions in "display_tbl.lib.php" file before moving to any other task.
[0] : https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80... [1] : https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
Regards !
On 08/05/12 20:32, Chanaka Dharmarathna wrote:
On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Tue, May 8, 2012 at 7:08 PM, Marc Delislemarc@infomarc.info wrote:
Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit :
See "Class Variables and Methods" in [0].
Hi Marc,
I went through that document. If the function is global, it will be like 'PMA_getDivForSliderEffect()' And if it is a local function (for particular class), it will be like 'getDivForSliderEffect()'.
If this is a public method, yes. If a private one, prefix its name with an underscore.
Though I went through that document before this, I couldn't get that
point.
Thanks for pointing out that.
-- Marc Delisle http://infomarc.info
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
Got it Marc. Thanks.
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I just did my first commit to my repository [0]. In that commit I have done some refactoring on "PMA_displayTableHeaders()" function in "display_tbl.php" file. All HTML renderings by "echo"s were removed and those HTML was rendered at the bottom of the function at once. As well some related functions in "common.lib.php" file also were modified in order to return a string of HTML content. But the tests were not yet modified according to my modifications. Since there was a conflict after my first local commit [1] (git commit), I had to resolve conflicts and commit again. (that is [0])
I have already installed phpUnit framework. It will be very helpful if you can suggest me some documentation to setup and run tests in PMA (selenium etc).
I'm intending to do the above refactoring procedure to all the functions in "display_tbl.lib.php" file before moving to any other task.
[0] : https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80... [1] : https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
Regards !
I had a very quick look at your commit. I think that you're indenting some lines incorrectly (but I stand to be corrected on this one). AFAIK, you don't need to line up the operators, just indent by 4 spaces. Example:
// THIS IS BAD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS GOOD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS ALSO GOOD $radio_html .= '<label for="' . $html_field_id . '">'; $radio_html .= $choice_label; $radio_html .= '</label>';
Bye, Rouslan
On Wed, May 9, 2012 at 1:19 AM, Rouslan Placella rouslan@placella.comwrote:
On 08/05/12 20:32, Chanaka Dharmarathna wrote:
On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Tue, May 8, 2012 at 7:08 PM, Marc Delislemarc@infomarc.info
wrote:
Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit :
See "Class Variables and Methods" in [0].
Hi Marc,
I went through that document. If the function is global, it will be like
'PMA_getDivForSliderEffect()'
And if it is a local function (for particular class), it will be like 'getDivForSliderEffect()'.
If this is a public method, yes. If a private one, prefix its name with an underscore.
Though I went through that document before this, I couldn't get that
point.
Thanks for pointing out that.
-- Marc Delisle http://infomarc.info
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
Got it Marc. Thanks.
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I just did my first commit to my repository [0]. In that commit I have done some refactoring on
"PMA_displayTableHeaders()"
function in "display_tbl.php" file. All HTML renderings by "echo"s were removed and those HTML was rendered
at
the bottom of the function at once. As well some related functions in "common.lib.php" file also were
modified
in order to return a string of HTML content. But the tests were not yet modified according to my modifications. Since there was a conflict after my first local commit [1] (git commit),
I
had to resolve conflicts and commit again. (that is [0])
I have already installed phpUnit framework. It will be very helpful if you can suggest me some documentation to setup and run tests in PMA (selenium etc).
I'm intending to do the above refactoring procedure to all the functions
in
"display_tbl.lib.php" file before moving to any other task.
[0] :
https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80...
[1] :
https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
Regards !
I had a very quick look at your commit. I think that you're indenting some lines incorrectly (but I stand to be corrected on this one). AFAIK, you don't need to line up the operators, just indent by 4 spaces. Example:
// THIS IS BAD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS GOOD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS ALSO GOOD $radio_html .= '<label for="' . $html_field_id . '">'; $radio_html .= $choice_label; $radio_html .= '</label>';
Bye, Rouslan
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 Rouslan,
Thanks for your suggestion. I'll follow the way you mentioned as "THIS IS GOOD".
Regards !
On Wed, May 9, 2012 at 9:21 AM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Wed, May 9, 2012 at 1:19 AM, Rouslan Placella rouslan@placella.comwrote:
On 08/05/12 20:32, Chanaka Dharmarathna wrote:
On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Tue, May 8, 2012 at 7:08 PM, Marc Delislemarc@infomarc.info
wrote:
Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit :
> > See "Class Variables and Methods" in [0]. > > [0] http://pear.php.net/manual/en/standards.naming.php
Hi Marc,
I went through that document. If the function is global, it will be like
'PMA_getDivForSliderEffect()'
And if it is a local function (for particular class), it will be like 'getDivForSliderEffect()'.
If this is a public method, yes. If a private one, prefix its name
with
an underscore.
Though I went through that document before this, I couldn't get that
point.
Thanks for pointing out that.
-- Marc Delisle http://infomarc.info
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
Got it Marc. Thanks.
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I just did my first commit to my repository [0]. In that commit I have done some refactoring on
"PMA_displayTableHeaders()"
function in "display_tbl.php" file. All HTML renderings by "echo"s were removed and those HTML was rendered
at
the bottom of the function at once. As well some related functions in "common.lib.php" file also were
modified
in order to return a string of HTML content. But the tests were not yet modified according to my modifications. Since there was a conflict after my first local commit [1] (git
commit), I
had to resolve conflicts and commit again. (that is [0])
I have already installed phpUnit framework. It will be very helpful if you can suggest me some documentation to
setup
and run tests in PMA (selenium etc).
I'm intending to do the above refactoring procedure to all the
functions in
"display_tbl.lib.php" file before moving to any other task.
[0] :
https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80...
[1] :
https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
Regards !
I had a very quick look at your commit. I think that you're indenting some lines incorrectly (but I stand to be corrected on this one). AFAIK, you don't need to line up the operators, just indent by 4 spaces. Example:
// THIS IS BAD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS GOOD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS ALSO GOOD $radio_html .= '<label for="' . $html_field_id . '">'; $radio_html .= $choice_label; $radio_html .= '</label>';
Bye, Rouslan
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 Rouslan,
Thanks for your suggestion. I'll follow the way you mentioned as "THIS IS GOOD".
Regards !
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
In some functions there are pure HTML code snippets. (Ex :- PMA_displayTableNavigationOneButton() function in display_tbl.lib.php)
As I feel, its not good to convert all these snippets as PHP string and render them. So I'm intending to get those pure HTML snippets into separate function. That function can be named as 'PMA_renderTableNavigationForm' (for above case). What do you think about this ?
As well is there any reason for the phrase 'One' in the function "PMA_displayTableNavigation*One*Button()" ?
Regards !
On 09/05/12 09:39, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 9:21 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Wed, May 9, 2012 at 1:19 AM, Rouslan Placellarouslan@placella.comwrote:
On 08/05/12 20:32, Chanaka Dharmarathna wrote:
On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Tue, May 8, 2012 at 7:08 PM, Marc Delislemarc@infomarc.info
wrote:
Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit :
>> >> See "Class Variables and Methods" in [0]. >> >> [0] http://pear.php.net/manual/en/standards.naming.php
> Hi Marc, > > I went through that document. > If the function is global, it will be like
'PMA_getDivForSliderEffect()'
> And if it is a local function (for particular class), it will be like > 'getDivForSliderEffect()'.
If this is a public method, yes. If a private one, prefix its name
with
an underscore.
> > Though I went through that document before this, I couldn't get that point. > Thanks for pointing out that.
-- Marc Delisle http://infomarc.info
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
Got it Marc. Thanks.
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I just did my first commit to my repository [0]. In that commit I have done some refactoring on
"PMA_displayTableHeaders()"
function in "display_tbl.php" file. All HTML renderings by "echo"s were removed and those HTML was rendered
at
the bottom of the function at once. As well some related functions in "common.lib.php" file also were
modified
in order to return a string of HTML content. But the tests were not yet modified according to my modifications. Since there was a conflict after my first local commit [1] (git
commit), I
had to resolve conflicts and commit again. (that is [0])
I have already installed phpUnit framework. It will be very helpful if you can suggest me some documentation to
setup
and run tests in PMA (selenium etc).
I'm intending to do the above refactoring procedure to all the
functions in
"display_tbl.lib.php" file before moving to any other task.
[0] :
https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80...
[1] :
https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
Regards !
I had a very quick look at your commit. I think that you're indenting some lines incorrectly (but I stand to be corrected on this one). AFAIK, you don't need to line up the operators, just indent by 4 spaces. Example:
// THIS IS BAD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS GOOD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS ALSO GOOD $radio_html .= '<label for="' . $html_field_id . '">'; $radio_html .= $choice_label; $radio_html .= '</label>';
Bye, Rouslan
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 Rouslan,
Thanks for your suggestion. I'll follow the way you mentioned as "THIS IS GOOD".
Regards !
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
In some functions there are pure HTML code snippets. (Ex :- PMA_displayTableNavigationOneButton() function in display_tbl.lib.php)
As I feel, its not good to convert all these snippets as PHP string and render them. So I'm intending to get those pure HTML snippets into separate function. That function can be named as 'PMA_renderTableNavigationForm' (for above case). What do you think about this ?
As well is there any reason for the phrase 'One' in the function "PMA_displayTableNavigation*One*Button()" ?
Regards !
I think that the above example is *exactly* the kind of stuff that needs to be converted to strings.
Bye, Rouslan
On Wed, May 9, 2012 at 2:27 PM, Rouslan Placella rouslan@placella.comwrote:
On 09/05/12 09:39, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 9:21 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Wed, May 9, 2012 at 1:19 AM, Rouslan Placella<rouslan@placella.com
wrote:
On 08/05/12 20:32, Chanaka Dharmarathna wrote:
On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Tue, May 8, 2012 at 7:08 PM, Marc Delislemarc@infomarc.info
wrote:
> Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit : > >>> >>> See "Class Variables and Methods" in [0]. >>> >>> [0] http://pear.php.net/manual/en/standards.naming.php > >> Hi Marc, >> >> I went through that document. >> If the function is global, it will be like
'PMA_getDivForSliderEffect()'
>> And if it is a local function (for particular class), it will be
like
>> 'getDivForSliderEffect()'. > > If this is a public method, yes. If a private one, prefix its name
with
> an underscore. > >> >> Though I went through that document before this, I couldn't get
that
> point. >> Thanks for pointing out that. > > > > -- > Marc Delisle > http://infomarc.info > > > >
> 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 > > Got it Marc. Thanks.
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I just did my first commit to my repository [0]. In that commit I have done some refactoring on
"PMA_displayTableHeaders()"
function in "display_tbl.php" file. All HTML renderings by "echo"s were removed and those HTML was
rendered
at
the bottom of the function at once. As well some related functions in "common.lib.php" file also were
modified
in order to return a string of HTML content. But the tests were not yet modified according to my modifications. Since there was a conflict after my first local commit [1] (git
commit), I
had to resolve conflicts and commit again. (that is [0])
I have already installed phpUnit framework. It will be very helpful if you can suggest me some documentation to
setup
and run tests in PMA (selenium etc).
I'm intending to do the above refactoring procedure to all the
functions in
"display_tbl.lib.php" file before moving to any other task.
[0] :
https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80...
[1] :
https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
Regards !
I had a very quick look at your commit. I think that you're indenting some lines incorrectly (but I stand to be corrected on this one).
AFAIK,
you don't need to line up the operators, just indent by 4 spaces.
Example:
// THIS IS BAD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS GOOD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS ALSO GOOD $radio_html .= '<label for="' . $html_field_id . '">'; $radio_html .= $choice_label; $radio_html .= '</label>';
Bye, Rouslan
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 Rouslan,
Thanks for your suggestion. I'll follow the way you mentioned as "THIS IS GOOD".
Regards !
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
In some functions there are pure HTML code snippets. (Ex :- PMA_displayTableNavigationOneButton() function in display_tbl.lib.php)
As I feel, its not good to convert all these snippets as PHP string and render them. So I'm intending to get those pure HTML snippets into
separate
function. That function can be named as 'PMA_renderTableNavigationForm' (for above case). What do you think about this ?
As well is there any reason for the phrase 'One' in the function "PMA_displayTableNavigation*One*Button()" ?
Regards !
I think that the above example is *exactly* the kind of stuff that needs to be converted to strings.
Bye, Rouslan
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 Rouslan,
I have little doubt of the way I understand your point.
You are suggesting to render HTML content by PHP string, instead of using pure HTML, though there is nicely placed HTML code snippets. (around 5, 6 lines) Am I correct Rouslan ? Sorry if I'm repeat the wheel.
Regards !
On 09/05/12 21:08, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 2:27 PM, Rouslan Placellarouslan@placella.comwrote:
On 09/05/12 09:39, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 9:21 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Wed, May 9, 2012 at 1:19 AM, Rouslan Placella<rouslan@placella.com
wrote:
On 08/05/12 20:32, Chanaka Dharmarathna wrote:
On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
> > > On Tue, May 8, 2012 at 7:08 PM, Marc Delislemarc@infomarc.info
wrote:
> >> Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit : >> >>>> >>>> See "Class Variables and Methods" in [0]. >>>> >>>> [0] http://pear.php.net/manual/en/standards.naming.php >> >>> Hi Marc, >>> >>> I went through that document. >>> If the function is global, it will be like
'PMA_getDivForSliderEffect()'
>>> And if it is a local function (for particular class), it will be
like
>>> 'getDivForSliderEffect()'. >> >> If this is a public method, yes. If a private one, prefix its name
with
>> an underscore. >> >>> >>> Though I went through that document before this, I couldn't get
that
>> point. >>> Thanks for pointing out that. >> >> >> >> -- >> Marc Delisle >> http://infomarc.info >> >> >> >>
>> 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 >> >> > Got it Marc. > Thanks. > > > -- > ____________________________________ > > Chanaka Indrajith > Bsc.Computer Engineering Undergraduate > Faculty of Engineering > University of Peradeniya > Sri Lanka > ____________________________________ > > Hi Michal,
I just did my first commit to my repository [0]. In that commit I have done some refactoring on
"PMA_displayTableHeaders()"
function in "display_tbl.php" file. All HTML renderings by "echo"s were removed and those HTML was
rendered
at
the bottom of the function at once. As well some related functions in "common.lib.php" file also were
modified
in order to return a string of HTML content. But the tests were not yet modified according to my modifications. Since there was a conflict after my first local commit [1] (git
commit), I
had to resolve conflicts and commit again. (that is [0])
I have already installed phpUnit framework. It will be very helpful if you can suggest me some documentation to
setup
and run tests in PMA (selenium etc).
I'm intending to do the above refactoring procedure to all the
functions in
"display_tbl.lib.php" file before moving to any other task.
[0] :
https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80...
[1] :
https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
Regards !
I had a very quick look at your commit. I think that you're indenting some lines incorrectly (but I stand to be corrected on this one).
AFAIK,
you don't need to line up the operators, just indent by 4 spaces.
Example:
// THIS IS BAD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS GOOD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS ALSO GOOD $radio_html .= '<label for="' . $html_field_id . '">'; $radio_html .= $choice_label; $radio_html .= '</label>';
Bye, Rouslan
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 Rouslan,
Thanks for your suggestion. I'll follow the way you mentioned as "THIS IS GOOD".
Regards !
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
In some functions there are pure HTML code snippets. (Ex :- PMA_displayTableNavigationOneButton() function in display_tbl.lib.php)
As I feel, its not good to convert all these snippets as PHP string and render them. So I'm intending to get those pure HTML snippets into
separate
function. That function can be named as 'PMA_renderTableNavigationForm' (for above case). What do you think about this ?
As well is there any reason for the phrase 'One' in the function "PMA_displayTableNavigation*One*Button()" ?
Regards !
I think that the above example is *exactly* the kind of stuff that needs to be converted to strings.
Bye, Rouslan
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 Rouslan,
I have little doubt of the way I understand your point.
You are suggesting to render HTML content by PHP string, instead of using pure HTML, though there is nicely placed HTML code snippets. (around 5, 6 lines) Am I correct Rouslan ? Sorry if I'm repeat the wheel.
Yes, that's correct. And I don't thing that those lines are nice at all.
Bye, Rouslan
On Fri, May 11, 2012 at 12:39 AM, Rouslan Placella rouslan@placella.comwrote:
On 09/05/12 21:08, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 2:27 PM, Rouslan Placella<rouslan@placella.com wrote:
On 09/05/12 09:39, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 9:21 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Wed, May 9, 2012 at 1:19 AM, Rouslan Placella<rouslan@placella.com
wrote:
On 08/05/12 20:32, Chanaka Dharmarathna wrote: > On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< > pe.chanaka.ck@gmail.com> wrote: > >> >> >> On Tue, May 8, 2012 at 7:08 PM, Marc Delislemarc@infomarc.info wrote: >> >>> Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit : >>> >>>>> >>>>> See "Class Variables and Methods" in [0]. >>>>> >>>>> [0] http://pear.php.net/manual/en/standards.naming.php >>> >>>> Hi Marc, >>>> >>>> I went through that document. >>>> If the function is global, it will be like 'PMA_getDivForSliderEffect()' >>>> And if it is a local function (for particular class), it will be
like
>>>> 'getDivForSliderEffect()'. >>> >>> If this is a public method, yes. If a private one, prefix its name with >>> an underscore. >>> >>>> >>>> Though I went through that document before this, I couldn't get
that
>>> point. >>>> Thanks for pointing out that. >>> >>> >>> >>> -- >>> Marc Delisle >>> http://infomarc.info >>> >>> >>> >>>
>>> 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 >>> >>> >> Got it Marc. >> Thanks. >> >> >> -- >> ____________________________________ >> >> Chanaka Indrajith >> Bsc.Computer Engineering Undergraduate >> Faculty of Engineering >> University of Peradeniya >> Sri Lanka >> ____________________________________ >> >> > Hi Michal, > > I just did my first commit to my repository [0]. > In that commit I have done some refactoring on "PMA_displayTableHeaders()" > function in "display_tbl.php" file. > All HTML renderings by "echo"s were removed and those HTML was
rendered
at > the bottom of the function at once. > As well some related functions in "common.lib.php" file also were modified > in order to return a string of HTML content. > But the tests were not yet modified according to my modifications. > Since there was a conflict after my first local commit [1] (git commit), I > had to resolve conflicts and commit again. (that is [0]) > > I have already installed phpUnit framework. > It will be very helpful if you can suggest me some documentation to setup > and run tests in PMA (selenium etc). > > I'm intending to do the above refactoring procedure to all the functions in > "display_tbl.lib.php" file before moving to any other task. > > [0] : >
https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80...
> [1] : >
https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
> > Regards !
I had a very quick look at your commit. I think that you're indenting some lines incorrectly (but I stand to be corrected on this one).
AFAIK,
you don't need to line up the operators, just indent by 4 spaces.
Example:
// THIS IS BAD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS GOOD $radio_html .= '<label for="' . $html_field_id . '">' . $choice_label . '</label>';
// THIS IS ALSO GOOD $radio_html .= '<label for="' . $html_field_id . '">'; $radio_html .= $choice_label; $radio_html .= '</label>';
Bye, Rouslan
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 Rouslan,
Thanks for your suggestion. I'll follow the way you mentioned as "THIS IS GOOD".
Regards !
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
In some functions there are pure HTML code snippets. (Ex :- PMA_displayTableNavigationOneButton() function in display_tbl.lib.php)
As I feel, its not good to convert all these snippets as PHP string and render them. So I'm intending to get those pure HTML snippets into
separate
function. That function can be named as 'PMA_renderTableNavigationForm' (for above case). What do you think about this ?
As well is there any reason for the phrase 'One' in the function "PMA_displayTableNavigation*One*Button()" ?
Regards !
I think that the above example is *exactly* the kind of stuff that needs to be converted to strings.
Bye, Rouslan
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 Rouslan,
I have little doubt of the way I understand your point.
You are suggesting to render HTML content by PHP string, instead of using pure HTML, though there is nicely placed HTML code snippets. (around 5, 6 lines) Am I correct Rouslan ? Sorry if I'm repeat the wheel.
Yes, that's correct. And I don't thing that those lines are nice at all.
Bye, Rouslan
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 Rouslan,
I was already thinking of do the same thing you pointed. It will cause some sort of problems if I do the previous thing I suggested. Thanks for your help.
Regards !
On Fri, May 11, 2012 at 7:05 AM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Fri, May 11, 2012 at 12:39 AM, Rouslan Placella rouslan@placella.comwrote:
On 09/05/12 21:08, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 2:27 PM, Rouslan Placella<rouslan@placella.com wrote:
On 09/05/12 09:39, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 9:21 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Wed, May 9, 2012 at 1:19 AM, Rouslan Placella<
rouslan@placella.com
wrote:
> On 08/05/12 20:32, Chanaka Dharmarathna wrote: >> On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< >> pe.chanaka.ck@gmail.com> wrote: >> >>> >>> >>> On Tue, May 8, 2012 at 7:08 PM, Marc Delislemarc@infomarc.info > wrote: >>> >>>> Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit : >>>> >>>>>> >>>>>> See "Class Variables and Methods" in [0]. >>>>>> >>>>>> [0] http://pear.php.net/manual/en/standards.naming.php >>>> >>>>> Hi Marc, >>>>> >>>>> I went through that document. >>>>> If the function is global, it will be like > 'PMA_getDivForSliderEffect()' >>>>> And if it is a local function (for particular class), it will be
like
>>>>> 'getDivForSliderEffect()'. >>>> >>>> If this is a public method, yes. If a private one, prefix its
name
> with >>>> an underscore. >>>> >>>>> >>>>> Though I went through that document before this, I couldn't get
that
>>>> point. >>>>> Thanks for pointing out that. >>>> >>>> >>>> >>>> -- >>>> Marc Delisle >>>> http://infomarc.info >>>> >>>> >>>> >>>> >
>>>> 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 >>>> >>>> >>> Got it Marc. >>> Thanks. >>> >>> >>> -- >>> ____________________________________ >>> >>> Chanaka Indrajith >>> Bsc.Computer Engineering Undergraduate >>> Faculty of Engineering >>> University of Peradeniya >>> Sri Lanka >>> ____________________________________ >>> >>> >> Hi Michal, >> >> I just did my first commit to my repository [0]. >> In that commit I have done some refactoring on > "PMA_displayTableHeaders()" >> function in "display_tbl.php" file. >> All HTML renderings by "echo"s were removed and those HTML was
rendered
> at >> the bottom of the function at once. >> As well some related functions in "common.lib.php" file also were > modified >> in order to return a string of HTML content. >> But the tests were not yet modified according to my modifications. >> Since there was a conflict after my first local commit [1] (git > commit), I >> had to resolve conflicts and commit again. (that is [0]) >> >> I have already installed phpUnit framework. >> It will be very helpful if you can suggest me some documentation to > setup >> and run tests in PMA (selenium etc). >> >> I'm intending to do the above refactoring procedure to all the > functions in >> "display_tbl.lib.php" file before moving to any other task. >> >> [0] : >> >
https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80...
>> [1] : >> >
https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
>> >> Regards ! > > I had a very quick look at your commit. I think that you're
indenting
> some lines incorrectly (but I stand to be corrected on this one).
AFAIK,
> you don't need to line up the operators, just indent by 4 spaces.
Example:
> > // THIS IS BAD > $radio_html .= '<label for="' . $html_field_id . '">' > . $choice_label > . '</label>'; > > // THIS IS GOOD > $radio_html .= '<label for="' . $html_field_id . '">' > . $choice_label > . '</label>'; > > // THIS IS ALSO GOOD > $radio_html .= '<label for="' . $html_field_id . '">'; > $radio_html .= $choice_label; > $radio_html .= '</label>'; > > Bye, > Rouslan > > >
> 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 Rouslan,
Thanks for your suggestion. I'll follow the way you mentioned as "THIS IS GOOD".
Regards !
-- ____________________________________
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
In some functions there are pure HTML code snippets. (Ex :- PMA_displayTableNavigationOneButton() function in display_tbl.lib.php)
As I feel, its not good to convert all these snippets as PHP string
and
render them. So I'm intending to get those pure HTML snippets into
separate
function. That function can be named as
'PMA_renderTableNavigationForm'
(for above case). What do you think about this ?
As well is there any reason for the phrase 'One' in the function "PMA_displayTableNavigation*One*Button()" ?
Regards !
I think that the above example is *exactly* the kind of stuff that
needs
to be converted to strings.
Bye, Rouslan
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 Rouslan,
I have little doubt of the way I understand your point.
You are suggesting to render HTML content by PHP string, instead of
using
pure HTML, though there is nicely placed HTML code snippets. (around 5,
6
lines) Am I correct Rouslan ? Sorry if I'm repeat the wheel.
Yes, that's correct. And I don't thing that those lines are nice at all.
Bye, Rouslan
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 Rouslan,
I was already thinking of do the same thing you pointed. It will cause some sort of problems if I do the previous thing I suggested. Thanks for your help.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
The function "PMA_displayTableBody()" in display_tbl.lib.php is always return true. But it does not seems like, useful for other place where it have been used. (Used only in "PMA_displayTable()" function in same file)
Inside "PMA_displayTable()" function it just assign the return value (true) to variable called '$clause_is_unique'. And variable is only used at one place. it is,
echo '<input type="hidden" name="clause_is_unique"' .' value="' . *$clause_is_unique* . '" />' . "\n";
So, if this always return true, why don't we hard code true in the above case. And modify the "PMA_displayTableBody()" function to return string of html content.
Am I going wrong ?
Regards !
On Fri, May 11, 2012 at 11:12 AM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Fri, May 11, 2012 at 7:05 AM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Fri, May 11, 2012 at 12:39 AM, Rouslan Placella rouslan@placella.comwrote:
On 09/05/12 21:08, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 2:27 PM, Rouslan Placella<rouslan@placella.com wrote:
On 09/05/12 09:39, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 9:21 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
> > > On Wed, May 9, 2012 at 1:19 AM, Rouslan Placella<
rouslan@placella.com
wrote: > >> On 08/05/12 20:32, Chanaka Dharmarathna wrote: >>> On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< >>> pe.chanaka.ck@gmail.com> wrote: >>> >>>> >>>> >>>> On Tue, May 8, 2012 at 7:08 PM, Marc Delislemarc@infomarc.info >> wrote: >>>> >>>>> Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit : >>>>> >>>>>>> >>>>>>> See "Class Variables and Methods" in [0]. >>>>>>> >>>>>>> [0] http://pear.php.net/manual/en/standards.naming.php >>>>> >>>>>> Hi Marc, >>>>>> >>>>>> I went through that document. >>>>>> If the function is global, it will be like >> 'PMA_getDivForSliderEffect()' >>>>>> And if it is a local function (for particular class), it will
be
like
>>>>>> 'getDivForSliderEffect()'. >>>>> >>>>> If this is a public method, yes. If a private one, prefix its
name
>> with >>>>> an underscore. >>>>> >>>>>> >>>>>> Though I went through that document before this, I couldn't get
that
>>>>> point. >>>>>> Thanks for pointing out that. >>>>> >>>>> >>>>> >>>>> -- >>>>> Marc Delisle >>>>> http://infomarc.info >>>>> >>>>> >>>>> >>>>> >>
>>>>> 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 >>>>> >>>>> >>>> Got it Marc. >>>> Thanks. >>>> >>>> >>>> -- >>>> ____________________________________ >>>> >>>> Chanaka Indrajith >>>> Bsc.Computer Engineering Undergraduate >>>> Faculty of Engineering >>>> University of Peradeniya >>>> Sri Lanka >>>> ____________________________________ >>>> >>>> >>> Hi Michal, >>> >>> I just did my first commit to my repository [0]. >>> In that commit I have done some refactoring on >> "PMA_displayTableHeaders()" >>> function in "display_tbl.php" file. >>> All HTML renderings by "echo"s were removed and those HTML was
rendered
>> at >>> the bottom of the function at once. >>> As well some related functions in "common.lib.php" file also were >> modified >>> in order to return a string of HTML content. >>> But the tests were not yet modified according to my modifications. >>> Since there was a conflict after my first local commit [1] (git >> commit), I >>> had to resolve conflicts and commit again. (that is [0]) >>> >>> I have already installed phpUnit framework. >>> It will be very helpful if you can suggest me some documentation
to
>> setup >>> and run tests in PMA (selenium etc). >>> >>> I'm intending to do the above refactoring procedure to all the >> functions in >>> "display_tbl.lib.php" file before moving to any other task. >>> >>> [0] : >>> >>
https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80...
>>> [1] : >>> >>
https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
>>> >>> Regards ! >> >> I had a very quick look at your commit. I think that you're
indenting
>> some lines incorrectly (but I stand to be corrected on this one).
AFAIK,
>> you don't need to line up the operators, just indent by 4 spaces.
Example:
>> >> // THIS IS BAD >> $radio_html .= '<label for="' . $html_field_id . '">' >> . $choice_label >> . '</label>'; >> >> // THIS IS GOOD >> $radio_html .= '<label for="' . $html_field_id . '">' >> . $choice_label >> . '</label>'; >> >> // THIS IS ALSO GOOD >> $radio_html .= '<label for="' . $html_field_id . '">'; >> $radio_html .= $choice_label; >> $radio_html .= '</label>'; >> >> Bye, >> Rouslan >> >> >>
>> 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 Rouslan, > > Thanks for your suggestion. > I'll follow the way you mentioned as "THIS IS GOOD". > > Regards ! > > -- > ____________________________________ > > Chanaka Indrajith > Bsc.Computer Engineering Undergraduate > Faculty of Engineering > University of Peradeniya > Sri Lanka > ____________________________________ > > Hi Michal,
In some functions there are pure HTML code snippets. (Ex :- PMA_displayTableNavigationOneButton() function in
display_tbl.lib.php)
As I feel, its not good to convert all these snippets as PHP string
and
render them. So I'm intending to get those pure HTML snippets into
separate
function. That function can be named as
'PMA_renderTableNavigationForm'
(for above case). What do you think about this ?
As well is there any reason for the phrase 'One' in the function "PMA_displayTableNavigation*One*Button()" ?
Regards !
I think that the above example is *exactly* the kind of stuff that
needs
to be converted to strings.
Bye, Rouslan
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 Rouslan,
I have little doubt of the way I understand your point.
You are suggesting to render HTML content by PHP string, instead of
using
pure HTML, though there is nicely placed HTML code snippets. (around
5, 6
lines) Am I correct Rouslan ? Sorry if I'm repeat the wheel.
Yes, that's correct. And I don't thing that those lines are nice at all.
Bye, Rouslan
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 Rouslan,
I was already thinking of do the same thing you pointed. It will cause some sort of problems if I do the previous thing I suggested. Thanks for your help.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
The function "PMA_displayTableBody()" in display_tbl.lib.php is always return true. But it does not seems like, useful for other place where it have been used. (Used only in "PMA_displayTable()" function in same file)
Inside "PMA_displayTable()" function it just assign the return value (true) to variable called '$clause_is_unique'. And variable is only used at one place. it is,
echo '<input type="hidden" name="clause_is_unique"' .' value="' . *$clause_is_unique* . '" />' . "\n";
So, if this always return true, why don't we hard code true in the above case. And modify the "PMA_displayTableBody()" function to return string of html content.
Am I going wrong ?
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I think I was wrong. Though the block comments of PMA_displayTableBody function, mentioned that it always return true, when digging the code, and looking at the bottom comments, seems like its very important.
I'll modify the function to return an array, having two elements which are string of HTML content and boolean ($clause_is_unique) The name will change from "PMA_displayTableBody" to "PMA_getTableBodyParams". I hope to see your suggestions.
Regards !
On 11/05/12 08:26, Chanaka Dharmarathna wrote:
On Fri, May 11, 2012 at 11:12 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Fri, May 11, 2012 at 7:05 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Fri, May 11, 2012 at 12:39 AM, Rouslan Placellarouslan@placella.comwrote:
On 09/05/12 21:08, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 2:27 PM, Rouslan Placella<rouslan@placella.com wrote:
On 09/05/12 09:39, Chanaka Dharmarathna wrote: > On Wed, May 9, 2012 at 9:21 AM, Chanaka Dharmarathna< > pe.chanaka.ck@gmail.com> wrote: > >> >> >> On Wed, May 9, 2012 at 1:19 AM, Rouslan Placella<
rouslan@placella.com
> wrote: >> >>> On 08/05/12 20:32, Chanaka Dharmarathna wrote: >>>> On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< >>>> pe.chanaka.ck@gmail.com> wrote: >>>> >>>>> >>>>> >>>>> On Tue, May 8, 2012 at 7:08 PM, Marc Delislemarc@infomarc.info >>> wrote: >>>>> >>>>>> Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit : >>>>>> >>>>>>>> >>>>>>>> See "Class Variables and Methods" in [0]. >>>>>>>> >>>>>>>> [0] http://pear.php.net/manual/en/standards.naming.php >>>>>> >>>>>>> Hi Marc, >>>>>>> >>>>>>> I went through that document. >>>>>>> If the function is global, it will be like >>> 'PMA_getDivForSliderEffect()' >>>>>>> And if it is a local function (for particular class), it will
be
like >>>>>>> 'getDivForSliderEffect()'. >>>>>> >>>>>> If this is a public method, yes. If a private one, prefix its
name
>>> with >>>>>> an underscore. >>>>>> >>>>>>> >>>>>>> Though I went through that document before this, I couldn't get that >>>>>> point. >>>>>>> Thanks for pointing out that. >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Marc Delisle >>>>>> http://infomarc.info >>>>>> >>>>>> >>>>>> >>>>>> >>>
>>>>>> 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 >>>>>> >>>>>> >>>>> Got it Marc. >>>>> Thanks. >>>>> >>>>> >>>>> -- >>>>> ____________________________________ >>>>> >>>>> Chanaka Indrajith >>>>> Bsc.Computer Engineering Undergraduate >>>>> Faculty of Engineering >>>>> University of Peradeniya >>>>> Sri Lanka >>>>> ____________________________________ >>>>> >>>>> >>>> Hi Michal, >>>> >>>> I just did my first commit to my repository [0]. >>>> In that commit I have done some refactoring on >>> "PMA_displayTableHeaders()" >>>> function in "display_tbl.php" file. >>>> All HTML renderings by "echo"s were removed and those HTML was rendered >>> at >>>> the bottom of the function at once. >>>> As well some related functions in "common.lib.php" file also were >>> modified >>>> in order to return a string of HTML content. >>>> But the tests were not yet modified according to my modifications. >>>> Since there was a conflict after my first local commit [1] (git >>> commit), I >>>> had to resolve conflicts and commit again. (that is [0]) >>>> >>>> I have already installed phpUnit framework. >>>> It will be very helpful if you can suggest me some documentation
to
>>> setup >>>> and run tests in PMA (selenium etc). >>>> >>>> I'm intending to do the above refactoring procedure to all the >>> functions in >>>> "display_tbl.lib.php" file before moving to any other task. >>>> >>>> [0] : >>>> >>>
https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80...
>>>> [1] : >>>> >>>
https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
>>>> >>>> Regards ! >>> >>> I had a very quick look at your commit. I think that you're
indenting
>>> some lines incorrectly (but I stand to be corrected on this one). AFAIK, >>> you don't need to line up the operators, just indent by 4 spaces. Example: >>> >>> // THIS IS BAD >>> $radio_html .= '<label for="' . $html_field_id . '">' >>> . $choice_label >>> . '</label>'; >>> >>> // THIS IS GOOD >>> $radio_html .= '<label for="' . $html_field_id . '">' >>> . $choice_label >>> . '</label>'; >>> >>> // THIS IS ALSO GOOD >>> $radio_html .= '<label for="' . $html_field_id . '">'; >>> $radio_html .= $choice_label; >>> $radio_html .= '</label>'; >>> >>> Bye, >>> Rouslan >>> >>> >>>
>>> 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 Rouslan, >> >> Thanks for your suggestion. >> I'll follow the way you mentioned as "THIS IS GOOD". >> >> Regards ! >> >> -- >> ____________________________________ >> >> Chanaka Indrajith >> Bsc.Computer Engineering Undergraduate >> Faculty of Engineering >> University of Peradeniya >> Sri Lanka >> ____________________________________ >> >> > Hi Michal, > > In some functions there are pure HTML code snippets. (Ex :- > PMA_displayTableNavigationOneButton() function in
display_tbl.lib.php)
> > As I feel, its not good to convert all these snippets as PHP string
and
> render them. So I'm intending to get those pure HTML snippets into separate > function. That function can be named as
'PMA_renderTableNavigationForm'
> (for above case). > What do you think about this ? > > As well is there any reason for the phrase 'One' in the function > "PMA_displayTableNavigation*One*Button()" ? > > Regards !
I think that the above example is *exactly* the kind of stuff that
needs
to be converted to strings.
Bye, Rouslan
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 Rouslan,
I have little doubt of the way I understand your point.
You are suggesting to render HTML content by PHP string, instead of
using
pure HTML, though there is nicely placed HTML code snippets. (around
5, 6
lines) Am I correct Rouslan ? Sorry if I'm repeat the wheel.
Yes, that's correct. And I don't thing that those lines are nice at all.
Bye, Rouslan
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 Rouslan,
I was already thinking of do the same thing you pointed. It will cause some sort of problems if I do the previous thing I suggested. Thanks for your help.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
The function "PMA_displayTableBody()" in display_tbl.lib.php is always return true. But it does not seems like, useful for other place where it have been used. (Used only in "PMA_displayTable()" function in same file)
Inside "PMA_displayTable()" function it just assign the return value (true) to variable called '$clause_is_unique'. And variable is only used at one place. it is,
echo '<input type="hidden" name="clause_is_unique"' .' value="' . *$clause_is_unique* . '" />' . "\n";
So, if this always return true, why don't we hard code true in the above case. And modify the "PMA_displayTableBody()" function to return string of html content.
Am I going wrong ?
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I think I was wrong. Though the block comments of PMA_displayTableBody function, mentioned that it always return true, when digging the code, and looking at the bottom comments, seems like its very important.
I'll modify the function to return an array, having two elements which are string of HTML content and boolean ($clause_is_unique) The name will change from "PMA_displayTableBody" to "PMA_getTableBodyParams". I hope to see your suggestions.
Regards !
It looks to me like you could easily get a value for $clause_is_unique outside of that function, so that you can leave its name and purpose as is. And you'll be able return a single string from it.
Bye, Rouslan
On Fri, May 11, 2012 at 4:18 PM, Rouslan Placella rouslan@placella.comwrote:
On 11/05/12 08:26, Chanaka Dharmarathna wrote:
On Fri, May 11, 2012 at 11:12 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Fri, May 11, 2012 at 7:05 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Fri, May 11, 2012 at 12:39 AM, Rouslan Placella<
rouslan@placella.com>wrote:
On 09/05/12 21:08, Chanaka Dharmarathna wrote:
On Wed, May 9, 2012 at 2:27 PM, Rouslan Placella<
rouslan@placella.com
wrote:
> On 09/05/12 09:39, Chanaka Dharmarathna wrote: >> On Wed, May 9, 2012 at 9:21 AM, Chanaka Dharmarathna< >> pe.chanaka.ck@gmail.com> wrote: >> >>> >>> >>> On Wed, May 9, 2012 at 1:19 AM, Rouslan Placella<
rouslan@placella.com
>> wrote: >>> >>>> On 08/05/12 20:32, Chanaka Dharmarathna wrote: >>>>> On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< >>>>> pe.chanaka.ck@gmail.com> wrote: >>>>> >>>>>> >>>>>> >>>>>> On Tue, May 8, 2012 at 7:08 PM, Marc Delisle<
marc@infomarc.info>
>>>> wrote: >>>>>> >>>>>>> Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit : >>>>>>> >>>>>>>>> >>>>>>>>> See "Class Variables and Methods" in [0]. >>>>>>>>> >>>>>>>>> [0] http://pear.php.net/manual/en/standards.naming.php >>>>>>> >>>>>>>> Hi Marc, >>>>>>>> >>>>>>>> I went through that document. >>>>>>>> If the function is global, it will be like >>>> 'PMA_getDivForSliderEffect()' >>>>>>>> And if it is a local function (for particular class), it will
be
> like >>>>>>>> 'getDivForSliderEffect()'. >>>>>>> >>>>>>> If this is a public method, yes. If a private one, prefix its
name
>>>> with >>>>>>> an underscore. >>>>>>> >>>>>>>> >>>>>>>> Though I went through that document before this, I couldn't
get
> that >>>>>>> point. >>>>>>>> Thanks for pointing out that. >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Marc Delisle >>>>>>> http://infomarc.info >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>> >
>>>>>>> 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 >>>>>>> >>>>>>> >>>>>> Got it Marc. >>>>>> Thanks. >>>>>> >>>>>> >>>>>> -- >>>>>> ____________________________________ >>>>>> >>>>>> Chanaka Indrajith >>>>>> Bsc.Computer Engineering Undergraduate >>>>>> Faculty of Engineering >>>>>> University of Peradeniya >>>>>> Sri Lanka >>>>>> ____________________________________ >>>>>> >>>>>> >>>>> Hi Michal, >>>>> >>>>> I just did my first commit to my repository [0]. >>>>> In that commit I have done some refactoring on >>>> "PMA_displayTableHeaders()" >>>>> function in "display_tbl.php" file. >>>>> All HTML renderings by "echo"s were removed and those HTML was > rendered >>>> at >>>>> the bottom of the function at once. >>>>> As well some related functions in "common.lib.php" file also
were
>>>> modified >>>>> in order to return a string of HTML content. >>>>> But the tests were not yet modified according to my
modifications.
>>>>> Since there was a conflict after my first local commit [1] (git >>>> commit), I >>>>> had to resolve conflicts and commit again. (that is [0]) >>>>> >>>>> I have already installed phpUnit framework. >>>>> It will be very helpful if you can suggest me some documentation
to
>>>> setup >>>>> and run tests in PMA (selenium etc). >>>>> >>>>> I'm intending to do the above refactoring procedure to all the >>>> functions in >>>>> "display_tbl.lib.php" file before moving to any other task. >>>>> >>>>> [0] : >>>>> >>>> >
https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80...
>>>>> [1] : >>>>> >>>> >
https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
>>>>> >>>>> Regards ! >>>> >>>> I had a very quick look at your commit. I think that you're
indenting
>>>> some lines incorrectly (but I stand to be corrected on this one). > AFAIK, >>>> you don't need to line up the operators, just indent by 4 spaces. > Example: >>>> >>>> // THIS IS BAD >>>> $radio_html .= '<label for="' . $html_field_id . '">' >>>> . $choice_label >>>> . '</label>'; >>>> >>>> // THIS IS GOOD >>>> $radio_html .= '<label for="' . $html_field_id . '">' >>>> . $choice_label >>>> . '</label>'; >>>> >>>> // THIS IS ALSO GOOD >>>> $radio_html .= '<label for="' . $html_field_id . '">'; >>>> $radio_html .= $choice_label; >>>> $radio_html .= '</label>'; >>>> >>>> Bye, >>>> Rouslan >>>> >>>> >>>> >
>>>> 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 Rouslan, >>> >>> Thanks for your suggestion. >>> I'll follow the way you mentioned as "THIS IS GOOD". >>> >>> Regards ! >>> >>> -- >>> ____________________________________ >>> >>> Chanaka Indrajith >>> Bsc.Computer Engineering Undergraduate >>> Faculty of Engineering >>> University of Peradeniya >>> Sri Lanka >>> ____________________________________ >>> >>> >> Hi Michal, >> >> In some functions there are pure HTML code snippets. (Ex :- >> PMA_displayTableNavigationOneButton() function in
display_tbl.lib.php)
>> >> As I feel, its not good to convert all these snippets as PHP string
and
>> render them. So I'm intending to get those pure HTML snippets into > separate >> function. That function can be named as
'PMA_renderTableNavigationForm'
>> (for above case). >> What do you think about this ? >> >> As well is there any reason for the phrase 'One' in the function >> "PMA_displayTableNavigation*One*Button()" ? >> >> Regards ! > > I think that the above example is *exactly* the kind of stuff that
needs
> to be converted to strings. > > Bye, > Rouslan > > >
> 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 Rouslan,
I have little doubt of the way I understand your point.
You are suggesting to render HTML content by PHP string, instead of
using
pure HTML, though there is nicely placed HTML code snippets. (around
5, 6
lines) Am I correct Rouslan ? Sorry if I'm repeat the wheel.
Yes, that's correct. And I don't thing that those lines are nice at
all.
Bye, Rouslan
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 Rouslan,
I was already thinking of do the same thing you pointed. It will cause some sort of problems if I do the previous thing I suggested. Thanks for your help.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
The function "PMA_displayTableBody()" in display_tbl.lib.php is always return true. But it does not seems like, useful for other place where it have been used. (Used only in "PMA_displayTable()" function in same file)
Inside "PMA_displayTable()" function it just assign the return value (true) to variable called '$clause_is_unique'. And variable is only used at one place. it is,
echo '<input type="hidden" name="clause_is_unique"' .' value="' . *$clause_is_unique* . '" />' . "\n";
So, if this always return true, why don't we hard code true in the above case. And modify the "PMA_displayTableBody()" function to return string of
html
content.
Am I going wrong ?
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I think I was wrong. Though the block comments of PMA_displayTableBody function, mentioned
that
it always return true, when digging the code, and looking at the bottom comments, seems like its very important.
I'll modify the function to return an array, having two elements which
are
string of HTML content and boolean ($clause_is_unique) The name will change from "PMA_displayTableBody" to "PMA_getTableBodyParams". I hope to see your suggestions.
Regards !
It looks to me like you could easily get a value for $clause_is_unique outside of that function, so that you can leave its name and purpose as is. And you'll be able return a single string from it.
Bye, Rouslan
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 Rouslan,
You talking about the function "PMA_getUniqueCondition" in "common.lib.php file" right. Exactly, I can directly get the value for $clause_is_unique from the output array of that function. I'll do the necessary modifications. Thanks for pointing out that.
Regards !
On Fri, May 11, 2012 at 6:17 PM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Fri, May 11, 2012 at 4:18 PM, Rouslan Placella rouslan@placella.comwrote:
On 11/05/12 08:26, Chanaka Dharmarathna wrote:
On Fri, May 11, 2012 at 11:12 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Fri, May 11, 2012 at 7:05 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Fri, May 11, 2012 at 12:39 AM, Rouslan Placella<
rouslan@placella.com>wrote:
On 09/05/12 21:08, Chanaka Dharmarathna wrote: > On Wed, May 9, 2012 at 2:27 PM, Rouslan Placella<
rouslan@placella.com
> wrote: > >> On 09/05/12 09:39, Chanaka Dharmarathna wrote: >>> On Wed, May 9, 2012 at 9:21 AM, Chanaka Dharmarathna< >>> pe.chanaka.ck@gmail.com> wrote: >>> >>>> >>>> >>>> On Wed, May 9, 2012 at 1:19 AM, Rouslan Placella< rouslan@placella.com >>> wrote: >>>> >>>>> On 08/05/12 20:32, Chanaka Dharmarathna wrote: >>>>>> On Tue, May 8, 2012 at 7:23 PM, Chanaka Dharmarathna< >>>>>> pe.chanaka.ck@gmail.com> wrote: >>>>>> >>>>>>> >>>>>>> >>>>>>> On Tue, May 8, 2012 at 7:08 PM, Marc Delisle<
marc@infomarc.info>
>>>>> wrote: >>>>>>> >>>>>>>> Le 2012-05-08 09:25, Chanaka Dharmarathna a écrit : >>>>>>>> >>>>>>>>>> >>>>>>>>>> See "Class Variables and Methods" in [0]. >>>>>>>>>> >>>>>>>>>> [0] http://pear.php.net/manual/en/standards.naming.php >>>>>>>> >>>>>>>>> Hi Marc, >>>>>>>>> >>>>>>>>> I went through that document. >>>>>>>>> If the function is global, it will be like >>>>> 'PMA_getDivForSliderEffect()' >>>>>>>>> And if it is a local function (for particular class), it
will
be >> like >>>>>>>>> 'getDivForSliderEffect()'. >>>>>>>> >>>>>>>> If this is a public method, yes. If a private one, prefix its name >>>>> with >>>>>>>> an underscore. >>>>>>>> >>>>>>>>> >>>>>>>>> Though I went through that document before this, I couldn't
get
>> that >>>>>>>> point. >>>>>>>>> Thanks for pointing out that. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Marc Delisle >>>>>>>> http://infomarc.info >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>> >>
>>>>>>>> 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
>>>>>>>> >>>>>>>> >>>>>>> Got it Marc. >>>>>>> Thanks. >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ____________________________________ >>>>>>> >>>>>>> Chanaka Indrajith >>>>>>> Bsc.Computer Engineering Undergraduate >>>>>>> Faculty of Engineering >>>>>>> University of Peradeniya >>>>>>> Sri Lanka >>>>>>> ____________________________________ >>>>>>> >>>>>>> >>>>>> Hi Michal, >>>>>> >>>>>> I just did my first commit to my repository [0]. >>>>>> In that commit I have done some refactoring on >>>>> "PMA_displayTableHeaders()" >>>>>> function in "display_tbl.php" file. >>>>>> All HTML renderings by "echo"s were removed and those HTML was >> rendered >>>>> at >>>>>> the bottom of the function at once. >>>>>> As well some related functions in "common.lib.php" file also
were
>>>>> modified >>>>>> in order to return a string of HTML content. >>>>>> But the tests were not yet modified according to my
modifications.
>>>>>> Since there was a conflict after my first local commit [1] (git >>>>> commit), I >>>>>> had to resolve conflicts and commit again. (that is [0]) >>>>>> >>>>>> I have already installed phpUnit framework. >>>>>> It will be very helpful if you can suggest me some
documentation
to >>>>> setup >>>>>> and run tests in PMA (selenium etc). >>>>>> >>>>>> I'm intending to do the above refactoring procedure to all the >>>>> functions in >>>>>> "display_tbl.lib.php" file before moving to any other task. >>>>>> >>>>>> [0] : >>>>>> >>>>> >>
https://github.com/Chanaka/phpmyadmin/commit/dfc73d3494445ff9430e5d0b4f33f80...
>>>>>> [1] : >>>>>> >>>>> >>
https://github.com/Chanaka/phpmyadmin/commit/004f4f5258a0820975e2da9fa02a6d3...
>>>>>> >>>>>> Regards ! >>>>> >>>>> I had a very quick look at your commit. I think that you're indenting >>>>> some lines incorrectly (but I stand to be corrected on this
one).
>> AFAIK, >>>>> you don't need to line up the operators, just indent by 4
spaces.
>> Example: >>>>> >>>>> // THIS IS BAD >>>>> $radio_html .= '<label for="' . $html_field_id . '">' >>>>> . $choice_label >>>>> . '</label>'; >>>>> >>>>> // THIS IS GOOD >>>>> $radio_html .= '<label for="' . $html_field_id . '">' >>>>> . $choice_label >>>>> . '</label>'; >>>>> >>>>> // THIS IS ALSO GOOD >>>>> $radio_html .= '<label for="' . $html_field_id . '">'; >>>>> $radio_html .= $choice_label; >>>>> $radio_html .= '</label>'; >>>>> >>>>> Bye, >>>>> Rouslan >>>>> >>>>> >>>>> >>
>>>>> 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 Rouslan, >>>> >>>> Thanks for your suggestion. >>>> I'll follow the way you mentioned as "THIS IS GOOD". >>>> >>>> Regards ! >>>> >>>> -- >>>> ____________________________________ >>>> >>>> Chanaka Indrajith >>>> Bsc.Computer Engineering Undergraduate >>>> Faculty of Engineering >>>> University of Peradeniya >>>> Sri Lanka >>>> ____________________________________ >>>> >>>> >>> Hi Michal, >>> >>> In some functions there are pure HTML code snippets. (Ex :- >>> PMA_displayTableNavigationOneButton() function in display_tbl.lib.php) >>> >>> As I feel, its not good to convert all these snippets as PHP
string
and >>> render them. So I'm intending to get those pure HTML snippets into >> separate >>> function. That function can be named as 'PMA_renderTableNavigationForm' >>> (for above case). >>> What do you think about this ? >>> >>> As well is there any reason for the phrase 'One' in the function >>> "PMA_displayTableNavigation*One*Button()" ? >>> >>> Regards ! >> >> I think that the above example is *exactly* the kind of stuff that needs >> to be converted to strings. >> >> Bye, >> Rouslan >> >> >>
>> 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 Rouslan, > > I have little doubt of the way I understand your point. > > You are suggesting to render HTML content by PHP string, instead of using > pure HTML, though there is nicely placed HTML code snippets. (around 5, 6 > lines) > Am I correct Rouslan ? Sorry if I'm repeat the wheel.
Yes, that's correct. And I don't thing that those lines are nice at
all.
Bye, Rouslan
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 Rouslan,
I was already thinking of do the same thing you pointed. It will cause some sort of problems if I do the previous thing I suggested. Thanks for your help.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
The function "PMA_displayTableBody()" in display_tbl.lib.php is always return true. But it does not seems like, useful for other place where it have been used. (Used only in "PMA_displayTable()" function in same file)
Inside "PMA_displayTable()" function it just assign the return value (true) to variable called '$clause_is_unique'. And variable is only used at one place. it is,
echo '<input type="hidden" name="clause_is_unique"' .' value="' . *$clause_is_unique* . '" />' . "\n";
So, if this always return true, why don't we hard code true in the
above
case. And modify the "PMA_displayTableBody()" function to return string of
html
content.
Am I going wrong ?
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I think I was wrong. Though the block comments of PMA_displayTableBody function, mentioned
that
it always return true, when digging the code, and looking at the bottom comments, seems like
its
very important.
I'll modify the function to return an array, having two elements which
are
string of HTML content and boolean ($clause_is_unique) The name will change from "PMA_displayTableBody" to "PMA_getTableBodyParams". I hope to see your suggestions.
Regards !
It looks to me like you could easily get a value for $clause_is_unique outside of that function, so that you can leave its name and purpose as is. And you'll be able return a single string from it.
Bye, Rouslan
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 Rouslan,
You talking about the function "PMA_getUniqueCondition" in "common.lib.php file" right. Exactly, I can directly get the value for $clause_is_unique from the output array of that function. I'll do the necessary modifications.
Thanks for pointing out that.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I set up the testing environment in my machine and now evolving with the improvements of unit tests for some modified function.
When I run unit test for "PMA_showMessage" function in "common.lib.php" file, it gives me some fatal errors. (Call to undefined function PMA_warnMissingExtension() ...) I used the command : $phpunit test/libraries/common/PMA_showMessage_test_disabled.php
Do you have any idea on this ?
My testing environment : PHPUnit 3.6.10 PEAR Version: 1.9.4 PHP Version: 5.3.2-1ubuntu4.9
Regards !
Hi
First of all please try to remove useless quoting in the email, it makes them easier to read.
Dne Sun, 13 May 2012 16:04:17 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I set up the testing environment in my machine and now evolving with the improvements of unit tests for some modified function.
When I run unit test for "PMA_showMessage" function in "common.lib.php" file, it gives me some fatal errors. (Call to undefined function PMA_warnMissingExtension() ...) I used the command : $phpunit test/libraries/common/PMA_showMessage_test_disabled.php
Do you have any idea on this ?
Probably the test is missing some includes, many of tests were not really tested standalone.
On Mon, May 14, 2012 at 4:32 PM, Michal Čihař michal@cihar.com wrote:
Hi
First of all please try to remove useless quoting in the email, it makes them easier to read.
Dne Sun, 13 May 2012 16:04:17 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I set up the testing environment in my machine and now evolving with the improvements of unit tests for some modified function.
When I run unit test for "PMA_showMessage" function in "common.lib.php" file, it gives me some fatal errors. (Call to undefined function PMA_warnMissingExtension() ...) I used the command : $phpunit test/libraries/common/PMA_showMessage_test_disabled.php
Do you have any idea on this ?
Probably the test is missing some includes, many of tests were not really tested standalone.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
I'll follow your instructions Marc.
Yes, that is the case. I tried with including around three additional files, but again the error is due to not including some necessary files. Is there any easier way to run this unit tests independent from the other tests ?
As well, I'm going to do some modifications regarding to improve readability of the code. For functions which are not too small, I'm going to add one empty line, just after function declaration and just before the end of the function.
Ex :- function PMA_setDisplayMode($params) {
// function body after empty line ---- ---- // end of the function body
} // end of the function after empty line
Hope this is more readable. Shall I use this ?
Regards !
On Mon, May 14, 2012 at 5:30 PM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Mon, May 14, 2012 at 4:32 PM, Michal Čihař michal@cihar.com wrote:
Hi
First of all please try to remove useless quoting in the email, it makes them easier to read.
Dne Sun, 13 May 2012 16:04:17 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I set up the testing environment in my machine and now evolving with the improvements of unit tests for some modified function.
When I run unit test for "PMA_showMessage" function in "common.lib.php" file, it gives me some fatal errors. (Call to undefined function PMA_warnMissingExtension() ...) I used the command : $phpunit test/libraries/common/PMA_showMessage_test_disabled.php
Do you have any idea on this ?
Probably the test is missing some includes, many of tests were not really tested standalone.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
I'll follow your instructions Marc.
Yes, that is the case. I tried with including around three additional files, but again the error is due to not including some necessary files. Is there any easier way to run this unit tests independent from the other tests ?
As well, I'm going to do some modifications regarding to improve readability of the code. For functions which are not too small, I'm going to add one empty line, just after function declaration and just before the end of the function.
Ex :- function PMA_setDisplayMode($params) {
// function body after empty line
// end of the function body
} // end of the function after empty line
Hope this is more readable. Shall I use this ?
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I have introduced two small functions to reduce the code repetition in PMA_getVerticalTable() function in display_tbl.lib.php file. Both functions are using the global variable $vertical_display.
Now I'm trying to implement unit tests for those functions. Since there is global variable, it represent null while run the test. Is there any way to implement test cases for this kind of functions ?
As well, is it possible to implement tests for functions like PMA_getTableNavigation() which is return a large string ? If possible, Can you give me some guidance to implement tests for that kind of functions.
Please note that above function names used in my repository [0].
[0] : https://github.com/Chanaka/phpmyadmin
Regards !
Hi
Dne Wed, 16 May 2012 21:33:17 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I have introduced two small functions to reduce the code repetition in PMA_getVerticalTable() function in display_tbl.lib.php file. Both functions are using the global variable $vertical_display.
Please try to avoid using global variables, this one should be passed as parameter (or it should be attribute of class which embeds displaying query results).
On Thu, May 17, 2012 at 1:08 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Wed, 16 May 2012 21:33:17 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I have introduced two small functions to reduce the code repetition in PMA_getVerticalTable() function in display_tbl.lib.php file. Both functions are using the global variable $vertical_display.
Please try to avoid using global variables, this one should be passed as parameter (or it should be attribute of class which embeds displaying query results).
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for pointing that. I'll pass them as parameters.
Regards !
On Thu, May 17, 2012 at 1:15 PM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Thu, May 17, 2012 at 1:08 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Wed, 16 May 2012 21:33:17 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I have introduced two small functions to reduce the code repetition in PMA_getVerticalTable() function in display_tbl.lib.php file. Both functions are using the global variable $vertical_display.
Please try to avoid using global variables, this one should be passed as parameter (or it should be attribute of class which embeds displaying query results).
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for pointing that. I'll pass them as parameters.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
In PMA_getTableHeaders() function in display_tbl.lib.php file, there is a if else condition to set the variable $span. But it seems like, $span is not used any other place in PMA. So, I'll remove that code segment due to it's a dead code.
Regards !
Hi
Dne Sun, 20 May 2012 00:19:14 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
In PMA_getTableHeaders() function in display_tbl.lib.php file, there is a if else condition to set the variable $span. But it seems like, $span is not used any other place in PMA. So, I'll remove that code segment due to it's a dead code.
Indeed it looks like no longer used code.
On Mon, May 21, 2012 at 12:09 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Sun, 20 May 2012 00:19:14 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
In PMA_getTableHeaders() function in display_tbl.lib.php file, there is a if else condition to set the variable $span. But it seems like, $span is not used any other place in PMA. So, I'll remove that code segment due to it's a dead code.
Indeed it looks like no longer used code.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for giving your feedback. Yes, I did more changes to the code. Pleas get me into the right track if I'm going wrong.
Regards !
Hi
Dne Mon, 21 May 2012 12:28:42 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
Thanks for giving your feedback. Yes, I did more changes to the code. Pleas get me into the right track if I'm going wrong.
I think you're heading in right direction - splitting the code to smaller blocks which are easy to understand always helps.
I'm currently commenting some things in your commits, so let's keep this part on github.
On Mon, May 21, 2012 at 6:31 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Mon, 21 May 2012 12:28:42 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
Thanks for giving your feedback. Yes, I did more changes to the code. Pleas get me into the right track if I'm going wrong.
I think you're heading in right direction - splitting the code to smaller blocks which are easy to understand always helps.
I'm currently commenting some things in your commits, so let's keep this part on github.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
That's good to hear. I put a reply in github
Regards !
On Mon, May 21, 2012 at 6:58 PM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Mon, May 21, 2012 at 6:31 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Mon, 21 May 2012 12:28:42 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
Thanks for giving your feedback. Yes, I did more changes to the code. Pleas get me into the right track if I'm going wrong.
I think you're heading in right direction - splitting the code to smaller blocks which are easy to understand always helps.
I'm currently commenting some things in your commits, so let's keep this part on github.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
That's good to hear. I put a reply in github
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I'm going to change my plans little bit. At the moment I think the most prioritized task is to make the display_tbl.lib.php file as a PHP class. So, if there is no matter of that, I'll involve with this task in this week (In my third week).
Regards !
On Tue, May 22, 2012 at 12:54 AM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Mon, May 21, 2012 at 6:58 PM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Mon, May 21, 2012 at 6:31 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Mon, 21 May 2012 12:28:42 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
Thanks for giving your feedback. Yes, I did more changes to the code. Pleas get me into the right track if I'm going wrong.
I think you're heading in right direction - splitting the code to smaller blocks which are easy to understand always helps.
I'm currently commenting some things in your commits, so let's keep this part on github.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
That's good to hear. I put a reply in github
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I'm going to change my plans little bit. At the moment I think the most prioritized task is to make the display_tbl.lib.php file as a PHP class. So, if there is no matter of that, I'll involve with this task in this week (In my third week).
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I have a plan on introducing Display class instead of the set of global functions inside the display_tbl.lib.php file.
Currently the only function which used by the outsiders is PMA_getTable(). And the only outside file accessed this function is sql.php file.
With the Display class, All fields and methods other that getTable() method are keep as private. To remove the use of global fields in every function, instance variables are used and they are initialized by a separate function which is inside the getTable() method. For initializing them Global variables are used.
I have documented the rough plan about my design in my blog [0]. The design for this should also be extend with the future plans of PMA. So I'm waiting to hear your comments and suggestions to create a solid design.
[0] : http://chanakaindrajith.blogspot.com/2012/05/design-for-display-class-of-pma...
Regards !
On 22/05/12 12:57, Chanaka Dharmarathna wrote:
On Tue, May 22, 2012 at 12:54 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Mon, May 21, 2012 at 6:58 PM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Mon, May 21, 2012 at 6:31 PM, Michal Čihařmichal@cihar.com wrote:
Hi
Dne Mon, 21 May 2012 12:28:42 +0530 Chanaka Dharmarathnape.chanaka.ck@gmail.com napsal(a):
Thanks for giving your feedback. Yes, I did more changes to the code. Pleas get me into the right track if I'm going wrong.
I think you're heading in right direction - splitting the code to smaller blocks which are easy to understand always helps.
I'm currently commenting some things in your commits, so let's keep this part on github.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
That's good to hear. I put a reply in github
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I'm going to change my plans little bit. At the moment I think the most prioritized task is to make the display_tbl.lib.php file as a PHP class. So, if there is no matter of that, I'll involve with this task in this week (In my third week).
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I have a plan on introducing Display class instead of the set of global functions inside the display_tbl.lib.php file.
Currently the only function which used by the outsiders is PMA_getTable(). And the only outside file accessed this function is sql.php file.
With the Display class, All fields and methods other that getTable() method are keep as private. To remove the use of global fields in every function, instance variables are used and they are initialized by a separate function which is inside the getTable() method. For initializing them Global variables are used.
I have documented the rough plan about my design in my blog [0]. The design for this should also be extend with the future plans of PMA. So I'm waiting to hear your comments and suggestions to create a solid design.
[0] : http://chanakaindrajith.blogspot.com/2012/05/design-for-display-class-of-pma...
Regards !
Not sure why your methods are static and you have an initialisation method. To me it makes more sense to have non-static methods are the use of a constructor for the class. This way, the usage will be even more extensible. Also the class name is not very descriptive.
How about something like this?
$table = PMA_TableDisplay($GLOBALS['db'], $GLOBALS['table']); echo $table->getDisplay();
class PMA_TableDisplay { private $_db; private $_table; public function __contruct($db, $table) { $this->_db = $db; $this->_table = $table; } public function getDisplay() { // ... } private static function getTableHeaders() { // ... $msg = getMessage($this->_db, $this->_table); // ... } // ... }
BTW, what about extending our existing PMA_Table class? I'm not sure how good of an idea it is, so I'm just throwing it out there...
Bye, Rouslan
On Tue, May 22, 2012 at 6:02 PM, Rouslan Placella rouslan@placella.comwrote:
On 22/05/12 12:57, Chanaka Dharmarathna wrote:
On Tue, May 22, 2012 at 12:54 AM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Mon, May 21, 2012 at 6:58 PM, Chanaka Dharmarathna< pe.chanaka.ck@gmail.com> wrote:
On Mon, May 21, 2012 at 6:31 PM, Michal Čihařmichal@cihar.com
wrote:
Hi
Dne Mon, 21 May 2012 12:28:42 +0530 Chanaka Dharmarathnape.chanaka.ck@gmail.com napsal(a):
Thanks for giving your feedback. Yes, I did more changes to the code. Pleas get me into the right track if I'm going wrong.
I think you're heading in right direction - splitting the code to smaller blocks which are easy to understand always helps.
I'm currently commenting some things in your commits, so let's keep this part on github.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
That's good to hear. I put a reply in github
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I'm going to change my plans little bit. At the moment I think the most prioritized task is to make the display_tbl.lib.php file as a PHP class. So, if there is no matter of that, I'll involve with this task in this week (In my third week).
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
I have a plan on introducing Display class instead of the set of global functions inside the display_tbl.lib.php file.
Currently the only function which used by the outsiders is
PMA_getTable().
And the only outside file accessed this function is sql.php file.
With the Display class, All fields and methods other that getTable() method are keep as private. To remove the use of global fields in every function, instance variables are used and they are initialized by a separate function which is inside the getTable() method. For initializing them Global variables are used.
I have documented the rough plan about my design in my blog [0]. The design for this should also be extend with the future plans of PMA. So I'm waiting to hear your comments and suggestions to create a solid design.
[0] :
http://chanakaindrajith.blogspot.com/2012/05/design-for-display-class-of-pma...
Regards !
Not sure why your methods are static and you have an initialisation method. To me it makes more sense to have non-static methods are the use of a constructor for the class. This way, the usage will be even more extensible. Also the class name is not very descriptive.
How about something like this?
$table = PMA_TableDisplay($GLOBALS['db'], $GLOBALS['table']); echo $table->getDisplay();
class PMA_TableDisplay { private $_db; private $_table; public function __contruct($db, $table) { $this->_db = $db; $this->_table = $table; } public function getDisplay() { // ... } private static function getTableHeaders() { // ... $msg = getMessage($this->_db, $this->_table); // ... } // ... }
BTW, what about extending our existing PMA_Table class? I'm not sure how good of an idea it is, so I'm just throwing it out there...
Bye, Rouslan
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 Rouslan,
Thanks for participating to this discussion and share your valuable suggestions.
As I remember Michal has already suggested to not to use an object of this case. And use PMA_Display::someFunction where needed. Thats why I focused on static fields and behaviors.
The constructor of the function only executed, if create an object of a class. (I think your code trying to say create an object, new keyword is missing there). So I don't think to get the use of a constructor. That's why I'm using a function for initialize instance variables.
I'm agreed to use more meaningful name. It is better if we can name it as PMA_DisplayTable .
Regards !
Hi
Dne Tue, 22 May 2012 22:37:47 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
On Tue, May 22, 2012 at 6:02 PM, Rouslan Placella rouslan@placella.comwrote:
BTW, what about extending our existing PMA_Table class? I'm not sure how good of an idea it is, so I'm just throwing it out there...
I don't think this would be useful, this class should care less about table (actually should be table independent) and more oriented on displaying results.
Thanks for participating to this discussion and share your valuable suggestions.
As I remember Michal has already suggested to not to use an object of this case. And use PMA_Display::someFunction where needed. Thats why I focused on static fields and behaviors.
Well it was just a naming condition, you should really make that object, get parameters in constructor. So basically Rouslans example is what I would expect.
The constructor of the function only executed, if create an object of a class. (I think your code trying to say create an object, new keyword is missing there). So I don't think to get the use of a constructor. That's why I'm using a function for initialize instance variables.
I'm agreed to use more meaningful name. It is better if we can name it as PMA_DisplayTable .
PMA_DisplayResults might be better. Please remember this should not be about displaying tables but results of any SQL query - results of stored procedure, browsing SQL processes or displaying binary log.
On Wed, May 23, 2012 at 12:14 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Tue, 22 May 2012 22:37:47 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
On Tue, May 22, 2012 at 6:02 PM, Rouslan Placella <rouslan@placella.com wrote:
BTW, what about extending our existing PMA_Table class? I'm not sure
how
good of an idea it is, so I'm just throwing it out there...
I don't think this would be useful, this class should care less about table (actually should be table independent) and more oriented on displaying results.
Thanks for participating to this discussion and share your valuable suggestions.
As I remember Michal has already suggested to not to use an object of
this
case. And use PMA_Display::someFunction where needed. Thats why I focused on static fields and behaviors.
Well it was just a naming condition, you should really make that object, get parameters in constructor. So basically Rouslans example is what I would expect.
The constructor of the function only executed, if create an object of a class. (I think your code trying to say create an object, new keyword is missing there). So I don't think to get the use of a constructor. That's why I'm using a function for initialize instance variables.
I'm agreed to use more meaningful name. It is better if we can name it as PMA_DisplayTable .
PMA_DisplayResults might be better. Please remember this should not be about displaying tables but results of any SQL query - results of stored procedure, browsing SQL processes or displaying binary log.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
I was thinking of get the use of this class by using an object as in my proposal [0]. But, I had misunderstood your comment about creating an object. That's why I looked into this way. Any way it's a mistake by me.
Thanks for getting me into the right track soon. I'll introduce the new design of the class as soon as possible.
[0] : http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/chanaka77...
Regards !
Hi
Dne Wed, 23 May 2012 12:48:28 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I was thinking of get the use of this class by using an object as in my proposal [0]. But, I had misunderstood your comment about creating an object. That's why I looked into this way. Any way it's a mistake by me.
Sorry for that, I actually hate PHP way of object::method and object->method :-).
On Wed, May 23, 2012 at 2:36 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Wed, 23 May 2012 12:48:28 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I was thinking of get the use of this class by using an object as in my proposal [0]. But, I had misunderstood your comment about creating an object. That's why I looked into this way. Any way it's a mistake by me.
Sorry for that, I actually hate PHP way of object::method and object->method :-).
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
It is okay Michal, I understood it incorrectly.
I have updated my blog[0] with the updated design. The file should be named as DisplayResults.class.php right ?
If you are okay with the design I can start the implementation. But if their should be any improvements please let me know.
[0] : http://chanakaindrajith.blogspot.com/2012/05/design-for-display-class-of-pma...
Regards !
Hi
Dne Wed, 23 May 2012 15:55:38 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I have updated my blog[0] with the updated design. The file should be named as DisplayResults.class.php right ?
If you are okay with the design I can start the implementation. But if their should be any improvements please let me know.
Yes it looks okay. Maybe just the method should be called something like getHtml.
On the other topic - I've merged your changes so far and as you can see [1] they produced lot of coding style violations. Please try to prevent this in future work. I'm committing fixes right now so that you can check the mistakes.
[1]: https://ci.phpmyadmin.net/job/phpMyAdmin-continuous/1491/
On 5/23/12, Michal Čihař michal@cihar.com wrote:
Hi
Dne Wed, 23 May 2012 15:55:38 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
I have updated my blog[0] with the updated design. The file should be named as DisplayResults.class.php right ?
If you are okay with the design I can start the implementation. But if their should be any improvements please let me know.
Yes it looks okay. Maybe just the method should be called something like getHtml.
On the other topic - I've merged your changes so far and as you can see [1] they produced lot of coding style violations. Please try to prevent this in future work. I'm committing fixes right now so that you can check the mistakes.
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
Hi Michal,
Its great to heard that you have merge my changes to the master branch. I'll consider more on coding style in the future work and fix existing ones.
I'll start implementation on the PMA_DisplayResults class soon.
Regards !
Hi
Dne Wed, 23 May 2012 18:47:18 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
Its great to heard that you have merge my changes to the master branch. I'll consider more on coding style in the future work and fix existing ones.
You should run phpcs locally to see possible violations when you're making changes, it's documented on the wiki:
http://wiki.phpmyadmin.net/pma/CodeSniffer
On Wed, May 23, 2012 at 8:15 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Wed, 23 May 2012 18:47:18 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
Its great to heard that you have merge my changes to the master branch. I'll consider more on coding style in the future work and fix existing
ones.
You should run phpcs locally to see possible violations when you're making changes, it's documented on the wiki:
http://wiki.phpmyadmin.net/pma/CodeSniffer
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for helping more in that case. I'll follow that procedure.
Regards !
On Wed, May 23, 2012 at 11:11 PM, Chanaka Dharmarathna < pe.chanaka.ck@gmail.com> wrote:
On Wed, May 23, 2012 at 8:15 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Wed, 23 May 2012 18:47:18 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
Its great to heard that you have merge my changes to the master branch. I'll consider more on coding style in the future work and fix existing
ones.
You should run phpcs locally to see possible violations when you're making changes, it's documented on the wiki:
http://wiki.phpmyadmin.net/pma/CodeSniffer
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for helping more in that case. I'll follow that procedure.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
Its indeed, you have fixed large number of coding violation issues in my code. Thanks for doing it for me. And now I'm fixing existing coding violations.
I have a doubt on introducing or changing a string. If we newly introduce a string or change existing one, do we need to make the changes for any other files like language files (es.po, en_GB.po) ?
As well I feel its better to have more clarification on your word on the design of PMA_DisplayResults class. "Yes it looks okay. Maybe just the method should be called something like getHtml. " Can you please explain me about the getHtml thing ?
Regards !
2012/5/24 Chanaka Dharmarathna pe.chanaka.ck@gmail.com:
On Wed, May 23, 2012 at 11:11 PM, Chanaka Dharmarathna pe.chanaka.ck@gmail.com wrote:
On Wed, May 23, 2012 at 8:15 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Wed, 23 May 2012 18:47:18 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
Its great to heard that you have merge my changes to the master branch. I'll consider more on coding style in the future work and fix existing ones.
You should run phpcs locally to see possible violations when you're making changes, it's documented on the wiki:
http://wiki.phpmyadmin.net/pma/CodeSniffer
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for helping more in that case. I'll follow that procedure.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
Its indeed, you have fixed large number of coding violation issues in my code. Thanks for doing it for me. And now I'm fixing existing coding violations.
I have a doubt on introducing or changing a string. If we newly introduce a string or change existing one, do we need to make the changes for any other files like language files (es.po, en_GB.po) ?
There is no need to change the .po files manually. There is a script to update the .po files. But you don't need to run it in your branch, the .po files will be updated when your changes are merged with master.
Anyway, make sure to use the __() method for translatable strings. More info can be found on our wiki [0]
On a related note, if you output variables (as part of a translatable string, or seperately), make sure to escape them properly, please check our wiki regarding this, especially the part about escaping html output : [1]
As well I feel its better to have more clarification on your word on the design of PMA_DisplayResults class.
"Yes it looks okay. Maybe just the method should be called something like getHtml. " Can you please explain me about the getHtml thing ?
I think Michal means that method getHtml() should generate and return a html string. When calling the method you would get something like this :
$class_results = new PMA_DisplayResults(); echo $class_results->getHtml();
[0] http://wiki.phpmyadmin.net/pma/Gettext_for_developers [1] http://wiki.phpmyadmin.net/pma/Security_pitfalls
On Fri, May 25, 2012 at 4:40 PM, Dieter Adriaenssens < dieter.adriaenssens@gmail.com> wrote:
2012/5/24 Chanaka Dharmarathna pe.chanaka.ck@gmail.com:
On Wed, May 23, 2012 at 11:11 PM, Chanaka Dharmarathna pe.chanaka.ck@gmail.com wrote:
On Wed, May 23, 2012 at 8:15 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Wed, 23 May 2012 18:47:18 +0530 Chanaka Dharmarathna pe.chanaka.ck@gmail.com napsal(a):
Its great to heard that you have merge my changes to the master
branch.
I'll consider more on coding style in the future work and fix
existing
ones.
You should run phpcs locally to see possible violations when you're making changes, it's documented on the wiki:
http://wiki.phpmyadmin.net/pma/CodeSniffer
-- Michal Čihař | http://cihar.com | http://blog.cihar.com
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 Michal,
Thanks for helping more in that case. I'll follow that procedure.
Regards !
Chanaka Indrajith Bsc.Computer Engineering Undergraduate Faculty of Engineering University of Peradeniya Sri Lanka ____________________________________
Hi Michal,
Its indeed, you have fixed large number of coding violation issues in my code. Thanks for doing it for me. And now I'm fixing existing coding violations.
I have a doubt on introducing or changing a string. If we newly introduce a string or change existing one, do we need to make the changes for any other files like language files (es.po, en_GB.po) ?
There is no need to change the .po files manually. There is a script to update the .po files. But you don't need to run it in your branch, the .po files will be updated when your changes are merged with master.
Anyway, make sure to use the __() method for translatable strings. More info can be found on our wiki [0]
On a related note, if you output variables (as part of a translatable string, or seperately), make sure to escape them properly, please check our wiki regarding this, especially the part about escaping html output : [1]
As well I feel its better to have more clarification on your word on the design of PMA_DisplayResults class.
"Yes it looks okay. Maybe just the method should be called something like getHtml. " Can you please explain me about the getHtml thing ?
I think Michal means that method getHtml() should generate and return a html string. When calling the method you would get something like this :
$class_results = new PMA_DisplayResults(); echo $class_results->getHtml();
[0] http://wiki.phpmyadmin.net/pma/Gettext_for_developers [1] http://wiki.phpmyadmin.net/pma/Security_pitfalls
-- 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 valuable information and pointing those links. That will be very helpful for me. I'll follow that procedure.
Regards !
Le 2012-05-09 04:39, Chanaka Dharmarathna a écrit : (...)
As well is there any reason for the phrase 'One' in the function "PMA_displayTableNavigation*One*Button()" ?
Because it displays one button; it could have been originally named PMA_displayTableNavigationButton().
On Wed, May 9, 2012 at 4:50 PM, Marc Delisle marc@infomarc.info wrote:
Le 2012-05-09 04:39, Chanaka Dharmarathna a écrit : (...)
As well is there any reason for the phrase 'One' in the function "PMA_displayTableNavigation*One*Button()" ?
Because it displays one button; it could have been originally named PMA_displayTableNavigationButton().
-- Marc Delisle http://infomarc.info
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 Marc,
Since it displays only one button, shall I change the name of that function to "PMA_displayTableNavigationButton()". Due to the name have phrase 'Button' (not 'Button*s*') I think it increase the readability and does not over understanding (with some confuse).
Regards !
Le 2012-05-09 15:57, Chanaka Dharmarathna a écrit :
On Wed, May 9, 2012 at 4:50 PM, Marc Delisle marc@infomarc.info wrote:
Le 2012-05-09 04:39, Chanaka Dharmarathna a écrit : (...)
As well is there any reason for the phrase 'One' in the function "PMA_displayTableNavigation*One*Button()" ?
Because it displays one button; it could have been originally named PMA_displayTableNavigationButton().
Hi Marc,
Since it displays only one button, shall I change the name of that function to "PMA_displayTableNavigationButton()". Due to the name have phrase 'Button' (not 'Button*s*') I think it increase the readability and does not over understanding (with some confuse).
Regards !
Hi Chanaka, sure.