2017 © Pedro Peláez
 

library synchronizer

Synchronize all kinds of things

image

flamecore/synchronizer

Synchronize all kinds of things

  • Friday, October 27, 2017
  • by secondtruth
  • Repository
  • 8 Watchers
  • 5 Stars
  • 7,881 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 10 % Grown

The README.md

FlameCore Synchronizer

Latest Stable Scrutinizer License, (*1)

This library makes it easy to synchronize all kinds of things. It features a beautiful and easy to use API., (*2)

Synchronizer was developed as backend for our deployment and testing tool Seabreeze., (*3)

Implementations

The Synchronizer library is just an abstract foundation. But concrete implementations are available:, (*4)

Usage

Include the vendor autoloader and use the classes:, (*5)

namespace Acme\MyApplication;

// To create a Synchronizer:
use FlameCore\Synchronizer\AbstractSynchronizer;
use FlameCore\Synchronizer\SynchronizerSourceInterface;
use FlameCore\Synchronizer\SynchronizerTargetInterface;

// To make your project compatible with Synchronizer:
use FlameCore\Synchronizer\SynchronizerInterface;

require 'vendor/autoload.php';

Create your Synchronizer:, (*6)

class ExampleSynchronizer extends AbstractSynchronizer
{
    /**
     * @param bool $preserve Preserve obsolete objects
     * @return bool Returns whether the synchronization succeeded.
     */
    public function synchronize($preserve = true)
    {
        // Do the sync magic

        return true;
    }

    /**
     * @param SynchronizerSourceInterface $source The source
     * @return bool Returns whether the synchronizer supports the source.
     */
    public function supportsSource(SynchronizerSourceInterface $source)
    {
        return $source instanceof ExampleSource;
    }

    /**
     * @param SynchronizerTargetInterface $target The target
     * @return bool Returns whether the synchronizer supports the target.
     */
    public function supportsTarget(SynchronizerTargetInterface $target)
    {
        return $target instanceof ExampleTarget;
    }
}

Create your Source and Target:, (*7)

class ExampleSource implements SynchronizerSourceInterface
{
    /**
     * @param array $settings The settings
     */
    public function __construct(array $settings)
    {
        // Save settings
    }

    // Your methods...
}

class ExampleTarget implements SynchronizerTargetInterface
{
    /**
     * @param array $settings The settings
     */
    public function __construct(array $settings)
    {
        // Save settings
    }

    // Your methods...
}

Make your project compatible with Synchronizer:, (*8)

class Application
{
    protected $synchronizer;

    public function setSynchronizer(SynchronizerInterface $synchronizer)
    {
        $this->synchronizer = $synchronizer;
    }

    // ...
}

Installation

Install via Composer

Install Composer if you don't already have it present on your system:, (*9)

$ curl -sS https://getcomposer.org/installer | php

To install the library, run the following command and you will get the latest version:, (*10)

$ php composer.phar require flamecore/synchronizer

Requirements

  • You must have at least PHP version 5.4 installed on your system.

Contributing

If you'd like to contribute, please see the CONTRIBUTING file first., (*11)

The Versions

27/10 2017

dev-master

9999999-dev http://www.flamecore.org

Synchronize all kinds of things

  Sources   Download

MIT ISC

The Requires

 

sync synchronization

20/07 2015

v0.1.0

0.1.0.0 http://www.flamecore.org

Synchronize all kinds of things

  Sources   Download

ISC

The Requires

 

synchronization