Hi Steve,
I'll look into that. Our launchd process that keeps 4D alive uses a shell
script that wraps an applescript. PHP could call
shell_exec('osascript tryToKill4d.scpt'')
but I again my run into the problem where _www (the apache/php user) can't run
the script due to permissions.
Thanks,
Brad
________________________________________
From: [email protected]
[[email protected]] on behalf of Steve Alex
[[email protected]]
Sent: Sunday, December 11, 2011 4:41 AM
To: Active4D Developer Discussion List
Subject: Re: [Active4d-dev] [OFF] Restarting 4D/Active4D from PHP
On Dec 10, 2011, at 7:23 PM, Perkins, Bradley D wrote:
> The shell command 'sudo killall 4D' will kill 4D but I can only get this to
> work if run from the command line as a privileged user. If I try to run a PHP
> script that executes that it doesn't have the privileges to run 'killall'.
Since you're running OS X, have you tried AppleScript?
tell application "System Events"
tell application process "4th Dimension"
set frontmost to true
end tell
-- send the keystrokes
keystroke "q" using {command down}
delay 3
set app4d to every application process whose name contains "4th
Dimension"
if app4d is not {} then
tell application process "4th Dimension"
set frontmost to true
end tell
keystroke "q" using {command down}
end if
end tell
I've used an applescript application containing the above code to restart 4d
occasionally.
You can also do shell commands to do the kill all. I just don't know if you can
launch a script applications form php. I know you can from launchd. It should
run with the same privileges as the 4d process, if not I've seen authentication
stuff in scripts.
Steve Alex
_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://vasudev.aparajitaworld.com/archive/active4d-dev/
_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://vasudev.aparajitaworld.com/archive/active4d-dev/