Download the PHP package gendoria/cruftflake without Composer

On this page you can find all versions of the php package gendoria/cruftflake. 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 cruftflake

CruftFlake

Build Status Scrutinizer Code Quality Code Coverage Downloads Latest Stable Version

Unique ID generator based on Twitter Snowflake, but in PHP with a simple ZeroMQ interface (rather than Thrift).

This is a rewrite of dvomedia/cruftflake. It organizes the code in modules and adds several interfaces, allowing easier extension of other server and configuration mechanisms.

Implementation

The implementation copies Twitter - generating 64 bit IDs.

Has a custom epoch that means it can generate IDs until 2081-09-06 (not the same epoch as Snowflake).

ZooKeeper for config coordination

We use ZooKeeper to store which machine IDs are in use. When a new node starts up for the first time it must be able to contact the ZooKeeper cluster and create a new node. It will look at all the existing nodes and then (if it can't find its own Mac Address) attempt to claim a free one.

I was using Ephemeral nodes for this - similar(ish) to a lock pattern but this had the issue that the node needed to remain connected to ZK throughout its lifetime -- this way it doesn't.

The downside is that potentially the 1024 possible machine IDs will "fill up" and need to be manually pruned.

Running

Installation via composer:

There are several example scripts provided for playing about with. Both require previous composer update.

  1. The generator (the server)

  2. A client, that will generate N IDs and dump to STDOUT

  3. A client, that will ask server for generator status

For client examples to work, server example has to be be running.

Dependencies

Composer requires php-zmq module installed.


All versions of cruftflake with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.9
ext-zmq Version *
psr/log Version ~1.0
symfony/console Version >=2.5
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 gendoria/cruftflake contains the following files

Loading the files please wait ....