antwebes / api-social-bundle
Symfony2 扩展包,用于通过 chatsfree API 构建社交功能
dev-develop
2017-03-23 09:50 UTC
Requires
- antwebes/chatea-client-bundle: dev-symfony_28
Requires (Dev)
- mockery/mockery: @stable
- phpunit/phpunit: @stable
- raulfraile/ladybug: ~1.0
- symfony/dependency-injection: >v2.3
- symfony/framework-bundle: >v2.3
This package is auto-updated.
Last update: 2024-08-29 03:36:43 UTC
README
用于 ChatBoilerplate 项目的 Symfony2 扩展包,通过 ChateaClientBundle 使使用 api.chatea.net 的 API 变得更加容易,可以列出用户和频道。
安装
-
将 Bundle 包含到 AppKernel.php 中(ApiSocialBundle)
new Ant\Bundle\ApiSocialBundle\ApiSocialBundle(),
-
包含 routing.yml
api_social:
resource: "@ApiSocialBundle/Resources/config/routing.yml"
prefix: /
- 即可使用
配置
您可以为获取用户定义一些过滤器。现在您可以设置语言,以获取特定语言的用户。
在您的 parameters.yml 中定义以下参数以修改默认语言(es),例如
parameters:
users.language: 'en'
您还可以在应用程序配置(app/config/config.yml
)下的 api_social 中建立最后访问或窥视显示的限制。如果没有配置,则默认值为 3。
api_social;
visits_limit: 5
voyeur_limit: 5
此外,您还可以使用 users_orders 选项指定排序用户列表的列(默认没有指定排序)。例如
api_social:
users_orders:
lastLogin: desc
hasProfilePhoto: desc
频道列表的排序也可以在 channels_orders 选项下配置,默认排序为粉丝数量降序。例如,要按名称升序排序,应在配置中放置以下内容
api_social:
channels_orders:
lastLogin: asc
要在热门照片列表中显示的照片必须具有的最小投票数可以在 minimum_votes_for_popular_photos
选项下配置。例如
api_social;
minimum_votes_for_popular_photos: 5
其他参数:realtime_endpoint: http://127.0.0.1:8000