Hướng dẫn managing obsolete modules

Hướng dẫn managing obsolete modules

In every Drupal project, it is crucial for your application to be fully defined in code at every time and every state. When working with a configuration management based upon GitFeaturesDrush based shell scripts and Master, it is possible to represent your whole Drupal 7 application's configuration state in a traceable and reproducible way.

Watch your Drupal modules

This way your team has a good tool to manage the development of the application and even manage the state of the Drupal modules in your application. Especially in large Drupal projects it is always important to know the modules you are dealing with, what modules to enable and to know what modules you can disable. Even already disabled Drupal modules influence your system and the overall development experience of your team.

For example, if you provide a large set of modules in your project, there will be a lot of noise for the developers when working on the sprint issues (e.g. a developer might find search results in the IDE for a code snippet in modules that are not meant to be enabled anymore). Therefore it is important all modules that should not be enabled are really disabled and uninstalled from the Drupal project. And, if possible, after that the modules should be removed from the file disk. As we are (hopefully) always dealing with a version control system like Git, we are safe to remove those modules without losing any information of the project's evolution.

Remove modules with Master

In projects that have grown for several months and no-one had a look at the modules directory, it will be very painful and time intense to remove those obsolete modules. To ease such tasks in the development workflow, we created the Master module some time ago. With the latest release of Master, we have also introduced a new command to assist you in finding the modules you really don't need anymore in your directory.

With drush master-removables you will get a list of Drupal module directories that can be removed from the project's file system. When combining the command with the remove command, you can delete those modules from the file system:

rm -rf $(drush master-removables --absolute --pipe)

Make sure you checked the output of drush master-removables, especially when dealing with multiple environments (like develop, testing, live), you have to make sure all modules you are about to remove from the filesystem have been properly uninstalled before. For example, in Sprint 11, when your team decides they will not work with the Context module anymore, but it already has been rolled out and enabled in a previous sprint, they cannot simply remove Context from the Git repository in Sprint 11. That's because the module will be needed to successfully fire the uninstall procedure on the production-installation for that module in the next roll-out. So you may only fully delete the module after the roll-out was successful and make that change in the next sprint. Tip: When you stumble upon such a situation, simply remind yourself for this task in the next sprint by creating a new related issue in the backlog for that upcoming sprint.

Absent modules

In some cases, e.g. when carelessly updating or removing modules, there might be modules missing, although the Drupal installation needs them to be enabled. For example some module was removed although the module was still enabled. This might be a heavy performance impact, as Drupal will scan the module directories several times each Drupal bootstrap. This would be not good. To make sure we do not run into this scenario, the newest Master release also contains a command to list those modules that are not in the installation but should be present. With drush master-absent you will get a list of those modules and can fix the problems.

The command will also list those modules that are part of the master configuration or an unmet dependency of the master modules and are not present in the module directory.

Master development

We are curious about your experience with Master or other approaches of managing your modules' state. As we are currently working on a stable release for Drupal 7 your feedback is very welcome in the Master issue queue on drupal.org.

If you need any help in your Drupal development workflow, we will be happy to help with our professional Drupal service.

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Facebook - iOS14.5 chính thức update toàn và điều gì mong đợi

Facebook - iOS14.5 chính thức update toàn và điều gì mong đợi

Vào ngày 26.04.2021 Apple chính thức ra mắt rộng rãi phiên bản iOS 14.5. kèm theo đó là những động thái rất ráo riết của các nền quảng cáo trong đó có Facebook

Quản lý hiện thị Drupal Nodes bằng content Access.module

Quản lý hiện thị Drupal Nodes bằng content Access.module

Sometimes in Drupal there are many solutions to a problem. One such problem is controlling who can see which content on your site.

Google chính thức bổ sung phương thức quảng cáo video trên Youtube

Google chính thức bổ sung phương thức quảng cáo video trên Youtube

Mọi người hẳn đã quá quen với Google Adwords, công cụ quảng cáo nổi tiếng nhất và có hiệu quả cao nhất đối với cả túi tiền của khách hàng và cả của gã khổng lồ Google. Mới đây Youtube đã thiết kế một khung hình động quen thuộc cho phép các hãng tận dụng sự bùng nổ của video trên Internet để quảng cáo thương hiệu của mình, được gọi là Google AdWords cho Video.

Công ty diệt chuột T&C

 

Diet con trung