2017 © Pedro Peláez
 

symfony-bundle client-api-glpi-bundle

Bundle Symfony 2.7 for simple use webservices of GLPI.

image

l3/client-api-glpi-bundle

Bundle Symfony 2.7 for simple use webservices of GLPI.

  • Friday, January 26, 2018
  • by l3-team
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Bundle Symfony 2.7 for simple use webservices of GLPI, (*1)

Installation

use this command :, (*2)

   composer require "l3/client-api-glpi-bundle"

and add the bundle in AppKernel.php file., (*3)

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new L3\Bundle\ClientApiGlpiBundle\L3ClientApiGlpiBundle(),
        );

        // ...
    }

    // ...
}

Configuration

In your application, you should add a service in order to user the functions of this bundle :, (*4)

Pour utiliser le protocole XML-RPC :

parameters:
    # Lien vers le script 'xmlrpc.php' du plugin 'Webservices' :
    webservice_xmlrpc_url: https://assistance.univ-lille3.fr/plugins/webservices/xmlrpc.php

services:
    # Client pour le plugin 'Webservices' de GLPI (protocole XML-RPC) :
    webservice_xmlrpc_client:
        class: L3\Bundle\ClientApiGlpiBundle\Services\PluginWebservicesXmlRpcClient
        arguments: ["%webservice_xmlrpc_url%"]

For use REST protocol :

parameters:
    # Lien vers le script 'rest.php' du plugin 'Webservices' :
    webservice_rest_url: https://assistance.univ-lille3.fr/plugins/webservices/rest.php

services:
    # Client pour le plugin 'Webservices' de GLPI (protocole REST) :
    webservice_rest_client:
        class: L3\Bundle\ClientApiGlpiBundle\Services\PluginWebservicesRestClient
        arguments: ["%webservice_rest_url%"]

Utilisation

        /* initialisation du service */
        $api = $this->get('webservice_rest_client');

        /* login sur l'api (récupération d'une session) */
        $session = $api->login('test_login', 'test_password');

        /* execution d'une requête non authentifiée et sans arguments */
        $test = $api->call('glpi.test', null);

        /* execution d'une requête authentifiée sans arguments */
        $mes_informations = $api->call('glpi.getMyInfo', null, $session);

        /* execution d'une requête authentifiée avec arguments */
        $tickets = $api->call('glpi.listTickets', [
            'limit' => 10,
            'status' => 'all',
            'startdate' => '2016-01-01',
            'enddate' => '2016-02-01'
            ], $session);

        /* logout de l'api (destruction de la session) */
        $api->logout($session);

The Versions

26/01 2018

dev-master

9999999-dev https://github.com/mhetru/ClientApiGlpiBundle

Bundle Symfony 2.7 for simple use webservices of GLPI.

  Sources   Download

(c) Copyright Universite Lille3 - Charles de Gaulle LGPL-3.0-or-later

The Requires

 

by Mathieu Hétru
by Guillaume Fiéni

26/01 2018

1.0.0

1.0.0.0 https://github.com/mhetru/ClientApiGlpiBundle

Bundle Symfony 2.7 for simple use webservices of GLPI.

  Sources   Download

(c) Copyright Universite Lille3 - Charles de Gaulle LGPL-3.0-or-later

The Requires

 

by Mathieu Hétru
by Guillaume Fiéni