• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: command line tool called from php
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: command line tool called from php
      • From: Daniel Acosta <email@hidden>
    • Re: command line tool called from php
      • From: Scott Ribe <email@hidden>
References: 
 >command line tool called from php (From: Rainer Standke <email@hidden>)

  • Prev by Date: command line tool called from php
  • Next by Date: Re: command line tool called from php
  • Previous by thread: command line tool called from php
  • Next by thread: Re: command line tool called from php
  • Index(es):
    • Date
    • Thread