Hi Marc,
Ok, so what do you think of this code snippet:
$query[] = $insert_command . 'INTO '
. PMA_CommonFunctions::getInstance()->backquote($GLOBALS['db']) . '.'
. PMA_CommonFunctions::getInstance()->backquote($GLOBALS['table'])
. ' (' . implode(', ', $query_fields) . ') VALUES ('
. implode('), (', $value_sets) . ')';
Does this follow the singleton principle?
As I think this doesn't break the singleton principle since we are not creating two objects.
Since the private constructor always give the existing PMA_CommonFunctions object if there exist any, no more objects are created.
Actually why I used that $common_functions variable is, reducing the line length and if there are frequent occurrence inside procedural code or function, its easy to use a variable than this lengthy code.
As well we have discussed to reduce the use of globals.
Please make me correct if I did any wrong.
Regards !
--
____________________________________
Chanaka Indrajith
Bsc.Computer Engineering Undergraduate
Faculty of Engineering
University of Peradeniya
Sri Lanka
____________________________________