Download the PHP package otar/puffer without Composer
On this page you can find all versions of the php package otar/puffer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package puffer
Puffer for Buffer
Puffer is a Buffer API wrapper library for PHP.
Full documentation coming soon. Meanwhile take a look at Basic Docs sections below. Also dig deeper into the source code, aren't we hackers? :)
Installation
Best way to get Puffer up and running is Composer. Include otar/puffer
in your composer.json requirements:
Alternatively you can grab code from this repository, but you will have to manually install dependencies in the vendor/
directory and take care of PSR-4 autoloading.
Basic Usage
Initialize & Authorize
List Your Profiles
List Pending Updates
Create An Update
Delete Pending Update
Basic Docs
Library is contextually separated into four major classes:
- Puffer
- Used for initialization, auth and making calls to the API.
- Access
user
andconfiguration
object properties for related results from/user
and/info/configuration
. shares()
accepts link as an argument and return it's number of shares through Buffer platform.
- Profiles
- Retrieves all profiles under your account.
- Use
all()
method for returning profiles as an array. - Profiles can be accessed as an array, iterated in the loops or counted using PHP's
count
function. - All profiles are returned as an objects that have their own functionality. See Profile description below.
- Profile
- Accepts profile ID as an argument.
- Profile data can be accessed from the objects' properties or as an associative array.
sent()
method returns already sent updates from this profile andpending()
method returns currently buffered/pending updates.- You can create/buffer an update directly from the
create()
method. Accepts text as an argument.
- Update
- Accepts update ID as an argument.
- Update data can be accessed from the objects' properties or as an associative array.
- Supports these methods:
edit()
,share()
,interactions()
,destroy()
andmoveToTop()
.
It's highly recommended to wrap your Puffer code in the
try/catch
block, it will throw anPuffer\Exception
in case of errors.
Contributing
If you want to contribute to this project first and the foremost you'll need to setup local development environment.
I encourage you to use GruntJS. You'll need to install these NodeJS modules (I'll probably switch to Bower in the future) from the NPM:
- grunt-phplint
- grunt-php-cs-fixer
- grunt-phpunit
- grunt-contrib-watch
- grunt-notify
After installing GruntJS plugins, simply run the grunt
command. It will begin to "watch" modifications in the src/
and tests/
directories and run Grunt tasks as soon as you change something in the *.php
files.
For testing you may prefer to use local PHPUnit installation, please make sure it's updated to the latest version.
First create an issue, fork a repository, make changes and make "pull request".
Final Notes
Best way to reach me is an email or Twitter. See my contact information here: http://otar.me
And to help you finish reading this stuff in a good mood here's a joke:
Thanks for staying tuned! :)