blSQLStatusBox = true * ------------------------------------------------------------- */ function smarty_function_tm_sql_status($aParams, &$smarty) { $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig(); // muss in config.inc.php gesetzt sein $box = $myConfig->getConfigParam('blSQLStatusBox'); if ($box == false) { return ''; } $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC); $query = "SHOW STATUS WHERE Variable_name IN ( 'Com_select', 'Com_update', 'Com_insert', 'Com_delete' )"; $iSelects = $iDeletes = $iInserts = $iUpdates = 0; $rows = $db->getAll($query); foreach ($rows as $row) { switch ($row['Variable_name']) { case 'Com_select': $iSelects = (int)$row['Value']; break; case 'Com_update': $iUpdates = (int)$row['Value']; break; case 'Com_insert': $iInserts = (int)$row['Value']; break; case 'Com_delete': $iDeletes = (int)$row['Value']; break; default: break; } } $iSum = $iSelects + $iDeletes + $iInserts + $iUpdates; $sTable = ''; $sTable .= ''; $sTable .= ""; $sTable .= '
All: $iSum SELECT: $iSelects UPDATE: $iUpdates INSERT: $iInserts DELETE: $iDeletes
'; return $sTable; }