valzargaming/php-osc 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

valzargaming/php-osc

Composer 安装命令:

composer require valzargaming/php-osc

包简介

Open Sound Control (OSC) Client Library for PHP

README 文档

README

Install the dependencies with Composer:

Run composer install to install the project dependencies.

Bot example

A production-ready example, bot.php, is included. It sends periodic OSC messages (sender-only).

Listener and acknowledgement functionality has been moved to the separate entrypoint script osc_listener.php.

Environment variables for bot.php:

  • OSC_DEST – remote IP to send messages to (default 127.0.0.1)
  • OSC_PORT – remote port to send messages to (default 9000)
  • OSC_INTERVAL – send interval in seconds (default 5)
  • OSC_ADDRESS – OSC address for heartbeat messages (default /bot/heartbeat)

Examples:

Run the bot with defaults:

php bot.php

Send to a custom destination:

OSC_DEST=192.168.1.50 OSC_PORT=3890 OSC_INTERVAL=2 OSC_ADDRESS=/my/bot php bot.php

Start the separate listener (acknowledgement service) in another terminal:

php osc_listener.php

Examples

See examples.md for more usage examples, including the ReactPHP UDP server (server.php) and how to run it together with bot.php for end-to-end testing.

php-osc

PSR-4 version of Open Sound Control (OSC) Client Library for PHP

Authors:

Copyright:

  • Copyright (c) 2003-2007 Andy W. Schmeder
  • Copyright (c) 2026-present Valithor Obsidion

Version: 2.0

Requirements: PHP >= 8.1.2

For information about Open Sound Control, see http://www.opensoundcontrol.org/

Known Issues

  • Listener callbacks in automated tests: The earlier external-process integration test (starting server.php and osc_listener.php as detached processes) failed to observe the server->listener callback in the automated PHPUnit run on Windows. This was caused by process-start timing and platform-specific spawn/quoting behavior. As a result we now provide an in-process integration test that is reliable under PHPUnit: tests/IntegrationTest.php.

  • Manual run that did work: A manual interactive run did exercise the end-to-end flow successfully — start the server and listener, send a probe, and observe the callback/ack cycle in the logs. Example commands used interactively in PowerShell:

    • Start the server (foreground):

      php server.php

    • Start the listener (foreground):

      php osc_listener.php

    • Send a probe to trigger the server callback (helper script):

      php tests/probe_9001.php

    The listener log (osc-listener.log) then shows the received probe and the ack sent back.

  • Why this matters: If you rely on automated external-process integration tests on Windows CI, prefer the in-process ReactPHP test harness provided in tests/IntegrationTest.php or run the manual commands interactively. If you want the external-process test to work in CI, it may require platform-specific adjustments to process startup and timeouts.

valzargaming/php-osc 适用场景与选型建议

valzargaming/php-osc 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 valzargaming/php-osc 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 valzargaming/php-osc 我们能提供哪些服务?
定制开发 / 二次开发

基于 valzargaming/php-osc 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2026-01-25