Initial commit of Host MVC.
Used for daemonCheck, getLoad, etc
This commit is contained in:
parent
f1a70076d0
commit
175e7d3e22
|
@ -28,6 +28,7 @@
|
|||
Router::mapResources('configs');
|
||||
Router::mapResources('events');
|
||||
Router::mapResources('frames');
|
||||
Router::mapResources('host');
|
||||
Router::parseExtensions();
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
App::uses('AppController', 'Controller');
|
||||
|
||||
class HostController extends AppController {
|
||||
|
||||
public $components = array('RequestHandler');
|
||||
|
||||
public function daemonCheck($daemon=false, $args=false) {
|
||||
$string = "`which zmdc.pl` check";
|
||||
if ( $daemon )
|
||||
{
|
||||
$string .= " $daemon";
|
||||
if ( $args )
|
||||
$string .= " $args";
|
||||
}
|
||||
$result = exec( $string );
|
||||
$result = preg_match( '/running/', $result );
|
||||
|
||||
$this->set(array(
|
||||
'result' => $result,
|
||||
'_serialize' => array('result')
|
||||
));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
<?php
|
||||
App::uses('AppModel', 'Model');
|
||||
|
||||
class Host extends AppModel {
|
||||
|
||||
public $useTable = false;
|
||||
|
||||
}
|
Loading…
Reference in New Issue