facebookarchive / facebook-instant-articles-sdk-php

The Facebook Instant Articles SDK for PHP provides a native interface for creating and publishing Instant Articles.
https://instantarticles.fb.com/
Other
232 stars 148 forks source link

Facebook Instant Articles PHP SDK

CircleCI Latest Stable Version

🚨 Important Note

⚠️ Instant Articles will not be available starting April 20, 2023

All related developer tools will be archived.


The Facebook Instant Articles SDK for PHP provides a native interface for creating and publishing Instant Articles. The SDK enables developers to more easily integrate Instant Articles into content management systems and in turn enables journalist and publishers to easily publish Instant Articles.

The SDK consists of three components:

Quick Start

The Facebook Instant Articles PHP SDK can be installed with the Composer dependency manager by running this command on your project's root folder:

$ composer require facebook/facebook-instant-articles-sdk-php

After the installation, you can include the auto loader script in your source with:

require_once 'vendor/autoload.php';

Official Documentation

You can find examples on how to use the different components of this SDK to integrate it with your CMS in the Getting Started section of the documentation.

Contributing

Clone the repository

$ git clone https://github.com/facebook/facebook-instant-articles-sdk-php.git

Composer is a prerequisite for testing and developing. Install composer globally, then install project dependencies by running this command in the project's root directory:

$ composer install

To run the tests:

$ composer test

To fix and check for coding style issues:

$ composer cs

Extra lazy? Run

$ composer all

to fix and check for coding style issues, and run the tests.

If you change structure, paths, namespaces, etc., make sure you run the autoload generator:

$ composer dump-autoload

For us to accept contributions you will have to first sign the Contributor License Agreement. Please see CONTRIBUTING for details.


Testing with Docker

We have provide a Docker environment to ensure a consistent testing & development environment.

Use docker-compose run composer composer install to get started.

Troubleshooting

If you are encountering problems, the following tips may help in troubleshooting issues:

License

Please see the license file for more information.

Legal