<?php require_once 'libraries/common.inc.php'; // If request for creating all PMA tables. if (isset($_REQUEST['create_pmadb'])) { PMA_fixPMATables($GLOBALS['db']); } $cfgRelation = PMA_getRelationsParam(); // If request for creating missing PMA tables. if (isset($_REQUEST['fix_pmadb'])) { PMA_fixPMATables($cfgRelation['db']); } $response = PMA_Response::getInstance(); $response->addHTML(PMA_getRelationsParamDiagnostic($cfgRelation));
<?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * Displays status of phpMyAdmin configuration storage * * @package PhpMyAdmin */ require_once 'libraries/common.inc.php'; $response = PMA_Response::getInstance(); $response->addHTML(PMA_getRelationsParamDiagnostic(PMA_getRelationsParam()));
/** * Test for PMA_getRelationsParam & PMA_getRelationsParamDiagnostic * * @return void */ public function testPMAGetRelationsParam() { $relationsPara = PMA_getRelationsParam(); $this->assertEquals(false, $relationsPara['relwork']); $this->assertEquals(false, $relationsPara['bookmarkwork']); $this->assertEquals('root', $relationsPara['user']); $this->assertEquals('phpmyadmin', $relationsPara['db']); $retval = PMA_getRelationsParamDiagnostic($relationsPara); //check $cfg['Servers'][$i]['pmadb'] $this->assertContains("\$cfg['Servers'][\$i]['pmadb']", $retval); $this->assertContains('<strong>OK</strong>', $retval); //$cfg['Servers'][$i]['relation'] $result = "\$cfg['Servers'][\$i]['pmadb'] ... </th><td class=\"right\">" . "<font color=\"green\"><strong>OK</strong></font>"; $this->assertContains($result, $retval); // $cfg['Servers'][$i]['relation'] $result = "\$cfg['Servers'][\$i]['relation'] ... </th><td class=\"right\">" . "<font color=\"red\"><strong>not OK</strong></font>"; $this->assertContains($result, $retval); // General relation features $result = 'General relation features: <font color="red">Disabled</font>'; $this->assertContains($result, $retval); // $cfg['Servers'][$i]['table_info'] $result = "\$cfg['Servers'][\$i]['table_info'] ... </th>" . "<td class=\"right\">" . "<font color=\"red\"><strong>not OK</strong></font>"; $this->assertContains($result, $retval); // Display Features: $result = 'Display Features: <font color="red">Disabled</font>'; $this->assertContains($result, $retval); $relationsPara['db'] = false; $retval = PMA_getRelationsParamDiagnostic($relationsPara); $result = __('General relation features'); $this->assertContains($result, $retval); $result = 'Configuration of pmadb… '; $this->assertContains($result, $retval); $result = "<strong>not OK</strong>"; $this->assertContains($result, $retval); }