2

I'm not sure if this is a Features module question or simply a module construction question.

I have a module which was constructed with Features, which I have never used before. In the .info file of the module there are a lot of lines that read similar to features[something][] = something.

What is this and where is it used in the module?

4

Some of the documentation is sparse (still!?) https://drupal.org/node/1720098

The entries in your .info file tell Features that that item of your configuration is controlled by Features and not say Drupal core. You'll see stuff like ctools or views in there. In the main features.inc file the features info hook will require those API dependancies.

Based upon other lines in the info file such as:

features[ctools][] = strongarm:strongarm:1
features[ctools][] = views:views_default:3.0
features[user_permission][] = create features_test content
features[views_view][] = features_test

These lines would say, features uses Strongarm to read/write configuration of variables, and Ctools integration. Then there is some view features_test and some user permission exported create features_test content.

From the documentation page i linked these .info configuration values then:

They are called during hook_module_enable/disable to fire the right stuff in the right places.

By Features itself. The info file contents tells Features what its managing. The .inc files include the dynamic configuration values needed per .info item entry (usually in terms of plain Drupal hook_info configuration definitions that'd you basically be making in code anyways).

I recommend reading the Features API and Readme:

http://drupalcode.org/project/features.git/blob/refs/heads/7.x-1.x:/API.txt

http://drupalcode.org/project/features.git/blob/refs/heads/7.x-1.x:/README.txt

  • Thank for the answer and the links! I will read through them and hopfully that will answer all of my questions. – user1015214 Aug 20 '13 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.