简体   繁体   English

Drupal 8(带树枝)开发

[英]Drupal 8 (with twig) development

we're developing a drupal 8 site with several developers. 我们正在与几个开发人员一起开发一个drupal 8网站。 Therefor, each one of us has his own drupal instance on the dev machine (to avoid getting errors with different template file states and stuff), and they are set up like this: 因此,我们每个人在开发机器上都有自己的drupal实例(以避免在使用不同的模板文件状态和内容时出错),并且它们的设置如下:

  • /srv/www/devDudeA/html (instance A root) / srv / www / devDudeA / html(实例A根)
  • /srv/www/devDudeB/html (instance B root) / srv / www / devDudeB / html(实例B根)
  • /srv/www/devDudeC/html (instance C root) / srv / www / devDudeC / html(实例C根)
  • and so on... 等等...

These instances are all connected to the SAME database. 这些实例都连接到SAME数据库。 After writing a twig extension module (delivering a necessary twig filter) and activating it, some of my colleagues are getting several exceptions (saying the module couldn't be found), though they definitely have the same module files like me. 在编写了树枝扩展模块(提供了必要的树枝过滤器)并激活它之后,我的一些同事遇到了几个异常(说找不到该模块),尽管他们肯定有和我一样的模块文件。

Do you know of trouble using the same database from different hosts? 您是否知道在来自不同主机的同一数据库中遇到麻烦? I suspect the cache is causing trouble (because i found some paths entries containing "devDudeA" or "devDudeB" in the database. 我怀疑缓存正在引起麻烦(因为我在数据库中找到了一些包含“ devDudeA”或“ devDudeB”的路径条目。

In my opinion the requiredments should be satisfied: 我认为这些要求应该得到满足:

  • same module files in the same directory on each instance 每个实例的相同目录中的相同模块文件
  • same module information from (same) DB 来自(相同)数据库的相同模块信息

IMHO there is the opcache and also a memcache. 恕我直言,有操作缓存和内存缓存。 The integrated twig engine also has his own cache. 集成的树枝引擎还具有自己的缓存。 Could it be a problem that one of us has his caching enabled while the others don't? 我们中的一个人启用了缓存,而其他人没有启用缓存,这可能是一个问题吗?

Im just getting crazy about this (Ox). 我对此(Ox)感到疯狂。 Do you have any relevant instructions for me? 您对我有任何相关指示吗?

Thanks in advance & kind regards! 在此先感谢您的光临!

If you are going to have multiple devs actively working on multiple sites with a shared database odd bugs like this are going to come up. 如果您要让多个开发人员在具有共享数据库的多个站点上积极工作,那么将出现类似这样的奇怪错误。 Likely a cache rebuild will resolve it, but a similar error may appear for another user. 重建缓存可能会解决该问题,但是对于另一个用户可能会出现类似的错误。 Basically you are doing something Drupal doesn't want to do. 基本上,您正在做Drupal不想做的事情。

Since you're in Drupal 8 the reasons people used for shared databases in Drupal 7 and before are largely gone. 由于您在Drupal 8中,因此人们在Drupal 7及更高版本中使用共享数据库的原因已基本消失。 The Drupal 8 configuration management system is a vast improvement over the previous versions. Drupal 8配置管理系统是对先前版本的巨大改进。 You can now move site configuration using YML files between instances of the site. 现在,您可以在站点实例之间使用YML文件移动站点配置。 Those files can be managed with the rest of your code. 这些文件可以用其余的代码进行管理。

And you can look at using the deploy module (and supporting modules) to move content between instances. 您可以查看如何使用部署模块 (和支持模块)在实例之间移动内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM