Download the PHP package fylhan/posibrain without Composer

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

Posibrain

A re-usable tchatbot PHP implementation to never be alone again. Hum, wait... What? Nothing very intelligent at the moment, a set of predefined sentences lead to an other set of predefined answers. But still, synonyms can be defined, data from the sentence can be used in the answer, and of course the same answer won't be use every time.

Posibrain's name is inspired by Asimov's positronic robots. Yes, as expected, R. Sammy is very silly ;-)

Build Status Scrutinizer Code Quality

Installation & Usage

Use Composer to download and install this library. To do so, create a folder and a file composer.json in it. Add this to the following file:

"require": {
    "fylhan/posibrain": "dev-master",
}

And install it using the command bellow:

> php composer.php install

You can also download it, and also download all dependencies and paste them into a "vendor" folder. No configuration is required because it is just an algorithm.

You can easily use it in your code:

require '../vendor/autoload.php';
use Posibrain\TchatBot;
// OR without Composer autoload: include_once('src/Posibrain/TchatBot.php');

header("Content-Type: text/html; charset=UTF-8");
$bot = new TchatBot();
$answer = $bot->generateAnswer('Bnmaster', 'Bonjour mon ami !', time());
echo @$answer[1].' : '.$answer[0].'<br />';
// May display for example: 'R. Sammy: Salutations noble ami.'

Or even using command line:

Usage: php app/console submit "User message" ["User name"]
> php app/console submit "Bonjour mon ami"
R. Sammy: Salutations noble ami.

In command line you can also start an interactive tchat with the bot:

Usage: php app/console discuss ["User name"]
> php app/console discuss
What is your name? (Anonymous) Fylhan
You can start to discuss with the bot... Have a good tchat!

Fylhan: Salut !
R. Sammy: Tu vas bien ?

Fylhan: Oui je vais bien ! Comment fait-on cuire tu riz ?
R. Sammy: Moules à gaufres ! Demande à Wikipédia.

Fylhan: Aurevoir
R. Sammy: A bientôt ! Sale vilaine bête de tonnerre de Brest !

See you soon!

Or you can list available bots and positrons (i.e. plugins) :

> php app/console bots
[0] R. Sammy alias Sammy: made the 11th of July 2013 by Fylhan
[1] R. Sammy ISO: made the 30th of August 2013 by Fylhan
> php app/console positrons
[0] Haddock/HaddockPositron
[1] Instinct/InstinctPositron

Or the REST API

GET /api/bots
GET /api/positrons
GET /api/submit/bot-id/bot-lang?pseudo=Fylhan&msg=Qui est le président des Etats-Unis ?

How to test?

Open the file dynamic.php in a browser to open an interactive tchat with R. Sammy, the crazy stupid bot. At the moment, an old tchatbot version is also installed on the Bnbox minitchat (fr), you can try to speak with him in French by beginning your sentences by "@Hari": "@Hary Salut !".

For a static example, open the file static.php in a browser. A list of sentences, and their bot answer, will be displayed. Check the "logs" folder if you encounter some issues.

Posibrain discussion example

You can also run unit tests using PHPUnit by running the "phpunit" command.

How to use and modify?

This documentation will be enhanced from time to time.

Create a new Positron

A "Positron" is a plugin that will add intelligence and features to a bot. It is a PHP class extending \Posibrain\Positron\Positron. The file name and class name follow the pattern: src/Posibrain/Positron/XXX/XXXPositron.php. The class should be in the namespace \Posibrain\Positron\XXX.

To check an example, please have a look to the Haddock Positron which adds 'Captain Haddock like insults' in the bot's answers.

A Positron may override several methods in order to select when to launch this positron, or to help other positrons to do their job, or to perform a new feature by itself.

Work in progress

A lot of things are in progress! I have created a first version of the bot algorithm, with a quick knowledge database. I am currently working on the package improvement (command line, API usability, brain selection, languages, plugin management). This is not the main goal of this project, but this is important to use it, and (eventually) contribute to it. Then... we will be able to increase this tchatbot intelligence :D

Licensing

This piece of code is a free software under LGPL v3. See LICENSE file for more information. If this license is an issue for you, don't hesitate to contact me, I am very open on this :D

To summarize:


All versions of posibrain with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
monolog/monolog Version 1.6.*
seld/jsonlint Version 1.1.*
symfony/console Version 2.3.*
symfony/http-foundation Version 2.3.*
symfony/http-kernel Version 2.3.*
symfony/routing Version 2.3.*
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 fylhan/posibrain contains the following files

Loading the files please wait ....