How I can run MyDaemon.php in background in TideSDK app?
MyDaemon.php - it's my completely ready console software (a lot of code, run other my php scripts, run other software, etc). It's endless php script. It must be start after TideSDK APP and live all time before exit (while user don't close app). TideSDK show status from MyDaemon.php and have few buttons to control it.
Issue 1: How can I start MyDaemon.php in:
Ti.Process.createProcess("?path/to/php/from/tide? -f MyDaemon.php");
What write in "path/to/php/from/tide"? Target computer of my users don't have php package. I want run php from TideSDK like console mode. I include feature PHP and use button "Package with Runtime" in TideSDK Developer. I looked for all files inside TideSDK, but there are nothing like "php" (executing file), only libs.
Issue 2: I try to use
< iframe width=0 height=0 src="MyDaemon.php"></ iframe>
But TideSDK can't start UI APP, because can't take FULL source in frame. MyDaemon.php is undless. How can I include < IFRAME> in ASYNC mode like a real browser?
I try to use this trick:
<iframe width=0 height=0 src="" name="php">< /iframe>
<script>setTimeout("frames.php.location.href=MyDaemon.php", 1000)</ script>
But it's not work too (UI APP started, but halted after execute this frame).
MyDaemon.php can communicate with TideSDK APP any way:
- start "/bin/php -f MyDaemon.php" and read/write stdin/stdout. MyDaemon.php can write to stdout any commands in JSON format.
- start MyDaemon.php in and write to stdout < script>Ti...[commands]< /script> - any direct JS code for TideSDK
- write any msg to file1 and read from file2 (TideSDK will read/write there and execute)
- write any msg to SQLite DB (TideSDK will read DB on JS code) Any other way.
It's important: MyDaemon.php want to start in console other php files! Because first process run a lot of childrens for calculating very long tasks. I can ask TideSDK for start this childrens and don't use "exec(/bin/php -f second.php)" in MyDaemon.php.
But I don't want to include double PHP binaries to my APP, because TideSDK APP already have it! It's a lot of extra space in dist.
Thank you and sorry for my language.