Avatar

Level 1

Hi

I need to get a token back to my basic chat program and wanted to use amfphp.

I tried to test the class in the amfphp/browser but it doesn't work.

When I run the code from the command line it just pumps out

php chatter.php
usage: chatter.php [--debug] [--host=hosturl] account username password
         --list
         --create room [template]
         --delete room
         --delete-template template
         --ext-auth secret room username userid role
         --invalidate room

It's actually require_once("afcs.php"); thats causing it. I guess I should study the code but was wondering if it is possible to use amfphp without reworking loads of stuff.

I know that in the index.php that comes with the examples, the afcs.php is obviously used but something is supressing the "usage" output.

I've pasted my amfphp class below. I've tried moving the contructor content to the function also but it's not working still.

<?php
require_once("afcs.php");

class chatter
{
  
   public function __construct()
   {  // obviously deleted
     $account = "";
     $room    = "";
     $devuser = "";
     $devpass = "";
     $secret  = "";
   }

   function getchat($screen_name,$room)
   {
     $role = 5;
     session_start();
     $host  = "http://connectnow.acrobat.com";
     $accountURL = "{$host}/{$account}";
     $roomURL = "{$accountURL}/{$room}";
     $am = new AFCSAccount($accountURL);
     $am->login($devuser, $devpass);
     $session = $am->getSession($room);
     $token = $session->getAuthenticationToken($secret, $user, $user, $role);
     return $token;
    }


}?>
~
~

Many thanks

Kevin