<commit_before># Bassoon

Bassoon is a remote service proxy generator for PHP.  It will take as input the
name of a specially annotated PHP class and generate a Javascript file which
provides a client interface to a service defined by the class.  The generated
javascript required jQuery and the jQuery Cookie plugin.<commit_msg>Added some actual instructions on how to use bassoon<commit_after># Bassoon

## Intro

Bassoon is a remote service proxy generator for PHP.  It will take as input the
name of a specially annotated PHP class and generate a Javascript file which
provides a client interface to a service defined by the class.  The generated
javascript requires jQuery and the jQuery Cookie plugin.

## Definition

Defining a remote service is as simple as creating a class with a parameterless
constructor (or no constructor) and using the \bassoon\RemoteService class to
generate the proxy and dispatcher code. 

    class MyService {

        public function doSomething() {
            // ...
        }
    }
    
    // ...
    require_once '/path/to/bassoon/src/Autoloader.php';
    $srvc = new \bassoon\RemoteService('MyService');
    $srvc->generate($proxyOut, $dispatchOut, $dispatchWeb);

In the last line the $proxyOut, $dispatchOut and $dispatchWeb parameters are
important.  Here is an example:

  /var/www/mysite.com
  \_ htdocs
     \- index.php
     \_ js
     \_ ajx
     \_ ...
  \_ ...

Assuming index.php in accessed at http://mysite.com/ then values are:

    $proxyOut = '/var/www/mysite.com/htdocs/js';
    $dispatchOut = '/var/www/mysite.com/htdocs/ajx';
    $dispatchWeb = '/ajx';
  
{'fraction_non_alphanumeric': 0.07854050711193568, 'fraction_numerical': 0.0, 'mean_word_length': 3.127551020408163, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1232759', 'n_tokens_mistral': 469, 'n_tokens_neox': 443, 'n_words': 190}