Initial import
This commit is contained in:
61
application/controllers/tools/replikasi/Replikasi.php
Normal file
61
application/controllers/tools/replikasi/Replikasi.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
class Replikasi extends MY_Controller
|
||||
{
|
||||
var $db;
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function status()
|
||||
{
|
||||
try {
|
||||
if (! $this->isLogin) {
|
||||
$this->sys_error("Invalid Token");
|
||||
exit;
|
||||
}
|
||||
$prm = $this->sys_input;
|
||||
|
||||
$sql_data = "show slave status";
|
||||
$qry_data = $this->db->query($sql_data);
|
||||
if ($sql_data) {
|
||||
$rows = $qry_data->result_array();
|
||||
} else {
|
||||
$this->sys_error_db("slave status error", $this->db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$result = array(
|
||||
"records" => $rows
|
||||
);
|
||||
|
||||
$this->sys_ok($result);
|
||||
|
||||
} catch (Exception $exc) {
|
||||
$message = $exc->getMessage();
|
||||
$this->sys_error($message);
|
||||
}
|
||||
}
|
||||
|
||||
function start_slave()
|
||||
{
|
||||
try {
|
||||
if (! $this->isLogin) {
|
||||
$this->sys_error("Invalid Token");
|
||||
exit;
|
||||
}
|
||||
$sql_data = "start slave";
|
||||
$qry_data = $this->db->query($sql_data);
|
||||
if ($sql_data) {
|
||||
$this->sys_ok($qry_data);
|
||||
} else {
|
||||
$this->sys_error_db("start slave error", $this->db);
|
||||
exit;
|
||||
}
|
||||
} catch (Exception $exc) {
|
||||
$message = $exc->getMessage();
|
||||
$this->sys_error($message);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user