Download the PHP package chatflowphp/core without Composer

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

ChatFlow Core

CI PHPStan PHPUnit

chatflowphp/core is the platform-neutral runtime for chat bots. It turns every conversation into a state machine: scenes are states, an inbound update is one tick, and navigating between screens or dialog steps is a transition.

The core owns routing, middleware, scenes, sessions, validation, the normalized inbound event model and platform-neutral outgoing views. It does not talk to Telegram or any other transport; adapters such as chatflowphp/telegram do.

Documentation starts at docs/index.md. Coming from 1.x? Read docs/upgrade-from-1.x.md.

Why a State Machine

Chat conversations are long-lived and the process handling them is not. Users press buttons on old messages, send /start in the middle of a dialog, click twice, answer with text where a button was expected. The only reliable way to handle this is to know exactly where every user is and to let input move them only along defined paths.

chatflowphp/automata provides that machine. The core maps it to bot concepts:

Bot practice Runtime behaviour
The user is "on a screen" or "in a dialog step" The current scene is stored in a snapshot per conversation
The same text means different things on different screens Input always goes to the current scene
Entering a screen renders it, leaving it cleans up onEnter() and onLeave() hooks
The screen map in the bot spec An optional transition table with guards
Back and cancel buttons Scene history
"On validation error the user stays where they were" A failed tick rolls back the scene, the session and every queued message
Commands must work everywhere Global routes interrupt any scene unless the scene opts out

Quick Look

Sending /start while PhoneScene is active runs the command and keeps the scene. Sending cancel leaves it. Sending anything else asks again.

Runtime Model

  1. The adapter converts platform input into an InboundEvent with a ConversationRef, an optional UserRef, a MessageRef and attachments.
  2. Application::handle() resumes the conversation from storage (or starts it in the root scene), matches a route, runs middleware and ticks the state machine once.
  3. Route handlers and scenes reply through Context: reply(), render(), ack(). Effects are queued and delivered by the adapter only after the tick committed.
  4. The conversation snapshot is written back through StorageInterface.

Serialization Rules

Session data, action payloads, metadata and view metadata may contain scalars, null, arrays of those and backed enums. Objects, resources and non-backed enums are rejected on write.

Requirements

PHP 8.2 or newer, chatflowphp/automata 2.x, php-di/php-di 7.x.

License

MIT. See LICENSE.


All versions of core with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-mbstring Version *
chatflowphp/automata Version ^2.0
php-di/php-di Version ^7.0
psr/clock Version ^1.0
psr/container Version ^2.0
psr/log Version ^3.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 chatflowphp/core contains the following files

Loading the files please wait ...