/** * @action pingDatabase * @return bool Always true if database available and writeable */ function pingDatabaseAction() { $hostname = infraRequestUtils::getHostname(); $server = ApiServerPeer::retrieveByHostname($hostname); if (!$server) { $server = new ApiServer(); $server->setHostname($hostname); } $server->setUpdatedAt(time()); if (!$server->save()) { return false; } return true; }