Download the PHP package extraton/php-ton-client without Composer

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

Extraton, PHP TON Client

php7.4, Ubuntu 20.04 php7.4, macOS latest Total Downloads Chat on Telegram

Extraton is a simple and powerful php-library to binding with the TON SDK. It allows to interact with FreeTON blockchain. It has the rich abilities:

Requirements

Installation

To install it via Composer simply run:

To automatically download the TON SDK library add the following lines to your project composer.json file:

The library will be downloaded after the commands or are called in your project root. To forced download the TON SDK library for your operating system, run the following command:

The TON SDK library will be installed to the directory .

Configuring

Simple TonClient instantiation:

It uses the default configuration:

You can start using a simple configuration for TonClient:

All configuration options are available here. After instantiate the TonClient will automatically detect operating system and path to the TON SDK library:

Default path: YOUR_PROJECT_ROOT/vendor/extraton/bin/tonclient.*. Also you can specify path by the following lines of code:

Basic usage

Building queries

Use special classes to easily build queries:

You can add your own query class that implements the interface \Extraton\TonClient\Entity\Net\QueryInterface or extends the class \Extraton\TonClient\Entity\Net\AbstractQuery.

The following constants are available for filters and directions:

Advanced usage

Use the following example to build an application for monitoring events coming from the blockchain network:

Detailed example

Examples

Please see Integration tests for more information on detailed usage.

⚠️ Warning

We use experemental PHP extension FFI. This extension allows the loading of shared libraries, calling of C functions and accessing of C data structures in pure PHP. This is the only one possible way to async integrate with the TON SDK library.

Please read the official warnings from the developers of php:

Warning This extension is EXPERIMENTAL. The behaviour of this extension including the names of its functions and any other documentation surrounding this extension may change without notice in a future release of PHP. This extension should be used at your own risk.

FFI Introduction

Although this works, this functionality is not supported on all libffi platforms, is not efficient and leaks resources by the end of request.

PHP Callbacks

We have not detected memory leaks. But sometimes we caught segmentation faults during testing. 🙏 Hopefully the FFI extension will be stabilized in future versions of php.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

Run the following command to run unit tests:

... and integration tests:

Some tests use TON SDK methods that listen for asynchronous events. Data from these events is saved to the directory /tests/Integration/artifacts/. This way you can analyze them in detail. For example, the test \Extraton\Tests\Integration\TonClient\ProcessingTest::testProcessMessageWithEvents uses the call of method \Extraton\TonClient\Processing::processMessage. Events received during generator iteration are saved in a file.

Code Quality

We use PHPStan and PHP Coding Standards Fixer to control code quality. Run the following commands to analyze the code and fix code style errors:

Contributing

Please see CONTRIBUTING for details.

Notice

If you have any issues, just feel free and open it in this repository, thx!

Credits

License

The Apache License Version 2.0. Please see License File for more information.


All versions of php-ton-client with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
ext-ffi Version *
ext-json Version *
ext-zlib Version *
guzzlehttp/promises Version ^1.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 extraton/php-ton-client contains the following files

Loading the files please wait ....