kphoen/vex
最新稳定版本:1.1.5
Composer 安装命令:
composer require kphoen/vex
包简介
Extract videos from any URL
README 文档
README
Vex is a PHP library to extract a video from any URL.
Supported Services
For each video-sharing website of the following list, a Platform class can identify a supported URL and extract the video data.
Status
This project is DEPRECATED and should NOT be used.
If someone magically appears and wants to maintain this project, I'll gladly give access to this repository.
Installation
The recommended way to install Vex is through composer.
{
"require": {
"kphoen/vex": "1.1.*"
}
}
If you don't use neither Composer nor a ClassLoader in your application, just require the provided autoloader:
require_once 'src/autoload.php';
You're done.
Usage
use Vex\Vex; $adapter = new \Vex\HttpAdapter\BuzzHttpAdapter(); $platform = \Vex\Platform\RutubePlatform($adapter); $vex = new Vex($platform); $video = $vex->extract('https://rutube.ru/video/b5a392c180ddfe3e1ebded38f9f9dc52/'); // Show the video title echo $video->getTitle(); // Shows the embedded video HTML echo $video->getCode(); // Show the video link echo $video->getLink(); // Show the video duration echo $video->getDuration(); // Show the video thumbnail echo $video->getThumb(); $url = $vex->reverse('<iframe width="640" height="360" src="http://rutube.ru/video/embed/6236741" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowfullscreen scrolling="no"></iframe>'); // shows http://rutube.ru/video/9f4dc6bc2db6b6051ea07fb20234c6cc/ echo $url
Tests
To run unit tests, you'll need cURL and a set of dependencies you can install using Composer:
php composer.phar install --dev
Once installed, just launch the following command:
phpunit
Credits
- Kévin Gomez
- William Durand - for the
HttpAdapterpart, which was borrowed from Geocoder - Jérôme Tamarelle - to whom I borrowed this README
License
Vex is released under the MIT License. See the bundled LICENSE file for details.
kphoen/vex 适用场景与选型建议
kphoen/vex 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 351 次下载、GitHub Stars 达 24, 最近一次更新时间为 2013 年 01 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「parser」 「url」 「dailymotion」 「video」 「extractor」 「rutube」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kphoen/vex 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kphoen/vex 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kphoen/vex 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP helper for embedding YouTube and Vimeo videos
Easy to use SDK with grabber for multiple platforms at once like YouTube, Dailymotion, Facebook and more.
Easy URL rewrites in your Laravel application
An MT940 bank statement parser for PHP
Dailymotion 2.0 Client Provider for The PHP League OAuth2-Client
A Laravel helper to detect if the current route/path is active.
统计信息
- 总下载量: 351
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 24
- 点击次数: 32
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-01-03