[freeside-commits] freeside/fs_selfservice/fri/includes freeside.class.php, NONE, 1.1

Ivan,,, ivan at wavetail.420.am
Sun Mar 16 19:49:13 PDT 2008


Update of /home/cvs/cvsroot/freeside/fs_selfservice/fri/includes
In directory wavetail.420.am:/tmp/cvs-serv14834/includes

Added Files:
	freeside.class.php 
Log Message:
missed bits

--- NEW FILE: freeside.class.php ---
<?php
class FreesideSelfService  {

    //Change this to match the location of your selfservice xmlrpc.cgi or daemon
    //var $URL = 'https://www.example.com/selfservice/xmlrpc.cgi';
    var $URL = 'http://localhost/selfservice/xmlrpc.cgi';

    function FreesideSelfService() {
      $this;
    }

    public function __call($name, $arguments) {

        error_log("[FreesideSelfService] $name called, sending to ". $this->URL);

        $request = xmlrpc_encode_request("FS.SelfService.XMLRPC.$name", $arguments);
        $context = stream_context_create( array( 'http' => array(
            'method' => "POST",
            'header' => "Content-Type: text/xml",
            'content' => $request
        )));
        $file = file_get_contents($this->URL, false, $context);
        if (!$file) {
            trigger_error("[FreesideSelfService] XML-RPC communication error: file_get_contents did not return");
        } else {
            $response = xmlrpc_decode($file);
            if (xmlrpc_is_fault($response)) {
                trigger_error("[FreesideSelfService] XML-RPC communication error: $response[faultString] ($response[faultCode])");
            } else {
                //error_log("[FreesideSelfService] $response");
                return $response;
            }
        }
    }

}

?>



More information about the freeside-commits mailing list