1. Go to this page and download the library: Download flamecore/synchronizer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
flamecore / synchronizer example snippets
namespaceAcme\MyApplication;
// To create a Synchronizer:useFlameCore\Synchronizer\AbstractSynchronizer;
useFlameCore\Synchronizer\SynchronizerSourceInterface;
useFlameCore\Synchronizer\SynchronizerTargetInterface;
// To make your project compatible with Synchronizer:useFlameCore\Synchronizer\SynchronizerInterface;
classExampleSynchronizerextendsAbstractSynchronizer{
/**
* @param bool $preserve Preserve obsolete objects
* @return bool Returns whether the synchronization succeeded.
*/publicfunctionsynchronize($preserve = true){
// Do the sync magicreturntrue;
}
/**
* @param SynchronizerSourceInterface $source The source
* @return bool Returns whether the synchronizer supports the source.
*/publicfunctionsupportsSource(SynchronizerSourceInterface $source){
return $source instanceof ExampleSource;
}
/**
* @param SynchronizerTargetInterface $target The target
* @return bool Returns whether the synchronizer supports the target.
*/publicfunctionsupportsTarget(SynchronizerTargetInterface $target){
return $target instanceof ExampleTarget;
}
}
classExampleSourceimplementsSynchronizerSourceInterface{
/**
* @param array $settings The settings
*/publicfunction__construct(array $settings){
// Save settings
}
// Your methods...
}
classExampleTargetimplementsSynchronizerTargetInterface{
/**
* @param array $settings The settings
*/publicfunction__construct(array $settings){
// Save settings
}
// Your methods...
}