Batch 6a: application controllers base
This commit is contained in:
30
application/controllers/tools/Myqueue.php
Normal file
30
application/controllers/tools/Myqueue.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
class Myqueue extends MY_Controller
|
||||
{
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->db = $this->load->database("onedev", true);
|
||||
}
|
||||
function list($time=0) {
|
||||
$sql = "select ID,USER,HOST,DB,COMMAND,TIME,STATE,PROGRESS,MEMORY_USED
|
||||
from INFORMATION_SCHEMA.processlist
|
||||
where USER <> 'system user' and TIME >= $time";
|
||||
$qry = $this->db->query($sql);
|
||||
//echo $this->db->last_query();
|
||||
if (! $qry ) {
|
||||
print_r($this->db->error());
|
||||
exit;
|
||||
}
|
||||
$rows = $qry->result_array();
|
||||
echo "ID\t\tUSER\t\tDB\t\tTIME\t\tMEMORY_USED\t\tPROGRESS\n";
|
||||
foreach($rows as $r) {
|
||||
$id = $r["ID"];
|
||||
$user = $r["USER"];
|
||||
$db = $r["DB"];
|
||||
$time = $r["TIME"];
|
||||
$mem = $r["MEMORY_USED"];
|
||||
$progress = $r["PROGRESS"];
|
||||
echo "$id\t\t$user\t\t$db\t\t$time\t\t$mem\t\t$progress\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user