dlindberg/pasteboard 问题修复 & 功能扩展

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

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

dlindberg/pasteboard

Composer 安装命令:

composer require dlindberg/pasteboard

包简介

Very basic MacOS pasteboard interface

README 文档

README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Code Intelligence Status Total Downloads

This is a very simple static utility class that gives access to the pbcopy and pbpaste interface on MacOS and other systems that support those shell commands. This utility is primarily useful in developing PHP command line tools. It endeavors to comply fully with PRS-1, PRS-2, and PRS-4.

This project also uses the thephpleague/skeleton repository for component boilerplate.

Install

Via Composer

$ composer require Dlindberg/Pasteboard

Usage

Pasteboard has three methods:

Get

Retrieves a value from the clipboard.

Pasteboard::get();

Parameters: None.

Returns: The contents of the host computers clipboard or false if the clipboard is empty or fails to return a value.

Note: no filters or santization is applied to the return value and it is prudent to treat the value as unsafe user input for the purposes of your application.

Set

Copies a value to the clipboard.

Pasteboard::set(string $value);

Parameters $value any value that the pasteboard on the host computer accepts. The function does not validate that the value is safe or valid before attempting to pass it to the host computer. If you are sending user input, or the results of an http request to the computer's clipboard it is prudent ensure that whatever is sent to the clipboard is safe for the context you intend to paste it to.

Returns: true on success or false on failure.

Set Array

Sends an array of values one at a time to the clipboard pausing between each send. The function also has some advanced options defined in the $options array.

Pasteboard::setArray(array $values, array $options)

Parameters

  • $values an array of values you wish to send to the host computer. The same notes as in set apply to each value.
  • $options an optional settings array. Available options:
    • reset when true the original contents of the clipboard will be restored at the end of execution. Default: false.
    • wait amount of time in seconds to wait between set() operations. Default 1.
    • depth Specified recursion depth. Default: 0, nested arrays will be skipped.
    • heartbeat a user defined closure function that will execute each time the clipboard is set. This function overrides the default $hearbeat function. Therefore, the wait parameter is ignored when a hearbeat is passed. The function should return a truthy value if execution should continue and a falsy value to terminate execution. Heartbeat is passed the result of set().

Returns: true on success or false on failure.

Note: Without an advanced clipboard manager on the host machine, or passing a heartbeat function sending more than two to three items to clipboard will rapidly become untenable.

Change log

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

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email dane@lindberg.xyz instead of using the issue tracker.

Credits

License

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

dlindberg/pasteboard 适用场景与选型建议

dlindberg/pasteboard 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 02 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「Dlindberg」 「Pasteboard」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 dlindberg/pasteboard 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

与 dlindberg/pasteboard 相关的其它包

同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-02-13