Download the PHP package raigu/ordered-lists-sync without Composer

On this page you can find all versions of the php package raigu/ordered-lists-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 ordered-lists-sync

Latest Stable Version build codecov Scrutinizer Code Quality Dependents

Library for synchronizing ordered data with the minimum of insert and delete operations.

Optimized for large datasets. Suitable for keeping in sync internal data with outside source. See demos.

Compatibility

Installations

Usage

\Raigu\OrderedListsSynchronization\Synchronization compares source and target lists. It detects which elements have been added or removed in source compared to the target and calls corresponding callback.

The source and target must be of type Iterator.

Output:

Use Cases

Sample use cases with demo code:

Design

The \Raigu\OrderedListsSynchronization\Synchronization has only one purpose. Therefore, it is designed so the instance will be a function, no method is exposed. It is an object because it allows extending it in future (for example adding logging).

Using Iterator type for source and target has several advantages.

First, you can create your own iterators as separate components which are easier to develop and test.

Secondly, more complex problems can be solved. Specially if there are memory constraints.
You can make source or target as generator, as an instance implementing Iterate or IteratorAggregate interface or use Sandard PHP Library (SPL) iterators.

Thirdly, it allows creating components which do not do any job in constructor. This is convenient when using dependency injection or declarative programming.

Development

Setting up

Testing

Algorithm

Algorithm works same way like we use dictionary. If all words are ordered, then we know exactly where some word should be. If we have two dictionaries and start to compare them word by word from start, then we can detect added or removed words.

Example (V denotes current position of the iterator):

A < B => if source is before target, then this means that value is missing in target. If there would be an A in target, then it should be here before B. But it is not. Therefore, it is missing and should be added. Add A and move source cursor:

B = B => if the source and target are equal, then they are sync. Move both cursors.

D > C => if source is after the target, then this means that value has been removed from source. Therefore, remove C and move the cursor forward:

D = D => they are in sync. Move both cursors.


All versions of ordered-lists-sync with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 raigu/ordered-lists-sync contains the following files

Loading the files please wait ....