elvandar/ec-bundle
Composer 安装命令:
composer require elvandar/ec-bundle
包简介
A simple bundle to make communication with external websites easier
README 文档
README
Small Bundle to help use externals urls inside a symfony project.
The goal is to help the communication by centralizing all the routes inside a single configuration fila and providing methods to use thems.
Installation
Open a command console, enter your project directory and execute:
$ composer require <package-name>
Hom to use the bundle
Inside elvandar_ec.yml, you can configure your sites and routes:
site: routes: name: 'http://path/to/your/site'
The file is organised betwin sites.
Each site represents a grouping of urls under the routes list.
Configuration example
your_first_site: routes: home: 'http://first-site/' description: 'http://first-site/description' contact: 'http://first-site/contact' your_second_site: routes: home: 'http://second-site/' contact: 'http://second-site/contact' blog: 'http://second-site/blog' The name of your site: # the name you want to give to your site routes: # a list of the site routes Name: 'URL' # name of the route : url of the route
Use the service
You can now use the Externals service to retrieve :
$externals = $this->container->get('ec'); $externals->getRoute('contact', 'your_second_site');
or redirect to the desired route :
$externals = $this->container->get('ec'); $externals->redirectToExternal('description', 'your_first_site');
Bboth the redirectToEcternal and getRoute methods follow the same parameters rules:
1 - First parameter
The first parameter is the name of your route.
For example inside the example configuration, the name for http://second-site/blog is blog.
This parameter is required.
2 - Second parameter
The second parameter is the name of the site. It is not required but will be needed if multiple roads have the same name.
For example, the second parameter is not needed for the blog route but will be needed for the home or the contact routes.
elvandar/ec-bundle 适用场景与选型建议
elvandar/ec-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 11 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「cms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 elvandar/ec-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elvandar/ec-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 elvandar/ec-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
GraphQL authentication for your headless Craft CMS applications.
The bundle for easy using json-rpc api on your project
Set Links with a specific language parameter
Supercharged text field validation.
Bundle Symfony DaplosBundle
Integrate with Snipcart.
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-15