2017 © Pedro Peláez
 

library pws-client

PwsClient is a php web service client managing PwsAuth protocol

image

meta-tech/pws-client

PwsClient is a php web service client managing PwsAuth protocol

  • Wednesday, September 20, 2017
  • by Meta-Tech
  • Repository
  • 1 Watchers
  • 1 Stars
  • 407 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 1 % Grown

The README.md

MetaTech PwsClient

a php webservice client managing PwsAuth protocol, (*1)

Requirements

PHP >= 5.4, (*2)

Install

The package can be installed using Composer ., (*3)

composer require meta-tech/pws-client

Or add the package to your composer.json., (*4)

"require": {
    "meta-tech/pws-client" : "^1.3"
}

Usage

When instantiating, PwsClient automatically checks if it has been authenticated. Otherwise, or if the session has expired, the client will perform the authentication. Then, you can initiate get or post call, (*5)

<?php
require_once(__dir__ . '/vendor/autoload.php');

use Symfony\Component\Yaml\Yaml;
use MetaTech\PwsAuth\Authenticator;
use MetaTech\Ws\Client;

$config        = Yaml::parse(file_get_contents(__dir__ . '/config/pwsauth.yml'));
$authenticator = new Authenticator($config);

$config        = Yaml::parse(file_get_contents(__dir__ . '/config/pwsclient.yml'));
$client        = new Client($config, $authenticator);
// on instanciation the client init this calls :
// $client->check();
// enventually $client->call() (depending on previous response);

// get example
$response = $client->get('/ws/person/222');
if ($response->done) {
    // do stuff

}
// post example
$response = $client->post('/ws/person/222/update', [ 'firstname' => 'toto']);
if ($response->done) {
    // do stuff
}

// to close and destroy session on serverside :
// $client->logout();

Config

# pwsclient config

# 0 : disable, 1 : verboose, 2 : most verboose
debug       : 1
protocol    : https://
hostname    : pwsserver.docker
# ssl options
verifypeer  : 0
verifyhost  : 0
# file storing the server 's session id - must be out of DocumentRoot and read/writable by server
store       : wsess
login       : test
password    : test
key         : test
# 0 : display cli, 1 : display html
html_output : 0
# http authentication
http        : 
    user        :
    password    :
# server uris for authentication
uri         :
    auth        : /ws/auth
    logout      : /ws/logout
    check       : /ws/isauth

Server Response

PwsClient intend to receiv any JsonResponse, the structure of the response is free.
However, meta-tech always return this simple Json Structure :
{ done : boolean, msg : 'string contextual msg', data : whatever }, (*6)

see meta-tech/pws-server
and meta-tech/silex-core , (*7)

License

The project is released under the MIT license, see the LICENSE file., (*8)

The Versions

20/09 2017

dev-master

9999999-dev https://github.com/meta-tech/pws-client

PwsClient is a php web service client managing PwsAuth protocol

  Sources   Download

MIT

The Requires

 

http client webservice pwsauth

20/09 2017

1.3.5

1.3.5.0 https://github.com/meta-tech/pws-client

PwsClient is a php web service client managing PwsAuth protocol

  Sources   Download

MIT

The Requires

 

http client webservice pwsauth

24/03 2017

1.3.4

1.3.4.0 https://github.com/meta-tech/pws-client

PwsClient is a php web service client managing PwsAuth protocol

  Sources   Download

MIT

The Requires

 

http client webservice pwsauth

21/03 2017

1.3.3

1.3.3.0 https://github.com/meta-tech/pws-client

PwsClient is a php web service client managing PwsAuth protocol

  Sources   Download

MIT

The Requires

 

http client webservice pwsauth

20/03 2017

1.3.2

1.3.2.0 https://github.com/meta-tech/pws-client

PwsClient is a php web service client managing PwsAuth protocol

  Sources   Download

MIT

The Requires

 

http client webservice pwsauth

15/03 2017

1.3.1

1.3.1.0 https://github.com/meta-tech/pws-client

PwsClient is a php web service client managing PwsAuth protocol

  Sources   Download

MIT

The Requires

 

http client webservice pwsauth

15/03 2017

1.3.0

1.3.0.0 https://github.com/meta-tech/pws-client

PwsClient is a php web service client managing PwsAuth protocol

  Sources   Download

MIT

The Requires

 

http client webservice pwsauth