mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Updated 'optimize database' tools to use mysql class and LAN optimzation #6
This commit is contained in:
@@ -1311,17 +1311,18 @@ class system_tools
|
|||||||
* Optimize SQL
|
* Optimize SQL
|
||||||
* @return none
|
* @return none
|
||||||
*/
|
*/
|
||||||
private function optimizesql($mySQLdefaultdb) //FIXME Use mysql class.
|
private function optimizesql($mySQLdefaultdb)
|
||||||
{
|
{
|
||||||
// global $mes;
|
$mes = e107::getMessage();
|
||||||
$result = mysql_list_tables($mySQLdefaultdb);
|
$tables = e107::getDb()->tables();
|
||||||
while($row = mysql_fetch_row($result))
|
|
||||||
|
foreach($tables as $table)
|
||||||
{
|
{
|
||||||
mysql_query("OPTIMIZE TABLE ".$row[0]);
|
e107::getDb()->gen("OPTIMIZE TABLE ".$table);
|
||||||
}
|
}
|
||||||
|
|
||||||
// $mes->add(DBLAN_11." $mySQLdefaultdb ".DBLAN_12, E_MESSAGE_SUCCESS);
|
$mes->addSuccess(e107::getParser()->lanVars(DBLAN_11, $mySQLdefaultdb));
|
||||||
e107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_7, DBLAN_11." $mySQLdefaultdb ".DBLAN_12);
|
e107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_7, $mes->render());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -17,8 +17,8 @@ define("DBLAN_7", "Optimize SQL database");
|
|||||||
define("DBLAN_8", "Select to backup your core settings");
|
define("DBLAN_8", "Select to backup your core settings");
|
||||||
define("DBLAN_9", "Backup core");
|
define("DBLAN_9", "Backup core");
|
||||||
define("DBLAN_10", "Database Utilities");
|
define("DBLAN_10", "Database Utilities");
|
||||||
define("DBLAN_11", "MySQL database");
|
define("DBLAN_11", "MySQL database [x] optimized");
|
||||||
define("DBLAN_12", "optimized");
|
//define("DBLAN_12", "optimized");
|
||||||
// define("DBLAN_13", "Back");
|
// define("DBLAN_13", "Back");
|
||||||
// define("DBLAN_14", "Done");
|
// define("DBLAN_14", "Done");
|
||||||
define("DBLAN_15", "Select to check for any available db updates");
|
define("DBLAN_15", "Select to check for any available db updates");
|
||||||
|
Reference in New Issue
Block a user