core23/shariff-bundle
最新稳定版本:5.1.1
Composer 安装命令:
composer require core23/shariff-bundle
包简介
This bundle provides shariff integration in symfony applications
README 文档
README
This bundle provides a wrapper for using shariff inside the symfony sonata-project.
Installation
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
composer require nucleos/shariff-bundle
Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles in config/bundles.php file of your project:
// config/bundles.php return [ // ... Nucleos\ShariffBundle\NucleosShariffBundle::class => ['all' => true], ];
Define cache, http client and request factory:
# config/routes/nucleos_shariff.yaml
framework:
cache:
pools:
cache.shariff:
adapter: cache.adapter.filesystem
nucleos_shariff:
cache: 'cache.shariff'
http_client: 'some.http.client' # e.g httplug.client
request_factory: 'some.request.factory' # e.g. nyholm.psr7.psr17_factory
Assets
It is recommended to use webpack / webpack-encore
to include the shariff.js and shariff.css file in your page.
You can use npm or yarn to load the library:
npm install shariff
yarn add shariff
Configure the Bundle
Create a configuration file called nucleos_shariff.yaml:
# config/routes/nucleos_shariff.yaml nucleos_shariff: resource: "@NucleosShariffBundle/Resources/config/routing/backend.yml"
Create a configuration file called framework_cache.yaml:
framework: cache: pools: cache.shariff: adapter: cache.adapter.filesystem
Usage
{# template.twig #} {{ sonata_block_render({ 'type': 'nucleos_shariff.block.share' }, { 'url': 'https://example.com/site.html' }) }}
Configure the Bundle
You can globally configure the services that should count the likes or favorites for a page.
nucleos_shariff: cache: 'cache.shariff' http_client: 'some.http.client' request_factory: 'some.request.factory' options: domains: [ ] # Allow specific domains for shariff services: [ 'addthis', 'buffer', 'facebook', 'pinterest', 'reddit', 'stumbleupon', 'vk', 'xing' ] services: facebook: app_id: "1234567890" secret: "GENERATEDSECRET" version: "5.0"
This is a fork of shariff-php with a more modern and dynamic solution.
License
This bundle is under the MIT license.
core23/shariff-bundle 适用场景与选型建议
core23/shariff-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 342 次下载、GitHub Stars 达 5, 最近一次更新时间为 2015 年 10 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「sonata」 「bundle」 「twitter」 「google」 「facebook」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 core23/shariff-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 core23/shariff-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 core23/shariff-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Sonata Extra admin features
ACL list filtering for SonataAdmin
2lenet/EasyAdminPlusBundle
The bundle for easy using json-rpc api on your project
Provide a way to secure accesses to all routes of an symfony application.
DMS Meetup API Bundle, enables Meetup API clients in services
统计信息
- 总下载量: 342
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-19