|
|
@@ -17,33 +17,6 @@ class FindBox extends PluginStrategy
|
|
|
// CLI scripts
|
|
|
$this->AddRoute('GET /cli.fb.service', __NAMESPACE__ . '\FindBoxService->Main');
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * Check if is running, Spawn and detach the OM-Link background service.
|
|
|
- * With DEBUG>0 enable XDEBUG to stop to breakpoints
|
|
|
- */
|
|
|
- private function SpawnServiceProcess()
|
|
|
- {
|
|
|
- global $f3;
|
|
|
-
|
|
|
- if ($f3->get('DEBUG') > 0)
|
|
|
- putenv('XDEBUG_CONFIG="remote_enable=1 remote_mode=req remote_port=9000 remote_host=127.0.0.1 remote_connect_back=0"');
|
|
|
-
|
|
|
- $apiCall = "index.php /cli.fb.service";
|
|
|
- switch (strtolower(PHP_OS_FAMILY)) {
|
|
|
- case 'linux':
|
|
|
- // TODO: da TESTARE sotto Linux, specialmente putenv()
|
|
|
- $command = "nohup {$f3->get('PHP_PATH')} {$apiCall} &";
|
|
|
- break;
|
|
|
- case 'windows':
|
|
|
- $command = "start {$f3->get('PHP_PATH')} {$apiCall}";
|
|
|
- break;
|
|
|
- default:
|
|
|
- throw new \Exception('Operative system not detected');
|
|
|
- break;
|
|
|
- }
|
|
|
- pclose(popen($command, 'r'));
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/** @var \OpenMind\FindBox\FindBox $FindBox */
|