Download the PHP package anahkiasen/flickering without Composer

On this page you can find all versions of the php package anahkiasen/flickering. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flickering

Flickering

Build Status Latest Stable Version Total Downloads Scrutinizer Quality Score Code Coverage Dependency Status Support via Gittip

Flickering is a next-generation PHP API for the Flickr photos sharing social network. It's a work in progress but it already works so don't worry about that.

You can get it on Composer, in order to do so just run composer require anahkiasen/flickering.

After that add the ServiceProvider to the providers array in app/config/app.php

If you want to use the facade, also add that to app.php:

If you want to use store the api keys/secret in the config, publish the config files.

$ php artisan config:publish anahkiasen/flickering

Using Flickering

Creating a new instance

To use Flickering you will of course need an API key from Flickr, if you don't already have on you get can one here, they're nice and all so they'll give you one for free. Once you have that, set it in Flickering's config/config.php file. Or if you don't want/can, you can always pass your credentials to the constructor.

To start working with Flickering, create a new instance of it like the example underneath. If you set your API credentials in the config file, you don't need to pass any arguments to the constructor as it will automatically fetch your key and secret key from the config files.

If working with instances is not your thing, Flickering also uses Illuminate's Facade component to provide a static interface to all its methods. You can create a new static instance of Flickering like this. Arguments are facultative if config file is set, same as above.

Before doing anything with the Flickr api, you have to call the handshake (once).

Calling methods on the Flickr API

Flickering provides several ways to make calls to the API. They differ in their level of syntaxic elegance and the level of control you get on the API response.

The most basic (but also the most powerful) way is to simply call the ->callMethod on your Flickering instance :

Alternatively, Flickering is set up with a bunch of smart aliases for common methods, so to the exact same thing as the example above you can also do the following.

Note that the arguments for each smart alias are mapped from the list of arguments provided by the Flickr API, so in the example above we're actually calling the flickr.people.getPhotos method, meaning the number and order of its arguments can be found in the API docs.

Since changing that order of arguments would be messy, smart alias are mostly to be used when you want quick calls to method with few arguments — if you have to set every goddamn one of the method's arguments, it's recommanded to use callMethod instead — for the simple reason that with an associative array at least you'll always plainly see which argument maps to what.

Getting results from a call to the API

Now what we've just seen is all pretty basic stuff, and doesn't differ from most Flickr API implementations out there. Here is where stuff gets interesting. When you use one of the methods above to make a call on the API you don't directly get the results as a raw JSON string (although you can). By default, Flickering will return a Method object from which you can do various interesting stuff.

First, you can manipulate the results after the initial call, either via ->setParameter or via the elegant aliases of Flickering.

From there, Method has three methods for you to get your results from : ->getRawResponse, ->getReponse and ->getResults.

The Results class leverages the power behind Underscore.php to create a live repository of your results, allowing you to easily manipulate them and fetch deeply nested informations from them. You can get a glimpse of the manipulation power brought by Underscore in the Arrays docs and I also recommand quickly checking out what Underscore Repositories are and what they can do.

The whole Flickering > Method > Request process is bypassable via the matching methods on the Flickering instance : ->getRawResponseOf, ->getResponseOf and ->getResultsOf. So the two examples below do the exact same thing, just faster :

Authentified calls

As the Flickr API is now powered by OAuth, making authentified requests to it will require a permission from the user. In order to speed up the process, Flickering has out-of-the-box an Opauth Strategy set up.

If you're using Flickering with your favorite framework, use it's Router to leverage Flickering's getOpauth and getOpauthCallback methods. The first one must be returned in the first two steps of the process, the second one must just be present somewhere in your callback page (can be the same page you'll do your calls from once the user has given permission).

Here is an example implementation with the Laravel framework :

If you're using any framework and just want to make some requests on a plain old PHP page, an example implementation via a basic router and .htaccess is demonstrated in the example folder of the repository.

Working with the User

Once the user has been logged in you can get its informations via the Flickering::getUser() method which will return an User object containing the various informations sent back by the OAuth process. Here are some of the methods available :

Moreover, Flickering has a isAuthentified method for you to use that will check whether OAuth credentials are available or not.

That's all folks !

Don't forget to post any issue/bug/request in the Github Issues.


All versions of flickering with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
anahkiasen/underscore-php Version ~1.2
illuminate/cache Version ~4.0
illuminate/config Version ~4.0
illuminate/container Version ~4.0
illuminate/http Version ~4.0
illuminate/support Version ~4.0
opauth/flickr Version ~1.0
themattharris/tmhoauth Version ~0.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package anahkiasen/flickering contains the following files

Loading the files please wait ....