Download the PHP package feedple/feedple-sdk without Composer

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

Feedple PHP SDK

Packagist Version PHP Version License: MIT

The official PHP SDK for the Feedple AI platform. Connect your database to Feedple with a single class — the SDK handles authentication, schema sync, and query execution automatically.


Table of Contents


How It Works

  1. Connect & Authenticate — Establishes a secure background connection and authenticates your API key. The server responds with a session_id used to resume sessions after disconnects.
  2. Sync Schema — Inspects your database (tables, columns, PKs, FKs, indexes) and sends the schema to Feedple in chunks. Re-syncs on a configurable interval; skips if nothing changed.
  3. Execute Queries — Receives incoming IR query requests from Feedple, enforces RBAC, executes them safely as parameterized PDO statements, and returns the results.

Requirements


Installation

No additional configuration is needed — Composer's autoloader handles all class loading automatically.


Quick Start

Important: run() starts the ReactPHP event loop, which blocks until stop() is called. In a web application, call this in a dedicated CLI worker process — not inside a request handler.


Configuration

All constructor parameters except the first three are optional.

Parameter Reference

Parameter Type Default Description
apiKey string required Your Feedple API key. Throws InvalidArgumentException if empty.
db PDO required PDO database connection.
identity Identity required Controls which tables are accessible.
autoSync bool true Periodically re-inspect and send the schema.
syncInterval int 60 Seconds between schema re-sync cycles.
reconnectEnabled bool true Automatically reconnect on connection loss.
maxRetries int\|null null Cap on reconnect attempts. null means unlimited.
probeBeforeConnect bool false Perform a pre-connection HTTP probe to surface clearer server error messages (e.g. 403 bodies).
logger LoggerInterface\|null null PSR-3 logger. A stderr logger is used when null.
wsUrl string\|null null Override the default Feedple server endpoint URL.

Identity & Access Control

Identity controls which database tables Feedple can see and query.

Identity Properties

Property Type Default Description
name string\|null Human-readable label for this identity.
allowedTables string[] [] Tables this identity may access. Ignored when allTables is true.
allTables bool false When true, all current and future tables are accessible.

Security: The SDK enforces RBAC on every IR query received from the server. If the IR references a table not in allowedTables, a RuntimeException is thrown and an ir.error is sent back to the server — the query never reaches the database.


Schema Sync

The SDK automatically syncs your schema on startup (after authentication) and then every syncInterval seconds. You can also trigger a manual sync:

What gets synced

For each table the identity can access, the SDK sends:

Database support

Schema introspection uses standard INFORMATION_SCHEMA queries (MySQL, PostgreSQL) and PRAGMA statements (SQLite), with no external dependencies.

Database PDO driver Support
MySQL / MariaDB pdo_mysql ✅ Full
PostgreSQL pdo_pgsql ✅ Full
SQLite pdo_sqlite ✅ Full
Others Any ⚠️ Partial (via ANSI INFORMATION_SCHEMA)

Sensitive column filtering

The following column names are never sent to Feedple:

password, token, secret, hash, salt, ssn, credit_card

You can apply this filter manually:


IR Query Execution

The SDK receives IR (Intermediate Representation) query objects from the Feedple server and executes them as parameterized PDO statements against your database. You do not call this yourself — it is invoked automatically over the background connection.

IR Schema

Supported filter operators

Operator Aliases SQL
eq = col = ?
neq != col != ?
gt > col > ?
gte >= col >= ?
lt < col < ?
lte <= col <= ?
in in_ col IN (?, ?, …)
like col LIKE ?
ilike col ILIKE ?

Supported aggregate expressions

count, count(distinct), sum, avg, min, max

SQL injection safety

IrBuilder never uses string interpolation for values. All values are passed as PDO bound parameters (?). Identifiers (table and column names) are validated against [a-zA-Z0-9_$]+ before being double-quoted.


Connection Management

Reconnect behaviour

The SDK reconnects automatically using exponential back-off:

Attempt Delay
1 5 s
2 10 s
3 20 s
4+ 40 s → capped at 60 s

Authentication failures (auth.error) are not retried — the SDK stops the event loop immediately and logs the error.

Session resume

The session_id received in auth.ack is stored in $ws->sessionId and re-sent on every reconnect attempt. The server resumes the session if it is still within TTL, or issues a new session ID if it has expired.

Stopping the SDK

Closes the background connection and stops the worker event loop. Safe to call from a signal handler:


Utilities

IrBuilder — build SQL from an IR payload

SqlCompiler — validate raw SQL against RBAC

SchemaServices — schema utilities

PolicyEngine — direct RBAC checks

JsonSerializer — safe JSON encoding


Running in Production

As a standalone CLI worker

The simplest approach is a dedicated PHP process managed by your process manager:

With Supervisor

With a PSR-3 logger (Monolog)

Environment URLs

The SDK targets the development server (localhost:8000) by default. Switch to production by overriding the wsUrl parameter:


API Reference

FeedpleSDK

Identity

PolicyEngine

IrBuilder

SchemaServices

SqlCompiler

JsonSerializer

Exceptions

Class Extends When thrown
AuthException RuntimeException Connection authentication fails (auth.error received)
SchemaSyncException RuntimeException Schema sync HTTP/API call fails
IrExecutionException RuntimeException IR query execution error (unused directly — RuntimeException is thrown inline)

Testing

Tests requiring a live database (SQLite, MySQL) are automatically skipped when the corresponding PDO driver is not installed. The pure-logic tests (IR builder, policy engine, schema hash/filter) always run.


License

feedple-sdk is distributed under the terms of the MIT license.


All versions of feedple-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
monolog/monolog Version ^3.0
psr/log Version ^3.0
ratchet/pawl Version ^0.4
react/event-loop Version ^1.5
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 feedple/feedple-sdk contains the following files

Loading the files please wait ...