Download the PHP package narya/php-sdk without Composer

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

Narya PHP SDK

PHP library that integrates PHP userland with the Narya Runtime Engine (Go).
Namespace: Narya\SDK.

Protocol: UDS (Unix Domain Sockets) + MessagePack, handshake NARYA1/OK, 4-byte BE length framing + payload.

Components

Component Description
Worker (Runtime\Worker) Orchestrates the loop: receives request from Go, calls application or handler, sends response. Resets state between requests.
WorkerBridge (Runtime\WorkerBridge) UDS + MessagePack bridge: handshake, read/write frames, invokes handler.
NaryaRequest / WorkerRequest Request contract and implementation (id, method, uri, path, query, headers, body, remote_addr, host, scheme, timeout_ms, meta, worker_id, runtime_version).
NaryaResponse / WorkerResponse Response contract and implementation (status, headers, body, error). The Bridge adds id and _meta.
ApplicationWorker Application (framework) contract: handle(NaryaRequest): array|NaryaResponse and reset().
LifecycleInterface / LifecycleManager Worker lifecycle: boot() before the loop (e.g. connect to socket), shutdown() on exit (max_requests or EOF). Passed as Worker’s 4th argument or via setLifecycle().

Requirements

Installation

Basic usage

The Go runtime starts each process with: php worker.php --sock /path/to.sock.

With lifecycle (boot before the loop, shutdown on exit):

Example with a shared resource in the worker (e.g. connection opened in boot, closed in shutdown):

With a callable handler (no framework):

Dependency injection container

If your application already uses a DI container:

So: clearing context on each request → inside reset(), not in shutdown. See a full example in examples/worker_with_container.php.

Tests

License

MIT


All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-msgpack Version *
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 narya/php-sdk contains the following files

Loading the files please wait ...