2017 © Pedro PelĂĄez
 

library rserve-php

Rserve client library for PHP

image

ghola/rserve-php

Rserve client library for PHP

  • Monday, March 13, 2017
  • by ghola
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,584 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 22 Forks
  • 0 Open issues
  • 4 Versions
  • 25 % Grown

The README.md

Rserve-php

php5 client for Rserve http://www.rforge.net/Rserve/ (a TCP/IP server for R statistical software), (*1)

Changes from 1.0 version

  • All classes are declared under Sentiweb\Rserve namespace allowing PSR-4 autoloading
  • Parsers are now individualized into classes
  • A Parser instance can be directly used as second argument of evalString() to replace default parser (see example)

Tests

You can run tests using phpunit, (*2)

  • Create a file config.php in the "tests" directory (copy config.php.sample)
  • define the constant RSERVE_HOST with the address of your Rserve server (custom port not supported yet)
  • run tests . phpunit --bootstrap=src/autoload.php tests/ParserNativeTest.php . phpunit tests\SessionTest.php . phpunit tests\REXPTest.php
  • define the constants RSERVE_PORT, RSERVE_USER, RSERVE_PASS to config.php (along with RSERVE_HOST)
  • run test . phpunit tests\LoginTest.php

Installation

Using without composer : include src/autoload.php in your project, (*3)

Using with composer: composer require cturbelin/rserve-php, (*4)

Some usage examples are provided in example/ directory, (*5)

Using Login Authorization

Usage is the same as the vanilla usage, except for the constructor $cnx = new Connection('myserverhost', serverport, array('username'=>username,'password'=>password)), (*6)

Parsers

Results provided by R could be handled using several parsers, (*7)

  • NativeArray Translates R structure into php simple arrays. It is useful to get simple values from R, (*8)

  • Wrapped array Using NativeArray with parameter ["wrapper"=>true] in contructor returns object with attributes of R objects. The result object can be used as an array and provides methods to access R object attributes, (*9)

  • Debug Translates R response to structure useful for debugging, (*10)

  • REXP Translates R response into REXP classes, (*11)

Async Mode

Several functions allow to use connection in async mode, (*12)

  • getSocket() to get the socket an set some options
  • setAsync() allow to set the async mode
  • getResults($parser) : get and parse the results after a call to evalString() in async mode

Contacts

Clément Turbelin, clement.turbelin@gmail.com http://www.sentiweb.fr UniversitĂ© Pierre et Marie Curie - Paris 6, France, (*13)

The Versions

13/03 2017

dev-master

9999999-dev https://github.com/cturbelin/rserve-php

Rserve client library for PHP

  Sources   Download

The Requires

  • php >=5.2.0

 

by Clément Turbelin

stats r rserve

13/03 2017

2.0.0

2.0.0.0 https://github.com/cturbelin/rserve-php

Rserve client library for PHP

  Sources   Download

The Requires

  • php >=5.2.0

 

by Clément Turbelin

stats r rserve

13/03 2017

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/cturbelin/rserve-php

Rserve client library for PHP

  Sources   Download

The Requires

  • php >=5.2.0

 

by Clément Turbelin

stats r rserve

17/04 2016

v1.0

1.0.0.0 https://github.com/cturbelin/rserve-php

Rserve client library for PHP

  Sources   Download

The Requires

  • php >=5.2.0

 

by Clément Turbelin

stats r rserve