Download the PHP package gajus/fuss without Composer

On this page you can find all versions of the php package gajus/fuss. 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 fuss

Fuss

Build Status Coverage Status Latest Stable Version License

The Facebook SDK for PHP provides an interface to the Graph API. The main difference between the official PHP SDK and Fuss is the API.

Reinventing the Wheel

The original facebook/facebook-php-sdk is lacking separation of concerns. The facebook/facebook-php-sdk-v4 is a big step forward. Nonetheless, it came with its own evils that I could not live with (e.g. use of stateful programming and globals). The API itself is designed to cover all uses cases, which is expected of the official SDK, though not necessary needed for an average Facebook app. Fuss is trading some of the functionality in favor of a more intuitive API.

I am looking forward to hearing feedback either via [email protected] or in the issues section.

Fuss.js

Fuss.js is an extension of Fuss. It is designed for handling Facebook user authorization.

Everything Together

The following example is meant to cover the most common use scenario for Fuss. If you need further guidance, this document contains description of every Fuss SDK use-case and method.

Initializing App

You will need to have configured a Facebook App, which you can obtain from the App Dashboard.

Initialize the SDK with your app ID and secret:

In the original Facebook PHP SDK, FacebookSession::setDefaultApplication is used to set the default app credentials statically, making them accessible for future calls without needing to reference an equivalent of the Gajus\Fuss\App instance.

Options

The options are accepted at the time of constructing the app:

Gajus\Fuss\App::OPTION_VERSION

This option specifies the default version of the Graph API to use, e.g.

The above will produce a request against https://graph.facebook.com/v2.1/app URL.

You can overwrite the default version at the time of making a request:

Excluding the version from the request path and not setting the Gajus\Fuss\App::OPTION_VERSION will make all request URLs version-less, e.g.

The above will produce a request against https://graph.facebook.com/app URL.

Gajus\Fuss\App::OPTION_FORCE_COOKIE (experimental)

If enabled (default is disabled), Fuss SDK will attempt to set a cookie on clients that have explicitly opted not to accept third-party cookies. This is done by redirecting the user to the domain that needs to set the cookie and then redirecting user back to the Facebook Page Tab or Canvas URL. For more details, see the original issue.

Get the Signed Request

The signed request is encapsulated in the Gajus\Fuss\SignedRequest entity. It is available via an instance of App when either of the following is true:

You might have obtained the signed request via the JavaScript SDK (e.g. FB.getLoginStatus). In which case, you can share it with the app:

The sign request is stored in the user session and can be retrieved on the following request.

Signed Request Data

A signed request contains some additional fields of information, even before permissions have been requested:

Get the User Access Token

The Gajus\Fuss\AccessToken is available when either of the following is true:

You can build an AccessToken if you have it (e.g. stored in the database):

Extend The Access Token

Access tokens generated via web login are short-lived tokens, but you can upgrade them to long-lived tokens.

To check if the access token is long-lived:

To extend a short-lived access token:

To know when does the access token expire:

Take a string copy to store the access token for later use:

Initializing User

In order to make calls on behalf of a user, you need to create User entity with a valid access token:

Upon instantiating the User object, the access token is used to fetch information about the user.

You can update user access token:

Making Graph API calls

An API call can be made using either Gajus\Fuss\App or Gajus\Fuss\User context. If use App context, then app access token is used; is use User context, then user access token is used.

Page Tab

When an app is loaded in the page tab, the signed request contains information about the page itself. This information is abstracted using the PageTab class:

The abstracted data is accessed via the following methods:

Installation

If you are using Composer as a package manager, add the following dependency to the composer.json and run composer with the install parameter.

Tests

The tests are automatically run using the Travis-CI and secured app credentials.

To run the tests locally,

  1. Pull the repository using the Composer.
  2. Create tests/config.php from tests/config.php.dist and edit to add your credentials.
  3. Execute the test script using the PHPUnit.

You should be using a sandboxed application for running the tests.


All versions of fuss with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
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 gajus/fuss contains the following files

Loading the files please wait ....