2 $CMD_ROOT_FS = realpath(dirname(__FILE__));
8 // add libglcas as if it were a path in ../libglcas
9 if(file_exists("../libcbfwr")) {
10 $path = realpath($CMD_ROOT_FS."/../");
11 error_log("added cbfwr path as $path");
12 set_include_path(get_include_path().PATH_SEPARATOR.$path);
15 // include the based library
16 require_once("libcbfwr/lib.php");
20 error_log("CBFWRD starting");
23 $config = new Config();
26 if($argv[1] == "boot") {
27 // we get called here on boot.
28 $config->bootHardware();
33 // now we got into daemon modes
36 // setup our sem/shm stuff
38 // this stuff needs to go in comms
42 $config->loadConfig();
43 $comms->putConfig($config->getConfig());
45 $msg = $comms->waitForMessage();
47 //echo "Got message: $msg\n";
48 if($msg == "quit") $cont = false;
49 else cbfwd_commandProcessor($msg);
53 function cbfwd_commandProcessor($command)