Initial commit of Host MVC.

Used for daemonCheck, getLoad, etc
This commit is contained in:
Kyle Johnson 2014-11-16 00:21:55 +00:00
parent f1a70076d0
commit 175e7d3e22
3 changed files with 35 additions and 0 deletions

1
web/api/app/Config/routes.php Normal file → Executable file
View File

@ -28,6 +28,7 @@
Router::mapResources('configs'); Router::mapResources('configs');
Router::mapResources('events'); Router::mapResources('events');
Router::mapResources('frames'); Router::mapResources('frames');
Router::mapResources('host');
Router::parseExtensions(); Router::parseExtensions();
/** /**

View File

@ -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')
));
}
}

View File

@ -0,0 +1,9 @@
<?php
App::uses('AppModel', 'Model');
class Host extends AppModel {
public $useTable = false;
}