Re: command line tool called from php
Re: command line tool called from php
- Subject: Re: command line tool called from php
- From: Jens Alfke <email@hidden>
- Date: Tue, 23 Aug 2011 00:15:53 -0700
On Aug 22, 2011, at 10:45 PM, Rainer Standke wrote:
> I have a command line tool that uses foundation. When I run that tool from the command line it does what I need it to do. This includes sending an NSNotification to a Cocoa application via the NSDistributedNotificationCenter.
>
> When I call the same command line tool from a php page served by Apache on the same machine, the notification is never sent.
Apache isn’t running in the same login context as your app. In fact it’s an entirely separate user account. Distributed notifications don’t go between login sessions.
I can’t think of any straightforward solution. Probably the best approach is to have your Cocoa app listen on an IP port and then the tool can send a message to that port. You’d have to either hardcode the port number or find a way to communicate the number to the tool, and the app would need to make sure it binds only to the loopback interface to avoid the possibility of getting pinged by another machine.
—Jens_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden