In my lib/model/User.php, I have a method that 'publishes' data to an
external site (facebook in this case).

It does it like this:

    private function publish_internal()
    {
      $this->last_publish = time();

      $fb = sfFacebook::getInstance();
      $params = array('user_id' => $this->facebook_id,
                      'profile' => $this,
                     );
      sfContext::getInstance()->getRequest()->setAttribute('params',
$params);
      $ret =
sfContext::getInstance()->getController()->getPresentationFor('profile',
'update');
      $fb->api_client->profile_setFBML($ret, $this->facebook_id);
      if (sfConfig::get('sf_logging_enabled'))
      {
        sfContext::getInstance()->getLogger()->info('{profile data} '.$ret);
      }
    }

This is fine, however this can obviously be called from my main app,
calling this from 'backend' means the getPresentationFor fails.

I can't think how best to get around this - I want to be able to
generate this output from both applications, and calling between apps
via HTTP just seems crazy to get this done.

Any ideas?

-- 
Ian P. Christian ~ http://pookey.co.uk

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to