承接 nikaia/php-python-bridge 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nikaia/php-python-bridge

最新稳定版本:v1.0.0

Composer 安装命令:

composer require nikaia/php-python-bridge

包简介

Call your NodeJS scripts from Php

README 文档

README

Latest Version on Packagist Tests

Call your Python scripts from Php

Installation

You can install the package via composer:

composer require nikaia/php-python-bridge

Usage

The bridge work by executing a python script that accept piped json arbitary data, and returns json response.

check tests/_fixtures/ok.script.py for a working example.

use Nikaia\PythonBridge\Bridge;

try {
    $response = Bridge::create()
        ->setPython('/usr/local/bin/python')        // the path to the node (You can omit if in system path)
        ->setScript('/path/to/your/script.py')  // the path to your script 
        ->pipe(['foo' => 'bar'])                // the data to pipe to the script
        ->run();
}
catch (BridgeException $e) {
    echo $e->getMessage();
}

var_dump($response->json());   // ['foo' => 'bar']
var_dump($response->output()); // the raw output of the script {"foo":"bar"}

Changelog

Please see CHANGELOG for more information on what has changed recently.

Releases

This package use semver releases. Releases are managed using standard-version node package, and requires adhering to conventionalcommit commit styles.

  1. Implement a feature or a fix etc.
  2. Use commit message like fix: Fix an issue or feat: Implement a feature ...
  3. Or rewrite the commit message while squashing/closing the PR!!
  4. Update your local project, checkout main branch
  5. Run : composer release to generate changelog, and to tag to new release.
  6. Check everything is okay.
  7. Push the tag using git push --follow-tags origin main

This repository is using Semantic Pull Request bot to enforce conventional commit message and PR titles

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 104
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固