Hi,
When fixing coding style issues, I noticed a lot of mixed php and html, especially in the files in the rootdir of the pma.
F.e. : <div id='<?php echo htmlentities($name); ?>' class='someclass'>
or even worse :
<?php if ($something) { ?><p>Some conditional text</p> <?php } ?> <p>Some unconditional text</p>
It generates a lot of codingstyle errors : too long lines, wrong indentation, ... it is badly structured and thus difficult to read and to be honest, is ugly.
I'm thinking of starting to clean it up towards 4.0, using either echo's or assigning the output html to a string and add it to the appropriate Response class method.
f.e. :
<?php
$response = PMA_Response::getInstance();
$output = "";
\ some code in between
if (something) { $output .= "<p>Some conditional text</p>"; } $output .= "Some unconditional text</p>";
\ some code in between
$response->addHTML($output); ?>
Any thoughts?
Hi
Dne Tue, 4 Sep 2012 20:51:17 +0200 Dieter Adriaenssens dieter.adriaenssens@gmail.com napsal(a):
It generates a lot of codingstyle errors : too long lines, wrong indentation, ... it is badly structured and thus difficult to read and to be honest, is ugly.
I'm thinking of starting to clean it up towards 4.0, using either echo's or assigning the output html to a string and add it to the appropriate Response class method.
Definitely this would help making our code base easier to read, so go ahead :-).
Michal Čihař a écrit :
Hi
Dne Tue, 4 Sep 2012 20:51:17 +0200 Dieter Adriaenssens dieter.adriaenssens@gmail.com napsal(a):
It generates a lot of codingstyle errors : too long lines, wrong indentation, ... it is badly structured and thus difficult to read and to be honest, is ugly.
I'm thinking of starting to clean it up towards 4.0, using either echo's or assigning the output html to a string and add it to the appropriate Response class method.
Definitely this would help making our code base easier to read, so go ahead :-).
I'm ok for clean up, however it makes maintenance less easy. We are still supposed to fix bugs in QA_3_5 and port them to master.
2012/9/5 Marc Delisle marc@infomarc.info:
Michal Čihař a écrit :
Hi
Dne Tue, 4 Sep 2012 20:51:17 +0200 Dieter Adriaenssens dieter.adriaenssens@gmail.com napsal(a):
It generates a lot of codingstyle errors : too long lines, wrong indentation, ... it is badly structured and thus difficult to read and to be honest, is ugly.
I'm thinking of starting to clean it up towards 4.0, using either echo's or assigning the output html to a string and add it to the appropriate Response class method.
Definitely this would help making our code base easier to read, so go ahead :-).
I'm ok for clean up, however it makes maintenance less easy. We are still supposed to fix bugs in QA_3_5 and port them to master.
True, but this also applies to code that is affected by the GSoC refactoring projects. And there the impact is even bigger. In removing the mix of html and php, functionality is not changed, the code is restructured a bit. In the end maintaining the code will be easier because it is better structured and better readable.
BTW : I believe it was a goal of 4.0 to refactor and cleanup the code, so this seems like a good opportunity to do this now. ;)