synchronizer
1.0.0
ไลบรารีนี้ทำให้การซิงโครไนซ์ทุกสิ่งเป็นเรื่องง่าย มี API ที่สวยงามและใช้งานง่าย
synchronizer ได้รับการพัฒนาให้เป็นแบ็กเอนด์สำหรับการปรับใช้และเครื่องมือทดสอบ Seabreeze ของเรา
ไลบรารี synchronizer ซ์เป็นเพียงรากฐานที่เป็นนามธรรม แต่มีการใช้งานที่เป็นรูปธรรม:
รวมผู้ให้บริการโหลดอัตโนมัติและใช้คลาส:
namespace Acme MyApplication ;
// To create a synchronizer :
use FlameCore synchronizer Abstract synchronizer ;
use FlameCore synchronizer synchronizer SourceInterface ;
use FlameCore synchronizer synchronizer TargetInterface ;
// To make your project compatible with synchronizer :
use FlameCore synchronizer synchronizer Interface ;
require ' vendor/autoload.php ' ;สร้าง synchronizer ของคุณ:
class Example synchronizer extends Abstract synchronizer
{
/**
* @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 synchronizer SourceInterface $source The source
* @return bool Returns whether the synchronizer supports the source.
*/
public function supportsSource ( synchronizer SourceInterface $ source )
{
return $ source instanceof ExampleSource;
}
/**
* @param synchronizer TargetInterface $target The target
* @return bool Returns whether the synchronizer supports the target.
*/
public function supportsTarget ( synchronizer TargetInterface $ target )
{
return $ target instanceof ExampleTarget;
}
}สร้างแหล่งที่มาและเป้าหมายของคุณ:
class ExampleSource implements synchronizer SourceInterface
{
/**
* @param array $settings The settings
*/
public function __construct ( array $ settings )
{
// Save settings
}
// Your methods...
}
class ExampleTarget implements synchronizer TargetInterface
{
/**
* @param array $settings The settings
*/
public function __construct ( array $ settings )
{
// Save settings
}
// Your methods...
}ทำให้โครงการของคุณเข้ากันได้กับ synchronizer :
class Application
{
protected $ synchronizer ;
public function set synchronizer ( synchronizer Interface $ synchronizer )
{
$ this -> synchronizer = $ synchronizer ;
}
// ...
}ติดตั้ง Composer หากคุณยังไม่มีอยู่ในระบบของคุณ:
$ curl -sS https://getcomposer.org/installer | php
หากต้องการติดตั้งไลบรารี ให้รันคำสั่งต่อไปนี้แล้วคุณจะได้รับเวอร์ชันล่าสุด:
$ php composer.phar require flamecore/ synchronizer
หากคุณต้องการมีส่วนร่วม โปรดดูไฟล์การมีส่วนร่วมก่อน