dothiv / dothiv-contentful-bundle
此包已被废弃且不再维护。没有建议的替代包。
ContentfulBundle for the Symfony Framework
v0.2.1
2015-08-16 20:38 UTC
Requires
- doctrine/doctrine-bundle: 1.2.*
- doctrine/doctrine-cache-bundle: 1.0.x
- doctrine/orm: >=2.2.3,<2.4-dev
- dothiv/dothiv-valueobject-bundle: 1.x
- gedmo/doctrine-extensions: 2.3.*
- imagine/imagine: 0.6.*
- phpoption/phpoption: 1.4.*
- symfony/framework-bundle: ~2.3
- symfony/twig-bundle: 2.3.*
- symfony/validator: 2.3.*
- twig/extensions: 1.0.*
Requires (Dev)
This package is not auto-updated.
Last update: 2020-05-01 17:49:15 UTC
README
这是一个为提供本地可查询缓存的 Symfony2 包,用于 Contentful 条目和资产。
它是从 dothiv/dothiv 分离出来的子树。
配置
缓存需要数据库。
# Create database if not created before
sudo su postgres
psql
CREATE USER contentful;
CREATE DATABASE contentful;
GRANT ALL PRIVILEGES ON DATABASE contentful TO contentful;
ALTER USER contentful WITH PASSWORD 'password';
# Update the schema
app/console doctrine:schema:update --force
使用
同步内容
使用 app/console contentful:sync <access_token> 使内容在本地可用。
页面控制器
PageController
包含一个控制器,可以创建正确的缓存头。因为它只监听 contentful 项目日期,所以需要为应用程序定义最小修改。每次部署后运行此命令以设置它
app/console contentful:config last_modified_content.min_last_modified `date +%FT%T%z`