Download the PHP package digiaonline/lumen-contentful-sync without Composer

On this page you can find all versions of the php package digiaonline/lumen-contentful-sync. 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 lumen-contentful-sync

lumen-contentful-sync

Test Coverage Status Scrutinizer Code Quality Latest Stable Version Total Downloads License

Introduction

This library provides a powerful abstraction on top of digiaonline/lumen-contentful with the goal of making it easier to synchronize content from Contentful to your application.

Features

Requirements

Installation

  1. Start by adding the library as a dependency to your application:

  2. Copy config/contentfulSync.php to your configuration directory. There is only one mandatory configuration key - content_types. This array should contain a list of all the content model IDs you have in your Contentful space, e.g.:

  3. Extend Digia\Lumen\ContentfulSync\Services\AbstractContentfulSyncService and implement the necessary methods. This is where the logic for how to handle entries and assets will live. See the next section for more details.

  4. Extend Digia\Lumen\ContentfulSync\Providers\AbstractContentfulSyncServiceProvider and implement the registerContentfulSyncServiceBindings method. A typical implementation would look like this:

  5. Register the service provider you just implemented:

  6. Register the console commands in your kernel:

  7. If you intend to use webhooks you will have to configure a route to the controller. In this example we will use both the New Relic and the webhook authentication middlewares, but both are optional:

  8. If you use the webhook authentication middleware you can configure the username and password to expect by adding these to your .env file:

If you need more complicated logic you will have to create your own middleware.

Implementing the service

Since all applications are different it is up to you to define how to handle your entries and assets.

The unimplemented methods give you the asset/entry in question as JSON. You will most likely want to use the SDK to convert these blobs to actual objects:

Usage

Console commands

To synchronize all assets and all configured content types, run the following two commands:

To synchronize all entries for a specific content type (article in this case), run:

To synchronize new entries only, run:

You can add -v or -vv or -vvv to both commands to get more detailed output and a progress bar, e.g.:

New Relic middleware

If you use New Relic to monitor your application you will probably notice that all Contentful webhooks are lumped together as a single transacation (since they all use the same URL/route).

However, if you apply the Digia\Lumen\ContentfulSync\Http\Middleware\NewRelicMiddleware middleware to your route, transactions will be named topic@contentType, e.g. ContentManagement.Entry.publish@article. This allows you to single in on particularly slow webhooks.

Asynchronous processing

In your service provider implementation you can specify an instance of Illuminate\Contracts\Queue\Queue to inject into the service. Unless you've configured a different queue specifically your application will be using the SyncQueue implementation to simulate a completely synchronous queue.

By specifying a different queue instance you can offload all the work the service does to queue workers.

License

MIT


All versions of lumen-contentful-sync with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
jalle19/laravel-lost-interfaces Version ^1.2
laravel/lumen-framework Version ^5.4|^6.0
nordsoftware/lumen-contentful Version ^4.2
nordsoftware/lumen-newrelic Version ^2.0
digiaonline/json-helpers Version ^1.0
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 digiaonline/lumen-contentful-sync contains the following files

Loading the files please wait ....