2017 © Pedro Peláez
 

library plurio-net-php

PHP library simplifying access to the database of cultural events in Luxembourg and the greater region

image

ffraenz/plurio-net-php

PHP library simplifying access to the database of cultural events in Luxembourg and the greater region

  • Monday, April 16, 2018
  • by ffraenz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

plurio-net-php

Packagist version MIT license, (*1)

This PHP library tries to simplify access to the XML interface of Plurio.net, the database of cultural events in Luxembourg and the greater region., (*2)

Features

  • Fetches events from the Plurio.net XML interface
  • Verifies data with XML schemas
  • Calculates event occurrences and schedules from date ranges, date exclusions, timings and timing exceptions
  • Replaces dates and times with DateTime objects configured with the correct timezone
  • Injects category and function data from different sources
  • Provides a simple interface and consistent data

Example

Use composer to install this library as a dependency., (*3)

$ composer require ffraenz/plurio-net-php

To create an Export instance, you need to provide an export url where the XML data gets fetched from. To get access to the XML interface, contact Plurio.net., (*4)

$exportUrl = 'PLURIO_NET_EXPORT_URL_HERE';
$export = new FFraenz\PlurioNet\Export($exportUrl);
$events = $export->getEvents();

The resulting PHP array $events is structured similarly to the following data. Note, that the data below is shortened and ids are leetified., (*5)

[
    "id" => 1337,
    "name" => "Spaghettisfest 2018",
    "subtitles" => [
        "Since 1985 in Eppeldorf"
    ],
    "description" => [
        "lu" => "S\u00e4it iwwer 30 Joer versammelen sech...",
        "en" => "For over 30 years hungry people gather..."
    ],
    "location" => [
        "id" => 1337,
        "name" => "Pompjeesbau Eppelduerf",
        "street" => "Faubourg 14",
        "postcode" => "L-9365",
        "locality" => "Eppeldorf",
        "localityId" => "L1337"
    ],
    "contacts" => [
        [
            "type" => "url",
            "value" => "http://spaghettisfest.lu"
        ],
        [
            "type" => "emailAddress",
            "value" => "contact@eppelduerferjugend.lu",
            "function" => [
                "id" => "1337",
                "description" => [
                    "de" => "Kontakt",
                    "fr" => "Contact"
                ]
            ]
        ],
        [
            "type" => "phoneNumber",
            "subtype" => "mobile",
            "value" => "00352123456789",
            "function" => [
                "id" => "1337",
                "description" => [
                    "de" => "Kontakt",
                    "fr" => "Contact"
                ]
            ]
        ]
    ],
    "occurrences" => [
        [
            "allDay" => false,
            "time" => new DateTime("2018-08-15 12:00:00"),
            "endTime" => new DateTime("2018-08-16 03:00:00"),
            "schedule" => [
                [
                    "time" => new DateTime("2018-08-15 12:00:00"),
                    "endTime" => new DateTime("2018-08-15 14:00:00"),
                    "description" => "Spaghetti & Bar"
                ],
                [
                    "time" => new DateTime("2018-08-15 18:00:00"),
                    "endTime" => new DateTime("2018-08-15 22:00:00"),
                    "description" => "Spaghetti & Bar"
                ],
                [
                    "time" => new DateTime("2018-08-15 22:00:00"),
                    "endTime" => new DateTime("2018-08-16 03:00:00"),
                    "description" => "Bar"
                ]
            ]
        ]
    ],
    "pricing" => [
        [
            "value" => 12,
            "description" => "Spaghetti All-You-Can-Eat"
        ],
        [
            "value" => 9,
            "description" => "Spaghetti Small"
        ]
    ],
    "categories" => [
        [
            "id" => 1337,
            "name" => [
                "de" => "Gastronomie",
                "en" => "Gastronomy",
                "fr" => "Gastronomie"
            ],
            "parentName" => [
                "de" => "Freizeit",
                "en" => "Leisure",
                "fr" => "Loisirs"
            ]
        ]
    ],
    "organisations" => [
        [
            "id" => "1337",
            "name" => "Eppelduerfer Jugend",
            "function" => [
                "id" => "1337",
                "description" => [
                    "de" => "Organisation",
                    "fr" => "Organisation"
                ]
            ]
        ]
    ],
    "images" => [
        [
            "id" => 1337,
            "url" => "http://example.com/image.png",
            "title" => "Image title",
            "alt" => "Image alt",
            "position" => "default"
        ]
    ]
];

The Versions

16/04 2018

dev-master

9999999-dev https://github.com/ffraenz/plurio-net-php

PHP library simplifying access to the database of cultural events in Luxembourg and the greater region

  Sources   Download

MIT

The Requires

  • php >=5.6

 

events luxembourg plurio.net

14/04 2018

v0.0.1

0.0.1.0 https://github.com/ffraenz/plurio-net-php

Abstraction layer for the XML interface of Plurio.net

  Sources   Download

MIT

The Requires

  • php >=5.6

 

events luxembourg plurio.net