my win7_x86 system.
I tried system.popen("c:\php\php.exe c:\sbbs\myscript.php " + someargs); which returns nothing
Re: run external php script
By: Mortifis to All on Sat Feb 09 2019 15:57:26
my win7_x86 system.
If I were doing a lot of this, I'd probably make a function that:
- Takes the command-line to execute as an argument
- Generates a random tempfile name
- Runs the command and tacks on the redirect to the temp file
- Reads the temp file contents
- Deletes the temp file
- Returns the temp file contents
And then I'd probably still feel a bit gross.
I am trying to get a php script to run externally from an sbbs.ssjs script, I have this working on my Linux system but am having problems on my win7_x86 system.
I tried system.popen("c:\php\php.exe c:\sbbs\myscript.php " + someargs); which returns nothing
so I tried system.exec("c:\php\php.exe c:\sbbs\myscript.php " + someargs); which returns 1
So, my question is, how do I trap the result under windows, it is handled automagically under Linux
So, my question is, how do I trap the result under windows, it
is handled automagically under Linux
Re: run external php script
By: Mortifis to All on Sat Feb 09 2019 03:57 pm
system.exec() will just run the command. If you want the output of the command, you'll need to redirect the output to a file and read that file (on Windows).
Re: run external php script
By: Mortifis to All on Sat Feb 09 2019 03:57 pm
system.exec() will just run the command. If you want the output of the command, you'll need to redirect the output to a file and read that file (on Windows).
Is there an equivalent to file_get_content('http://blah_blah.blah');
Re: Re: run external php script
By: Mortifis to Digital Man on Sun Feb 10 2019 12:29:40
Is there an equivalent to file_get_content('http://blah_blah.blah');
require('http.js', 'HTTPRequest');
const response = (new HTTPRequest()).Get('http://blah_blah.blah');
BTW where do I find your openweathermap.js? I looked on github under web4but seem to have lost my glasses :-o
Re: run external php script
By: Mortifis to All on Sat Feb 09 2019 15:57:26
So, my question is, how do I trap the result under windows, it
is handled automagically under Linux
we just went through this with tickit... we were trying to determine why addfiles was not working right for someone when tickit ran as an event but it (addfiles) did run properly when they manually ran tickit...
look at the tickit sources in the addfiles section and you'll see what i came up with that worked great and was left in tickit if anyone needed the facility later for troubleshooting...
Re: Re: run external php script
By: Mortifis to echicken on Sun Feb 10 2019 16:37:16
BTW where do I find your openweathermap.js? I looked on github under web4but seem to have lost my glasses :-o
It's a generic library and not part of the web interface. I put it in the Synchronet CVS under exec/load/. Note that the script doesn't do anything on its own to display information to a BBS user; it's a library for scripts that want to interact with the OWM API.
I did create a sidebar module for the web interface that uses this library; it's under web/sidebar/.extras/ in the github repo.
OpenWeatherMap use requires an API key, so you'll have to go to their site and sign up for one. Add a section to ctrl/modopts.ini like this:
Re: Re: run external php script
By: Mortifis to echicken on Sun Feb 10 2019 16:37:16
BTW where do I find your openweathermap.js? I looked on github under web4but seem to have lost my glasses :-o
It's a generic library and not part of the web interface. I put it in the Synchronet CVS under exec/load/. Note that the script doesn't do anything on its own to display information to a BBS user; it's a library for scripts that want to interact with the OWM API.
look at the tickit sources in the addfiles section and you'll
see what i came up with that worked great and was left in
tickit if anyone needed the facility later for
troubleshooting...
I did, thank you, knew how to redirect to files and read them,
seems a long way around that mr gates imposed upon us :-Þ
hopefully some future verion of winbloz has a
comparable > /dev/null 2>&1 function or whatever ...
I only bothered with all this cuz I broke a G string on my
acoustic and got bored LOL
I only bothered with all this cuz I broke a G string on my
acoustic and got bored LOL
i think i'd rather play with the G string as long as the female that owns it is close by and willing to play a "round or two" O:) -=B-)
Sysop: | fluid |
---|---|
Location: | wickliffe, ohio |
Users: | 5 |
Nodes: | 10 (0 / 10) |
Uptime: | 203:19:24 |
Calls: | 50 |
Files: | 15,838 |
Messages: | 50,771 |