jayeshmepani/swiss-ephemeris-ffi
PHP 8.3+ FFI wrapper for the Swiss Ephemeris C library. Exposes all 106 public API functions with 1:1 constant/signature parity and zero abstraction. No swetest shelling; outputs verified for parity via PHPUnit against swetest.
storage/app/swisseph/ publishing target aligns better with Laravel’s non-public asset storage conventions (vs. deprecated public/).libswisseph requirements. Bundled binaries (multi-platform) eliminate manual installation for most deployments, but custom paths still require pre-installed libraries.libswisseph versioning.libswisseph deployment, or are custom paths necessary?libswisseph vulnerabilities, or is this the user’s responsibility?storage/app/swisseph/ after php artisan vendor:publish.$ephemeris1 = new \JayeshMepani\SwissEphemeris\SwissEphemeris();
$ephemeris2 = new \JayeshMepani\SwissEphemeris\SwissEphemeris('/custom/path');
// Assert $ephemeris1 !== $ephemeris2 to confirm singleton bypass.
ffi.libswisseph (documented in release notes).storage/app/swisseph/ and test facade delegation.jayeshmepani/swiss-ephemeris-ffi and document whether bundled binaries are used (to avoid libswisseph version conflicts).vendor:publish in Dockerfile to ensure storage/app/swisseph/ exists:
RUN php artisan vendor:publish --provider="JayeshMepani\SwissEphemeris\SwissEphemerisServiceProvider" --tag="config" --tag="native-libs"
test -f "$(php artisan vendor:publish --dry-run --tag=native-libs | grep "Publishing Native Libraries")".php tests/Feature/SingletonTest.php.storage/app/swisseph/ as the official publish target.try {
$ephemeris = new SwissEphemeris('/custom/path');
} catch (RuntimeException $e) {
\Log::error("Singleton conflict", ['custom_path' => '/custom/path', 'stack' => $e->getTraceAsString()]);
}
libswisseph versioning risks across nodes. Use init containers in Kubernetes to ensure consistency.| Failure Type | Symptoms | Mitigation |
|---|---|---|
| Singleton Initialization Fail | RuntimeException on custom path after first init. |
Updated: Validate path before instantiation; fall back to bundled binary. |
| Bundled Binary Corruption | Silent failures or crashes. | New: Verify binary checksums in CI/CD. |
| FFI Initialization Fail | Unchanged – segfault or PHP crash. |
Unchanged – OPcache tuning and libswisseph version checks. |
How can I help you explore Laravel packages today?