netgen / ibexa-xmltext-fieldtype
Ibexa OSS的XmlText字段类型实现
Requires
- php: ^7.4 || ^8.1
- ext-dom: *
- ext-xsl: *
- ibexa/content-forms: ^4.4
- ibexa/core: ^4.4
- ibexa/fieldtype-richtext: ^4.4
- ibexa/rest: ^4.4
Requires (Dev)
- friendsofphp/php-cs-fixer: v2.16.1
- ibexa/solr: ^4.4
- matthiasnoback/symfony-dependency-injection-test: ^4.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-08-30 01:39:40 UTC
README
这是eZ Platform的XmlText字段类型。它从eZ Publish / Platform 5.x中提取出来,因为它已经被基于docbook的RichText字段类型所取代。
支持限制
- 2.x:对于eZ Platform v3,此包仅支持将内容从XmlText字段类型迁移到RichText字段类型的目的。
- 1.x:对于eZ Platform v1 & v2,此包支持两种用例:迁移到RichText,以及通过平台前端*渲染。
* 虽然它通过平台管理UI支持编辑,但只能以原始xmltext形式在文本框中编辑,因此此字段类型的支持用途仅限于在旧版管理界面使用的情况下进行临时升级,并且前端代码正在开发/迁移到eZ Platform堆栈(包括到Symfony)。
安装
注意:此包已经捆绑了Legacy Bridge。但是,如果您更愿意1.直接将内容迁移到eZ Platform以充分利用它,或者2.不使用旧版,但需要在纯eZ Platform设置中为某些旧版内容使用此字段类型,请运行以下命令:
composer require --update-with-all-dependencies "ezsystems/ezplatform-xmltext-fieldtype"
最后,通过将new EzSystems\EzPlatformXmlTextFieldTypeBundle\EzSystemsEzPlatformXmlTextFieldTypeBundle(),
添加到app/AppKernel.php
中的包列表来启用此包。
一旦您迁移了内容,您可以从app/AppKernel.php
和composer.json
中删除此包。
从XmlText迁移到RichText
警告:从1.6版开始,这现在是完全支持的,但无论如何,在使用迁移工具之前始终进行备份。
此包提供工具将现有XmlText字段迁移到RichText,这是eZ Platform使用的丰富文本格式。该工具以Symfony命令ezxmltext:convert-to-richtext
的形式提供。
它将执行以下两件事:
- 将
ezxmltext
字段定义转换为ezrichtext
字段定义 - 将
ezxmltext
字段(内容)转换为ezrichtext
我们建议您首先进行测试运行,例如
php bin/console ezxmltext:convert-to-richtext -v --concurrency=2 --dry-run
使用-v
标志将日志输出到控制台,使其易于跟踪正在进行的转换工作。以下是单个字段成功转换日志条目的示例
[2016-02-03 15:25:52] app.INFO: Converted ezxmltext field #745 to richtext {"original":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<section xmlns:image=\"http://ez.no/namespaces/ezpublish3/image/\" xmlns:xhtml=\"http://ez.no/namespaces/ezpublish3/xhtml/\" xmlns:custom=\"http://ez.no/namespaces/ezpublish3/custom/\"/>\n","converted":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<section xmlns=\"http://docbook.org/ns/docbook\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:ezxhtml=\"http://ez.no/xmlns/ezpublish/docbook/xhtml\" xmlns:ezcustom=\"http://ez.no/xmlns/ezpublish/docbook/custom\" version=\"5.0-variant ezpublish-1.0\"/>\n"}
它包含在JSON结构中,包含original
(ezxmltext)值和写入数据库的converted
(ezrichtext)值。
一旦您准备好转换,删除-v
和--dry-run
。