<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>features | 伪架构师</title>
    <link>/tags/features/</link>
      <atom:link href="/tags/features/index.xml" rel="self" type="application/rss+xml" />
    <description>features</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>zh</language><lastBuildDate>Thu, 13 Aug 2015 23:48:21 +0800</lastBuildDate>
    <image>
      <url>/img/logo-wide.png</url>
      <title>features</title>
      <link>/tags/features/</link>
    </image>
    
    <item>
      <title>使用Deploy和Features导出Entities</title>
      <link>/post/drupal-export-entity-with-deploy-and-features/</link>
      <pubDate>Thu, 13 Aug 2015 23:48:21 +0800</pubDate>
      <guid>/post/drupal-export-entity-with-deploy-and-features/</guid>
      <description>&lt;p&gt;Deploy Module可以把任何支持UUID的Entity导出到Features中。这个功能在创建安装范本或演示时非常有用，或者用于处理一些既非配置，也非内容的对象。&lt;/p&gt;

&lt;p&gt;使用Deploy导出内容：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href=&#34;http://drupal.org/node/1406134&#34; target=&#34;_blank&#34;&gt;安装Deploy&lt;/a&gt;和&lt;a href=&#34;http://drupal.org/project/features&#34; target=&#34;_blank&#34;&gt;Features&lt;/a&gt;。如果不需要使用Deploy进行Drupal站点之间的内容同步，知识想要导出到Features的话，就无需关心Service Module的安装了。&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;进入&lt;code&gt;admin/structure/deploy/plans/add&lt;/code&gt;建立一个新的部署计划。&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;选择聚合方式，参考&lt;a href=&#34;http://drupal.org/node/1406136&#34; target=&#34;_blank&#34;&gt;Deploy基础用法&lt;/a&gt;，来获取关于将内容加入部署计划的不同方法。&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;选择&lt;code&gt;Fetch only&lt;/code&gt;，因为我们不需要部署处理，也不需要服务节点，而且没有选择这个选项的话，部署计划也不会出现在Features界面中。&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;进入&lt;code&gt;admin/structure/features/create&lt;/code&gt;菜单。&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;在&lt;code&gt;Deployment(deploy_pnas)&lt;/code&gt;中，为新建的部署计划选择组件。&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;在&lt;code&gt;UUID Entities(uuid_entities)&lt;/code&gt;中，会发现一个和部署计划同名的组件，选择之。&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;注意，上文提到的选择，不会自动提供对内容类型、字段、模块等依赖关系的处理。所以要清楚导出内容的外部依赖。如果只是导出内容到相似或相同的站点，或者利用其他的Features来解决依赖关系，最好只导出部署计划以及相关的Entity组件。&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;需要导出的内容需要支持UUID。&lt;a href=&#34;http://drupal.org/project/entity_uuid&#34; target=&#34;_blank&#34;&gt;Entity UUID&lt;/a&gt;项目为非核心Entity提供了支持。要给Commerce Entity提供UUID支持，可移步到&lt;a href=&#34;http://drupal.org/project/commerce_uuid&#34; target=&#34;_blank&#34;&gt;Commerce UUID&lt;/a&gt;。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;变通做法：&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;http://drupal.org/project/uuid_features&#34; target=&#34;_blank&#34;&gt;UUID Features Integration&lt;/a&gt;模块提供了一种简单的导出内容到Features的方式，不过她主要支持的是核心Entity。使用Deploy，只要有UUID支持的Entity都是可导出的。如果你只是想要导出核心Entity，那么这种无需更多配置的方式可能更简单。&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
