weberhofer / jsonrpcphp

JSON-RPC PHP is a couple of classes written in PHP implementing respectively client and server functionalities of the JSON-RPC protocol.
GNU General Public License v2.0
22 stars 14 forks source link

Add composer support #2

Closed DavidePastore closed 9 years ago

DavidePastore commented 9 years ago

It would be nice. :cake:

weberhofer commented 9 years ago

Please try it out; I currenlty don't have enough time to test.

DavidePastore commented 9 years ago

I'm trying to use it. composer.json:

{
    "name": "davidepastore/jsonrpctest",
    "require": {
        "weberhofer/jsonrpcphp": "2.1-beta1"
    }
}

index.php

<?php
require 'vendor/autoload.php';
$myJSONRPCClient = new \org\jsonrpcphp\JsonRPCClient('http://www.example.com/' );

Error:

Fatal error: Class 'org\jsonrpcphp\JsonRPCClient' not found in C:\xampp\htdocs\jsonrpc\index.php on line 3

weberhofer commented 9 years ago

I have created a beta2 which fixes this issue. Please test.

DavidePastore commented 9 years ago

Using the same code above (changing the version of jsonrpcphp), it works fine. Good job @weberhofer :palm_tree:

weberhofer commented 9 years ago

fixed with release 2.1.0

ghost commented 9 years ago

This issue still exists in 2.1.0. Getting: PHP Fatal error: Class 'org\\jsonrpcphp\\jsonRPCClient' not found in .....

Tested with: PHP 5.5.9-1ubuntu4.7 and PHP 5.3.10-1ubuntu3.17

weberhofer commented 9 years ago

Can you please test with the latest dev-version? I have made the sources PSR2 compatible and fixed a issue which caused the namespace not to be recognized correctly with some versions of PHP.

ghost commented 9 years ago

Mmmm sorry for bothering you.. I've been staring over that little lowercase 'j'.... Cheers,

Bram

Jan-E commented 9 years ago

@brammeleman Curious: did you happen to copy/paste something from https://manual.limesurvey.org/RemoteControl_2_API#PHP_Example