定制 alwaysblank/extrovert 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

alwaysblank/extrovert

Composer 安装命令:

composer require alwaysblank/extrovert

包简介

Simple social media share links.

README 文档

README

Quickly generate simple social media share URLs.

Build Status

Usage

This project only generates URLs (and, optionally, link elements to wrap them); it does not implement any kind of more involved sharing activity, and it never will. It is not attempting to be a social media clearinghouse with deep integration, interactivity, and share counts, so it will only ever support services that allow for sharing through the simple mechanism of a link.

URL

To use it, simply call the url() static method on the network you want, passing in any relevant arguments. For instance, to generate a link to share something on Facebook, you would do this:

AlwaysBlank\Extrovert\Network\Facebook::url('https://www.alwaysblank.org');

Some networks also support additional information, such as a name or description. You can pass these serially, or as part of an array. The following are all equivalent:

AlwaysBlank\Extrovert\Network\ExampleNetwork::url('https://www.alwaysblank.org', "Extrovert Can Help", "A new tool to generate simple share URLs.");

AlwaysBlank\Extrovert\Network\ExampleNetwork::url([
  'https://www.alwaysblank.org', 
  "Extrovert Can Help", 
  "A new tool to generate simple share URLs."
]);

AlwaysBlank\Extrovert\Network\ExampleNetwork::url([
  'uri' => 'https://www.alwaysblank.org', 
  'name' => "Extrovert Can Help", 
  'description' => "A new tool to generate simple share URLs."
]);

All content is automatically URL-encoded—do not pass in already encoded strings.

Link

You can also generate a simple link element, with a few safety features. The syntax is very similar to url(), but with link() you must pass your url arguments as an array.

AlwaysBlank\Extrovert\Network\ExampleNetwork::link(
  ['https://www.alwaysblank.org', "Extrovert Can Help", "A new tool to generate simple share URLs."],
  'Share on Network',
  ['class' => 'link']
);

Supported Networks

  • Facebook - Supports only the url argument.
  • LinkedIn - Supports the url argument.
  • Twitter - Supports the url and name arguments.
  • Pinterest - Supports the url, description, and media arguments, but beat in mind that they must be passed as a key array, and that you must pass both a url and media value--Pinterest won't understand it otherwise, and you'll get odd results.
  • Email - Supports the url and name, and description arguments, but behaves a little differently. It expects description to contain a %s that will be replaced with the url. It will also attempt to generate reasonable defaults for name and description (the subject and body of the email respectively) if none are provided.
  • Your Favorite! - Submit an issue or, even better, a pull request! Please do keep in mind the limitations and intentions of the project, however.

Notes

Extrovert is very type-sensitive, so make sure you pass it arguments that it will like: Otherwise it will very rudely start throwing exceptions.

If you pass arguments that are the correct type but are otherwise incorrect, it will very politely just return an empty string.

Many of these services will pull information to populate rich links from the URL you are telling them to link to. For this reason, it is wise to make sure that the metadata (and/or OpenGraph data) on that URL is correctly implemented. It also means that they will throw errors if you try to link to unreachable URLS (i.e. development-site.local);

alwaysblank/extrovert 适用场景与选型建议

alwaysblank/extrovert 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 963 次下载、GitHub Stars 达 3, 最近一次更新时间为 2019 年 07 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-29