Download the PHP package dflydev/identity-generator-dbal without Composer

On this page you can find all versions of the php package dflydev/identity-generator-dbal. 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 identity-generator-dbal

Doctrine DBAL Identity Generator Data Store

Provides a Doctrine DBAL implementation of the identity generator data store. For more information see: dflydev/identity-generator

Requirements

Implementation Details

This simple dflydev/identity-generator Data Store implementation relies on blindly inserting records into a database.

It works under the assumption that if the underlying database has a unique constraint configured for either an identity column or a unique constraint configured for both and identity and mob column an exception will be thrown.

It attempts to capture this exception and determine whether or not there is a fault in the underlying connection or if it was due to a constraint violation. It does this by way of looking for ANSI SQL Error State Code 23000.

Schemas

The following are very naive examples of database schemas that will work with this data store. They may work for you for testing but please do not blindly use them for production.

SQLite

If mobs are not required simply create a table with one column marked as unique.

CREATE TABLE identity (
    identity string(64) unique
);

If mobs are required create a table with two columns and create a unique constraint across both columns.

CREATE TABLE identityWithMob (
    identity string(64),
    mob string(64),
    constraint id unique (identity, mob)
);

Mysql

If mobs are not required simply create a table with one column marked as unique.

CREATE TABLE identity (
    identity varchar(64) unique
);

If mobs are required create a table with two columns and create a unique index across both columns.

CREATE TABLE identityWithMob (
    identity varchar(64),
    mob varchar(64),
    unique index (identity, mob)
);

Usage

use Dflydev\IdentityGenerator\DataStore\Dbal\DataStore;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\DriverManager;

$config = new Configuration();
$connectionParams = array(); // driver specific connection configuration
$connection = DriverManager::getConnection($connectionParams, $config);

// Create a Data Store that does not support a mob.
$dataStore = new DataStore(
    $connection,
    'tableName',
    'identityColumnName'
);

// Create a Data Store that supports a mob.
$dataStoreWithMob = new DataStore(
    $connection,
    'tableName',
    'identityColumnName',
    'mobColumnName'
);

License

This library is licensed under the New BSD License - see the LICENSE file for details.

Community

If you have questions or want to help out, join us in the #dflydev channel on irc.freenode.net.


All versions of identity-generator-dbal with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
dflydev/identity-generator Version 1.*
doctrine/dbal Version >=2.2.3,<2.4-dev
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 dflydev/identity-generator-dbal contains the following files

Loading the files please wait ....