Download the PHP package confish/sdk without Composer

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

confish/sdk

Official PHP SDK for confish — typed configuration, actions, logs, feeds, and webhook verification.

Install

Requires PHP 8.1+.

Quick start

fetch, update, and replace return array<string, mixed>. PHPStan/Psalm users can document expected shapes via array shapes:

Reading and writing config

update and replace return the full updated configuration.

Write access must be enabled in environment settings before update and replace will work.

Feeds

Feeds hold living state — job statuses, crawl results, active incidents — keyed by your own external IDs. $client->feed($slug) returns a handle bound to one feed; no HTTP happens until you call a method on it.

set is a declarative full-replace: the item's data becomes exactly what you pass. ttl is in seconds (1 to 2592000 = 30 days); omitting it makes the item permanent and clears any TTL set by a previous set — TTLs are never carried over. External IDs are limited to 255 characters.

For sync-style cron jobs that push their full dataset each run, replace makes the feed exactly the items you pass in one request — no client-side diffing:

Anything absent from the payload is deleted, and an empty list clears the feed. The request is all-or-nothing: duplicate external_ids, more items than your plan's item cap, or any schema-invalid item rejects the whole request with a 422 and nothing written. The per-item ttl key follows the same rule as set — omit it to make that item permanent.

Each FeedItem exposes id, externalId, data (array<string, mixed>), expiresAt (nullable), createdAt, and updatedAt.

An unknown feed slug throws NotFoundException. A 422 throws ValidationException — with per-field messages in $e->errors when the item data doesn't match the feed's schema, or a message-only error when the feed is at its item cap.

Logging

Levels via the LogLevel enum: Debug, Info, Notice, Warning, Error, Critical, Alert, Emergency. Levels follow RFC 5424 (syslog), so they map 1:1 onto PSR-3/Monolog levels.

You can also write up to 100 entries in one request. level takes the enum or its string value; the optional ISO 8601 timestamp records when the entry was captured, for entries you buffered before sending:

Monolog / PSR-3

If you already log through Monolog, push Confish\MonologHandler onto your stack and everything you log flows to confish as well — no call-site changes:

The handler needs monolog/monolog ^3.0 (composer require monolog/monolog) — the SDK only suggests it, so you don't pull in Monolog unless you use the handler.

Records are buffered in memory with the timestamp captured at log time, then shipped through the batch endpoint: the handler flushes automatically at 50 buffered records (tune with flushAt:), on close(), and when it is destroyed at the end of the request — chunked to at most 100 entries per request. In long-running workers (queue consumers, daemons), call $handler->flush() on your own cadence or wrap the handler in Monolog's BufferHandler.

Delivery failures are swallowed, never thrown back into your logging path — a confish outage can't take down the work you're logging. Dropped entries are counted ($handler->droppedCount()) and reported to an optional callback, which is never routed back through the handler, so delivery errors can't feed back on themselves:

Not on Monolog? Confish\PsrLogger implements PSR-3's LoggerInterface and sends each record immediately, one request per call — fine for scripts and cron jobs; prefer the buffered Monolog handler for anything chatty. It gives the same never-throw guarantee, with droppedCount() and the same onError callback:

Both adapters pass context through structured — placeholders are not interpolated, and the dashboard renders the context object. Throwables under any context key are converted to class/message/file/line so they survive JSON encoding.

Laravel

Bind the client once, then point a monolog channel at the handler — no extra package or service provider needed:

Laravel resolves the handler through the container — injecting the bound Confish client and passing the channel's level — so scalar options are all handler_with needs. Log to it directly (Log::channel('confish')->info(...)) or add 'confish' to your stack channel to mirror everything you already log. Buffered records flush at the threshold and when the process shuts down; queue workers live across many jobs, so flush from a job hook or lower flushAt if you need entries sooner.

Actions

The action consumer polls for pending actions, acknowledges them, runs your handler, and reports completion or failure — including idempotent skip if another consumer claimed the same action first.

What happens automatically:

You can also drive the lifecycle manually:

Webhook verification

Webhook::verify parses and verifies in one step: it returns the parsed WebhookPayload on success and throws on failure, so a bad signature can never be ignored.

Laravel example:

Failures are typed: WebhookSignatureException when the signature is missing, malformed, or doesn't match, and WebhookTimestampException when the signature matches but the timestamp is outside tolerance. Both extend WebhookVerificationException. Verification uses constant-time comparison and rejects timestamps older than 5 minutes by default — pass toleranceSeconds: 0 to disable. Always pass the raw, unparsed body — re-serializing parsed JSON breaks verification.

Errors

By default the client retries 429 (honoring Retry-After) and 5xx responses up to twice. Tune with maxRetries on the constructor.

Options

License

MIT


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
guzzlehttp/guzzle Version ^7.5 || ^8.0
psr/log Version ^2.0 || ^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 confish/sdk contains the following files

Loading the files please wait ...