phpZenfolio is a simple object orientated wrapper for the Zenfolio API, written in PHP.
The intention of this class is to allow PHP application developers quick and easy interaction with the Zenfolio API, without having to worry about the finer details of the API.
Not already a Zenfolio user? Here, have a $5 discount off your first year on me by registering using this code:
The development of phpZenfolio takes place in my free time. If you find phpZenfolio useful and found it has saved you a lot of time, I'd really appreciate it if you bought me a coffee or two.
Note: phpZenfolio 2.0.0 and later is not backwardly compatible with earlier releases.
- PHP >= 5.6.0,
- Guzzle 6 library,
- (optional) PHPUnit, php-coveralls and php-cs-fixer to run tests.
The recommended method of installing phpZenfolio is using Composer. If you have Composer installed, you can install phpZenfolio and all its dependencies from within your project directory:
$ composer require lildude/phpzenfolio
Alternatively, you can add the following to your project's composer.json
:
{
"require": {
"lildude/phpzenfolio": "^2.0"
}
}
.. and then run composer update
from within your project directory.
If you don't have Composer installed, you can download it using:
$ curl -s http://getcomposer.org/installer | php
phpZenfolio
follows the PSR-1, PSR-2 and PSR-4 conventions, which means you can easily use Composer's autoloading to integrate phpZenfolio
into your projects.
<?php
// This file is generated by Composer
require_once 'vendor/autoload.php';
$client = new phpZenfolio\Client('My Cool App/1.0 (http://app.com)'));
$photoset = $client->LoadPhotoSet(12345, 'Level1');
From the $client
object, you have access to all the Zenfolio API methods.
See the docs
directory or http://phpzenfolio.com for more detailed documentation.
phpZenfolio comes with four examples to help get you on your way.
example-popular.php
illustrates how to obtain the 96 most popular galleries and display their title image linking to each individual gallery.example-login.php
illustrates how to login and display the images in your first photoset or collection.example-user.php
illustrates how to display the first 96 public photos of the specified user's first public photoset found.example-create-photoset.php
illustrates how to create a new gallery photoset in the authenticated user's root photoset group, and upload an image to this gallery.
The best way to get help with implementing phpZenfolio into your projects is to open an issue. This allows you to easily search for other issues where others may have asked to the same questions or hit the same problems and if they haven't, your issue will add to the resources available to others at a later date.
Please don't be shy. If you've got a question, problem or are just curious about something, there's a very good chance someone else is too, so go ahead and open an issue and ask.
Found a bug or want to make phpZenfolio even better? Please feel free to open a pull request with your changes, but be sure to check out the CONTRIBUTING.md first for some tips and guidelines. No pull request is too small.
All notable changes to this project are documented in CHANGELOG.md.
All code is licensed under the MIT License and all documentation is licensed under the CC BY 4.0 license.