Releases: rakshitbharat/pythoninphp
Releases · rakshitbharat/pythoninphp
Release list
v2.1.2: Modernized PythonInPHP (V2 Rebuild)
Release v2.1.2: Modernized PythonInPHP (The V2 Rebuild)
We have completely rebuilt the package from scratch to provide a robust, modern, and secure way to execute Python scripts from PHP and Laravel.
🌟 Key Changes
- Symfony Process Integration: Swapped legacy
popen()/exec()execution for the robustSymfony\Component\Process\Processcomponent. This automatically secures argument passing and prevents command injection. - Auto-Discovery Cross-Platform Paths: Integrated Symfony
ExecutableFinderto automatically search and find Python paths (python3,python, orpy) on macOS, Windows, and Linux out-of-the-box. - Laravel Integration: Built a dedicated
PythonServiceProviderfor config caching compatibility and a cleanPythonFacade for elegant developer syntax. - Fluent Process Configurations: Added state-safe fluent builders returning cloned immutable instances:
Python::withTimeout(int|float|null $timeout)Python::withWorkingDirectory(string $cwd)Python::withEnv(array $env)
- Comprehensive Debugging Exception: Rewrote standard exceptions to pull exit codes and merge standard output alongside standard error for rapid troubleshooting.
- Complete IDE Autocomplete: Enriched Facade docblocks for full static auto-completion in modern IDEs like VS Code and PhpStorm.
- Containerized Testing: Configured
Dockerfileanddocker-compose.ymlto allow platform-independent testing via PHP 8.2 Alpine environments.