Download the PHP package vhnnnbj/laravel-rt without Composer

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

laravel-reset-transaction

中文文档

RT (reset transaction) mode can be as distributed transaction for call remote api service

Overview

Install the version between laravel5.5-laravel8, and then install the composer package

First create order, storage, account 3 mysql database instances, 3 controllers, 3 models, add testsuite Transaction to phpunit.xml, and then start the web server. These operations only need to execute the following commands to complete all

Open another terminal and start the web server with port 8001

Finally run the test script ./vendor/bin/phpunit --testsuite=Transaction --filter=ServiceTest The running results are shown below, and the 3 examples have passed the test.

Feature

  1. Out of the box, no need to refactor the code of the original project, consistent with the mysql transaction writing, simple and easy to use.
  2. Comply with the two-stage commit protocol, which is a strong consistency transaction. Under high concurrency, it supports the isolation level of read committed transactions, and the data consistency is 100% close to mysql xa.
  3. Since the transaction is split into multiple and become several small transactions, the stress test finds that there are fewer deadlocks than mysql ordinary transactions.
  4. Support distributed transaction nesting, consistent with savepoint.
  5. Support to avoid the problem of dirty data caused by the concurrency of different business codes.
  6. The service-oriented interface of the http protocol is supported by default. If you want to support other protocols, you need to rewrite the middleware.
  7. Support for nested distributed transactions of sub-services (world's first).
  8. Support services, mixed nesting of local transactions and distributed transactions (the world's first)
  9. Support 3 retries over time, repeated requests to ensure idempotence
  10. Support go, java language (under development)

Principle

You will know the operation of archiving and reading files after watching the movie "Edge of Tomorrow". This distributed transaction component imitates the principle of the "Edge of Tomorrow" movie. Reset means to reset, that is, read the file at the beginning of each request for the basic service, and then continue the subsequent operations. At the end, all operations are rolled back and archived, and finally One step commit successfully executes all the archives. The whole process is to comply with the two-stage submission agreement, first prepare, and finally commit.

Taking the scenario where user A transfers 100 yuan to user B's China Merchants Bank account with a China Merchants Bank card as an example, the following flowchart is drawn. After the reset distributed transaction is turned on in the right picture, there are 4 more requests than the left picture. What request 4 does is what was done before request 1-3, and then come back to the original point and start again, finally submit the transaction, and end the transfer process.

Support sub-service nested distributed transaction (world's first)

A world-class problem: A service commit->B service rollback->C service commit->D service commit sql. In this scenario, ABCD are all different databases. How can I make A service submit B service and roll back? What about all operations of the C service and D service?

Neither seata nor go-dtm can solve this problem. The key point to solve the problem is that the C service and D service must be submitted falsely, and cannot be submitted truly. If they are submitted, they will be unable to recover.

What are the benefits of implementing nested distributed transactions that support sub-services? You can make A service a service of others, and it can be nested in any layer of the link arbitrarily. Breaking the previous shackles: Service A must be a root service, and if Service A is to become a sub-service, the code must be changed. If the RT mode is used, service A can become someone else's service without modifying the code.

How to use

Take the vendor/windawake/laravel-reset-transaction/tests/ServiceTest.php file as an example

Contact

Scan code into wechat group. I hope that more friends will learn from each other and study the knowledge of distributed transactions together.


All versions of laravel-rt with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1|^8.0
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 vhnnnbj/laravel-rt contains the following files

Loading the files please wait ....