npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@obinexusltd/php-polycall

v1.0.0

Published

PHP FFI source binding for libpolycall 1.5

Readme

@obinexusltd/php-polycall

PHP FFI source binding for libpolycall 1.5, packaged for public distribution through npmjs.org.

The adapter is intentionally thin: it declares only polycall_ffi_run_config, passes a configuration path with validation mode 1, and returns the core status unchanged. Configuration parsing and runtime behavior remain in libpolycall.

Install from npm

npm install @obinexusltd/php-polycall

The npm package contains portable PHP source, Composer metadata, the generated FFI declaration, examples, tests, and runtime configuration. It does not bundle a platform-specific libpolycall binary.

Requirements

  • PHP 7.4 or newer
  • PHP's built-in ext-ffi
  • A libpolycall shared library exporting polycall_ffi_run_config

Enable FFI for CLI use when necessary:

php -d ffi.enable=1 examples/run.php php-polycallrc

Set the library path explicitly for reliable deployment:

$env:POLYCALL_LIBRARY = 'C:\path\to\libpolycall.dll'

Without POLYCALL_LIBRARY, the adapter searches the package and parent workspace build, bin, and lib directories for standard library names.

PHP API

<?php

use OBINexus\Polycall\Polycall;
use OBINexus\Polycall\PolycallException;

require_once __DIR__ . '/node_modules/@obinexusltd/php-polycall/src/Polycall.php';

$polycall = new Polycall();

$status = $polycall->runConfig('php-polycallrc');
if ($status !== 0) {
    exit($status);
}

try {
    $polycall->runConfigOrThrow('php-polycallrc');
} catch (PolycallException $error) {
    echo $error->status();
}
  • runConfig(?string $path): int returns the core status unchanged.
  • runConfigOrThrow(?string $path): void raises PolycallException for a nonzero status.
  • Omitting the path uses this package's php-polycallrc.
  • Passing a library path to new Polycall($path) overrides discovery.

Composer compatibility

The included composer.json provides PSR-4 autoloading:

composer install

The Composer package identity is obinexus/php-polycall; npm remains the distribution target requested here.

Test

npm test

Tests validate npm/Composer metadata, relative directory indexing, and the one-call FFI boundary. If PHP is installed, the suite compiles a tiny mock shared library with GCC and exercises the real PHP FFI path automatically.

If PHP is absent or ext-ffi is not loaded, that optional smoke test is reported as skipped while the mandatory publication tests still run. Once PHP and FFI are available, require the language test explicitly with:

npm run test:php

JavaScript build-tool entry point

const binding = require('@obinexusltd/php-polycall');

console.log(binding.phpClass);
console.log(binding.directories.src.relativeFiles);
console.log(binding.resolve('examples', 'run.php'));

All exported directory paths are project-relative in package.json and become absolute only through the CommonJS entry point. resolve() prevents traversal outside the selected directory.

Publish publicly

npm pack --dry-run
npm publish --access public

publishConfig.access is already set to public. Publishing is not performed automatically.

Author and license

Nnamdi Michael Okpala ([email protected]). Licensed under MIT.