[Phpmyadmin-devel] using PMA_Table::sGetStatusInfo without E_USER_WARNING

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I'd like to create a function isMerge() in the PMA_Table class (I checked this with Marc). In order to get the value of parameter 'Engine', I should either call PMA_Table::sGetStatusInfo() or PMA_DBI_get_tables_full(). When using sGetStatusInfo(), an error (E_USER_WARNING) is thrown if the parameter 'Engine' does not exist. If using PMA_DBI_get_tables_full(), most of what is done in sGetStatusInfo() has to be repeated. So it would be best to use sGetStatusInfo() for this, but the error should be avoided. A possibility is to add a parameter to the sGetStatusInfo() function to suppress the trigger of the warning if needed. Another option, but less clean, is to disable error_reporting before calling sGetStatusInfo() and reenabling it afterwards. I prefer the extra parameter to suppress the trigger, but would like to know what you think. Do you have other suggestions? - - -- Kind regards, Dieter Adriaenssens -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Use GnuPG with Firefox : http://getfiregpg.org (Version: 0.7.10) iEYEARECAAYFAkuWmCkACgkQZGJbiPqZM6N+LwCdHlFUReeXjDIA8/t0J0MV5B9k E/4Amwcd8CNL91MRwvitO66sCVyocXc9 =ebEr -----END PGP SIGNATURE-----

Dieter Adriaenssens a écrit :
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I'd like to create a function isMerge() in the PMA_Table class (I checked this with Marc). In order to get the value of parameter 'Engine', I should either call PMA_Table::sGetStatusInfo() or PMA_DBI_get_tables_full().
When using sGetStatusInfo(), an error (E_USER_WARNING) is thrown if the parameter 'Engine' does not exist. If using PMA_DBI_get_tables_full(), most of what is done in sGetStatusInfo() has to be repeated.
So it would be best to use sGetStatusInfo() for this, but the error should be avoided.
A possibility is to add a parameter to the sGetStatusInfo() function to suppress the trigger of the warning if needed. Another option, but less clean, is to disable error_reporting before calling sGetStatusInfo() and reenabling it afterwards.
I prefer the extra parameter to suppress the trigger, but would like to know what you think. Do you have other suggestions?
Hi Dieter, an extra parameter is fine, with a default value that keeps the current behavior. -- Marc Delisle http://infomarc.info
participants (2)
-
Dieter Adriaenssens
-
Marc Delisle