When I go through this documentation: https://docs.phalconphp.com/en/latest/api/Phalcon_Db_Adapter_Pdo_Mysql.html
I find only getConnectionId() which seems to return 0 always for me. I'd like to find out if my connection is open or not.
I have a CLI task running in an eternal loop. Sometime its running lots of queries, but during the night it usually has nothing to run and may timeout. What I'd like to do is check if my connection is still open, before throwing any queries at it. I wanna avoid getting mysql has gone away error.
Is there anyway I could test if this is still active? $db = \Phalcon\Di::getDefault()->getShared('db');
I could do $db->connect() everytime before running queries, but it's not a persistent connection anymore then. It opens a new connection every time.