draugiem / draugiem-php-sdk
Draugiem.lv API PHP library
Installs: 22 886
Dependents: 1
Suggesters: 0
Security: 0
Stars: 12
Watchers: 11
Forks: 0
Open Issues: 2
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-11-09 16:32:24 UTC
README
Draugiem.lv API library for PHP
To make application development faster and easier, we've created a PHP library that performs API calls and automatically converts the requested data to the PHP data structures. PHP library can be used both for integrated applications and draugiem.lv Passport applications.
The library requires PHP5 environment and uses PHP session mechanism for storing user data during sessions. To be able to perform API calls, PHP configuration you have to enable access to HTTP URLs for file_get_contents function (enable allow_url_fopen setting in PHP configuration).
In order to use PHP library, you have to include file DraugiemApi.php in your application.
Usage
Check examples for more on how to use the API library.
require 'DraugiemApi.php'; $draugiem = new DraugiemApi( 'YOUR_APP_ID', 'YOUR_APP_KEY' ); session_start(); $draugiem->cookieFix(); // Iframe cookie workaround for IE and Safari $session = $draugiem->getSession(); if ($session) { $user = $draugiem->getUserData(); //Get user info }
Usage with composer
-
Add this package to your composer.json
"draugiem/draugiem-php-sdk": "1.3.*"
-
Update composer.json packages
composer update
-
Use library as shown in examples
$draugiem = new DraugiemApi( 'YOUR_APP_ID', 'YOUR_APP_KEY' );