Download the PHP package spontena/pb-php without Composer

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

pb-php

Pandorabots API client for PHP.

See the official Pandorabots API documentation: https://www.pandorabots.com/docs/api-endpoints/

Requirements

Installation

Quickstart

A working end-to-end script lives in examples/quickstart.php. Run it after setting PB_APP_ID and PB_USER_KEY:

API reference

Method HTTP Endpoint
getBotsList() GET /bot/{appId}
create($botname) PUT /bot/{appId}/{botname}
delete($botname) DELETE /bot/{appId}/{botname}
getBotFiles($botname) GET /bot/{appId}/{botname}
getBotFile(FileKind $kind, $botname, ?$name) GET /bot/{appId}/{botname}/{kind}[/{name}] (since v2.1.0)
upload($path, $botname) PUT /bot/{appId}/{botname}/{kind}[/{name}]
deleteBotFile($name, FileKind $kind, $botname) DELETE /bot/{appId}/{botname}/{kind}[/{name}]
compile($botname) GET /bot/{appId}/{botname}/verify
talk($input, $botname, ...) POST /talk/{appId}/{botname}
debug($input, $botname, ...) POST /talk/{appId}/{botname} (with trace etc.)
atalk($input, ...) POST /talk?botkey=... (botkey auth, bot identified by key)

Successful responses are returned as stdClass (the decoded JSON body). getBotsList() returns a list<\stdClass> because the API responds with a top-level JSON array. getBotFile() returns the raw response body as a string (no JSON decoding) — useful for downloading AIML/set/map content. HTTP 4xx/5xx responses raise Spontena\PbPhp\Exception\ApiException; bad inputs raise InvalidArgumentException or InvalidFileException.

upload() infers the file kind from the extension:

Extension FileKind URL form
.aiml File /bot/.../file/{name}
.set Set /bot/.../set/{name}
.map Map /bot/.../map/{name}
.substitution Substitution /bot/.../substitution/{name}
.pdefaults Pdefaults /bot/.../pdefaults
.properties Properties /bot/.../properties

Migration from v1

v2 is a breaking-change release. Notable differences:

Testing

Unit tests (no API access)

CI runs the unit suite on PHP 8.1 / 8.2 / 8.3 / 8.4 — see .github/workflows/ci.yml.

Integration tests (real Pandorabots API)

The tests/Integration/ suite hits the live API to validate that endpoint URLs, request formats, and response shapes still match. It is not run by default. Provide credentials via env vars and invoke the integration suite explicitly:

Test bots are created with names like pbphpci<hint><random> (lowercase alphanumeric only — Pandorabots rejects hyphens) and removed in tearDown() even if a test fails.

To exercise atalk(), additionally set PB_BOT_KEY for an existing, compiled bot whose bot key has been issued in the Pandorabots dashboard:

The bot is identified by the bot key alone — no botname is needed in the request path.

Env var Purpose
PB_APP_ID Pandorabots app id (required)
PB_USER_KEY Pandorabots user key (required)
PB_HOST API host, defaults to https://api.pandorabots.com
PB_BOT_KEY Bot key for atalk() integration test (optional)

License

MIT — see LICENSE.txt.


All versions of pb-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
guzzlehttp/guzzle Version ^7.15.2
guzzlehttp/psr7 Version ^2.12.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 spontena/pb-php contains the following files

Loading the files please wait ...