2017 © Pedro Peláez
 

library viadutoo

image

umich-its-tl/viadutoo

  • Wednesday, March 7, 2018
  • by lsloan
  • Repository
  • 8 Watchers
  • 0 Stars
  • 67 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

Viadutoo

About

Viadutoo (From the Portuguese word for viaduct, "viaduto". Pronounced as "vee-uh-DOO-too" or in IPA: [vi.a.dˈu.tʊ].) is a kind of caching proxy endpoint for Caliper event data. As a proxy, its purpose is to accept Caliper event payloads from sensors as quickly as possible, then resend them to a preconfigured upstream endpoint. If the upstream endpoint is unable to accept the event payload for some reason, the caching feature will store the event data in a database for future processing., (*1)

Requirements

  • PHP 5.4 or greater
  • One of the following PHP HTTP client extensions:
    • curl (usually this is already included with PHP interpreter)
    • pecl_http
  • Composer (not strictly required, but highly recommended)
    • For installation details, see: https://getcomposer.org/download/

Usage

  • Update the composer.json file in the root directory of your project as follows:, (*2)

    • The require section should include the following:, (*3)

      {
          "require": {
              "php": ">=5.4",
              "umich-its-tl/viadutoo": "1.1.0"
          }
      }
      
    • If a repository is not specified, Composer will install Viadutoo from Packagist (https://packagist.org/packages/umich-its-tl/viadutoo). However, to specify a GitHub repository as the source instead, include the following in the repositories section:, (*4)

      {
          "repositories": [
              {
                  "type": "vcs",
                  "url": "https://github.com/tl-its-umich-edu/viadutoo"
              }
          ]
      }
      

      This is one way to specify your own repository, for example, if you want to modify your own fork of Viadutoo. You would specify the URL of your own repository., (*5)

  • Use Composer to install the package with the command:, (*6)

    composer install
    

    Composer will create the vendor directory to hold the package and other related information., (*7)

  • Composer will create PHP classes to help you load Viadutoo (and any other packages it has loaded) into your application. In your PHP code, use it like:, (*8)

    /*
     * If necessary, use set_include_path() to ensure the directory
     * containing the "vendor" directory is in the PHP include path.
     */
    require_once 'vendor/autoload.php';  // Composer loader for Viadutoo, etc.
    
  • Initialize and use Viadutoo in your PHP code like this:, (*9)

    $proxy = (new MessageProxy())
        ->setTransportInterface(
            (new CurlTransport()) // Recommended transport with cURL, supports Basic Auth and OAuth 1.0
                ->setAuthZType(CurlTransport::AUTHZ_TYPE_OAUTH1, 'OAuth 1.0 key', 'OAuth 1.0 secret') // Optional authZ
        )
        ->setEndpointUrl('http://example.com/endpoint')
        ->setTimeoutSeconds(10)
        ->setAutostoreOnSendFailure(true)
        ->setStorageInterface(
            new MysqlStorage(
                'mysql.example.org', 'dbUser', 'dbPassword',
                'dbName', 'viadutoo_events'
            )
        );
    // ...
    try {
        $proxy
            ->setHeaders($headers)
            ->setBody($jsonBody)
            ->send();
    } catch (Exception $exception) {
        error_log($exception->getMessage());
    }
    

    For a more detailed example of using Viadutoo in an application, see public/index.php., (*10)

Example

An example application is included in the public directory. Execute it as:, (*11)

cd public
php -S 127.0.0.1:8989

The application is written to send all data to http://lti.tools/caliper/event?key=viadutoo. Simply configure a Caliper sensor to send events to http://127.0.0.1:8989/ and they will be sent on to the lti.tools endpoint., (*12)

The Versions

07/03 2018

1.0.0

1.0.0.0

  Sources   Download

16/06 2016

dev-TLCALIPER-89

dev-TLCALIPER-89

Viadutoo: caching proxy endpoint for Caliper event data

  Sources   Download

proprietary

The Requires

 

The Development Requires

by Lance E Sloan

viadutoo

13/06 2016

dev-master

9999999-dev

Viadutoo: caching proxy endpoint for Caliper event data

  Sources   Download

proprietary

The Requires

 

by Lance E Sloan

viadutoo

13/06 2016

1.1.0

1.1.0.0

Viadutoo: caching proxy endpoint for Caliper event data

  Sources   Download

proprietary

The Requires

 

by Lance E Sloan

viadutoo

02/06 2016

dev-TLCALIPER-77

dev-TLCALIPER-77

Viadutoo: caching proxy endpoint for Caliper event data

  Sources   Download

proprietary

The Requires

 

by Lance E Sloan

viadutoo

22/01 2016

1.0.2

1.0.2.0

Viadutoo: caching proxy endpoint for Caliper event data

  Sources   Download

proprietary

The Requires

  • php >=5.4

 

by Lance E Sloan

viadutoo

22/01 2016

dev-TLCALIPER-38

dev-TLCALIPER-38

Viadutoo: caching proxy endpoint for Caliper event data

  Sources   Download

proprietary

The Requires

  • php >=5.4

 

by Lance E Sloan

viadutoo

21/01 2016

1.0.1

1.0.1.0

Viadutoo: caching proxy endpoint for Caliper event data

  Sources   Download

proprietary

The Requires

  • php >=5.4

 

by Lance E Sloan

viadutoo

14/01 2016

dev-TLCALIPER-11

dev-TLCALIPER-11

Viadutoo: caching proxy endpoint for Caliper event data

  Sources   Download

proprietary

The Requires

  • php >=5.4

 

by Lance E Sloan

viadutoo

08/01 2016

dev-TLCALIPER-30

dev-TLCALIPER-30

Viadutoo: caching proxy endpoint for Caliper event data

  Sources   Download

proprietary

The Requires

  • php >=5.4

 

by Lance E Sloan

viadutoo