Download the PHP package lomocoin/php-mongo-transaction without Composer

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

PHP-Mongo-Transaction

Overview

Do you miss transaction in RDBMS while using MongoDB? You are not alone.

A news said that MongoDB will support ACID in the future, but what if we need it now?

Well, PHP-Mongo-Transaction provides a simply basic transaction feature similar to RDBMS.

The flow is simple, just begin a transaction, do something, then commit or rollback.

The concept to achieve this is also simple: build a record collection in MongoDB to trace the modification of the data, and recover when rollback.

That is, once a transaction wants to rollback, it will:

To achieve this, this lib wraps the basic insertOne, updateOne, deleteOne functions which provided by MongoDB Driver.

Have a look at #Usage part of this document to see how easy to use it.

Limitation

  1. We assume the database just works, so if there is a database failure, the transaction may not be rollback correctly and will be leaving as ongoing state. You may need to have a cron job to detect if everything works fine, and investigate manually when something goes wrong. If everything goes smoothly, the state of transactions should be either commit or rollback, except the real init and ongoing ones.

  2. We can't handle concurrency issues at the current stage. It's too complicated to ensure data consist under the concurrent scenario. We recommend that you consider using a simple lock mechanism to avoid two transactions that may write to the same record happen at the same time, or adapting a message queue system to maintain the order of transaction execution.

Roadmap

Notice

You can use Persistable class with this library, but do not do any magic in the bsonSerialize and bsonUnserialize, e.g: auto update the "last modified date".

Any magic in these two functions will definitely destroy the valid data state

Install

Usage

1. Require autoload.php file

2. Create transaction object

3. Make the change

3.1 insert

3.2 update

3.3 delete

4. Commit or Rollback

Contributors

Shenghan Chen | viest

License

Apache License 2.0


All versions of php-mongo-transaction with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
mongodb/mongodb Version >=1.1
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 lomocoin/php-mongo-transaction contains the following files

Loading the files please wait ....