1#!/usr/bin/env php
2<?php
3/*
4  +----------------------------------------------------------------------+
5  | Yar - Light, concurrent RPC framework                                |
6  +----------------------------------------------------------------------+
7  | Copyright (c) 2012-2013 The PHP Group                                |
8  +----------------------------------------------------------------------+
9  | This source file is subject to version 3.01 of the PHP license,      |
10  | that is bundled with this package in the file LICENSE, and is        |
11  | available through the world-wide-web at the following url:           |
12  | http://www.php.net/license/3_01.txt                                  |
13  | If you did not receive a copy of the PHP license and are unable to   |
14  | obtain it through the world-wide-web, please send a note to          |
15  | license@php.net so we can mail you a copy immediately.               |
16  +----------------------------------------------------------------------+
17  | Author:  Xinchen Hui <laruence@php.net>                              |
18  +----------------------------------------------------------------------+
19*/
20
21
22if (php_sapi_name() !== "cli") {
23    die ("This tool only run on CLI\n");
24}
25
26if ($argc < 4) {
27    die ("Usage: php debug.php uri method \"args, args\"\n");
28}
29
30include "yar_debug.inc";
31
32list($script, $uri, $method, $args) = $argv;
33
34$client = new Yar_Debug_Client($uri);
35$response = $client->call($method, explode(",", $args));
36
37print_r($response);
38?>
39