You are here

README.txt in Features 6

Same filename and directory in other branches
  1. 7.2 README.txt
  2. 7 README.txt
Features 1.x for Drupal 6.x
---------------------------
The features module enables the capture and management of features in Drupal. A
feature is a collection of Drupal entities which taken together satisfy a
certain use-case.

Features provides a UI and API for taking different site building components
from modules with exportables and bundling them together in a single feature
module. A feature module is like any other Drupal module except that it declares
its components (e.g. views, contexts, CCK fields, etc.) in its `.info` file so
that it can be checked, updated, or reverted programmatically.

Examples of features might be:

- A blog
- A pressroom
- An image gallery
- An e-commerce t-shirt store


Installation
------------
Features can be installed like any other Drupal module -- place it in the
modules directory for your site and enable it on the `admin/build/modules` page.
To take full advantage of some of the workflow benefits provided by Features,
you should install [Drush][1].


Basic usage
-----------
Features is geared toward usage by developers and site builders. It
is not intended to be used by the general audience of your Drupal site.
Features provides tools for accomplishing two important tasks:

### Task 1: Export features

You can build features in Drupal by using site building tools that are supported
(see a short list under the *Compatibility* section).

Once you've built and configured functionality on a site, you can export it into
a feature module by using the feature create page at
`admin/build/features/create`.


### Task 2: Manage features

The features module also provides a way to manage features through a more
targeted interface than `admin/build/modules`. The interface at
`admin/build/features` shows you only feature modules, and will also inform you
if any of their components have been overridden. If this is the case, you can
also re-create features to bring the module code up to date with any changes
that have occurred in the database.


Including custom code and adding to your feature
------------------------------------------------
Once you've exported your feature you will see that you have several files:

    myfeature.info
    myfeature.module
    myfeature.[*].inc

You can add custom code (e.g. custom hook implementations, other functionality,
etc.) to your feature in `myfeature.module` as you would with any other module.
Do not change or add to any of the features `.inc` files unless you know what
you are doing. These files are written to by features on updates so any custom
changes may be overwritten.


Using Features to manage development
------------------------------------
Because Features provides a centralized way to manage exportable components and
write them to code it can be used during development in conjunction with a
version control like SVN or git as a way to manage changes between development,
staging and production sites. An example workflow for a developer using Features
is to:

1. Make configuration changes to a feature on her local development site.
2. Update her local feature codebase using `drush features-update`.
3. Commit those changes using `svn commit`.
4. Roll out her changes to the development site codebase by running `svn update`
  on the server. Other collaborating developers can also get her changes with
  `svn update`.
5. Reverting any configuration on the staging site to match the updated codebase
by running `drush features-revert`.
6. Rinse, repeat.

Features also provides integration with the [Diff][3] module if enabled to show
differences between configuration in the database and that in code. For site
builders interested in using Features for development, enabling the diff module
and reading `API.txt` for more details on the inner workings of Features is
highly recommended.


Drush usage
-----------
Features provides several useful drush commands:

- `drush features`

  List all the available features on your site and their status.

- `drush features-export [feature name] [component list]`

  Write a new feature in code containing the components listed.

- `drush features-update [feature name]`

  Update the code of an existing feature to include any overrides/changes in
  your database (e.g. a new view).

- `drush features-revert [feature name]`

  Revert the components of a feature in your site's database to the state
  described in your feature module's defaults.

- `drush features-diff [feature name]`

  Show a diff between a feature's database components and those in code.
  Requires the Diff module.

Additional commands and options can be found using `drush help`.


Compatibility
-------------
Features provides integration for the following exportables:

- CTools export API implementers (Context, Spaces, Boxes, Strongarm, Page
  Manager)
- ImageCache
- Views
- [Other contributed modules][2]

Features also provides faux-exportable functionality for the following Drupal
core and contrib components:

- CCK fields
- CCK fieldgroups
- Content types
- Input filters
- User roles/permissions
- Custom menus and menu links *
- Taxonomy vocabularies *

* Currently in development.


Security Concerns
-----------------
If you are using Features to export Roles and also use those Roles in other
exportable code (like Views filters) you can wind up with an unintended
security hole.  When you import your Feature, if the Roles do not get created
with the exact same Role IDs then your Views filters (or other component) will
be referencing a different Role than you intended.


For developers
--------------
Please read `API.txt` for more information about the concepts and integration
points in the Features module.


Maintainers
-----------
- yhahn (Young Hahn)
- jmiccolis (Jeff Miccolis)


[1]: http://drupal.org/project/drush
[2]: (http://drupal.org/taxonomy/term/11478)

File

README.txt
View source
  1. Features 1.x for Drupal 6.x
  2. ---------------------------
  3. The features module enables the capture and management of features in Drupal. A
  4. feature is a collection of Drupal entities which taken together satisfy a
  5. certain use-case.
  6. Features provides a UI and API for taking different site building components
  7. from modules with exportables and bundling them together in a single feature
  8. module. A feature module is like any other Drupal module except that it declares
  9. its components (e.g. views, contexts, CCK fields, etc.) in its `.info` file so
  10. that it can be checked, updated, or reverted programmatically.
  11. Examples of features might be:
  12. - A blog
  13. - A pressroom
  14. - An image gallery
  15. - An e-commerce t-shirt store
  16. Installation
  17. ------------
  18. Features can be installed like any other Drupal module -- place it in the
  19. modules directory for your site and enable it on the `admin/build/modules` page.
  20. To take full advantage of some of the workflow benefits provided by Features,
  21. you should install [Drush][1].
  22. Basic usage
  23. -----------
  24. Features is geared toward usage by developers and site builders. It
  25. is not intended to be used by the general audience of your Drupal site.
  26. Features provides tools for accomplishing two important tasks:
  27. ### Task 1: Export features
  28. You can build features in Drupal by using site building tools that are supported
  29. (see a short list under the *Compatibility* section).
  30. Once you've built and configured functionality on a site, you can export it into
  31. a feature module by using the feature create page at
  32. `admin/build/features/create`.
  33. ### Task 2: Manage features
  34. The features module also provides a way to manage features through a more
  35. targeted interface than `admin/build/modules`. The interface at
  36. `admin/build/features` shows you only feature modules, and will also inform you
  37. if any of their components have been overridden. If this is the case, you can
  38. also re-create features to bring the module code up to date with any changes
  39. that have occurred in the database.
  40. Including custom code and adding to your feature
  41. ------------------------------------------------
  42. Once you've exported your feature you will see that you have several files:
  43. myfeature.info
  44. myfeature.module
  45. myfeature.[*].inc
  46. You can add custom code (e.g. custom hook implementations, other functionality,
  47. etc.) to your feature in `myfeature.module` as you would with any other module.
  48. Do not change or add to any of the features `.inc` files unless you know what
  49. you are doing. These files are written to by features on updates so any custom
  50. changes may be overwritten.
  51. Using Features to manage development
  52. ------------------------------------
  53. Because Features provides a centralized way to manage exportable components and
  54. write them to code it can be used during development in conjunction with a
  55. version control like SVN or git as a way to manage changes between development,
  56. staging and production sites. An example workflow for a developer using Features
  57. is to:
  58. 1. Make configuration changes to a feature on her local development site.
  59. 2. Update her local feature codebase using `drush features-update`.
  60. 3. Commit those changes using `svn commit`.
  61. 4. Roll out her changes to the development site codebase by running `svn update`
  62. on the server. Other collaborating developers can also get her changes with
  63. `svn update`.
  64. 5. Reverting any configuration on the staging site to match the updated codebase
  65. by running `drush features-revert`.
  66. 6. Rinse, repeat.
  67. Features also provides integration with the [Diff][3] module if enabled to show
  68. differences between configuration in the database and that in code. For site
  69. builders interested in using Features for development, enabling the diff module
  70. and reading `API.txt` for more details on the inner workings of Features is
  71. highly recommended.
  72. Drush usage
  73. -----------
  74. Features provides several useful drush commands:
  75. - `drush features`
  76. List all the available features on your site and their status.
  77. - `drush features-export [feature name] [component list]`
  78. Write a new feature in code containing the components listed.
  79. - `drush features-update [feature name]`
  80. Update the code of an existing feature to include any overrides/changes in
  81. your database (e.g. a new view).
  82. - `drush features-revert [feature name]`
  83. Revert the components of a feature in your site's database to the state
  84. described in your feature module's defaults.
  85. - `drush features-diff [feature name]`
  86. Show a diff between a feature's database components and those in code.
  87. Requires the Diff module.
  88. Additional commands and options can be found using `drush help`.
  89. Compatibility
  90. -------------
  91. Features provides integration for the following exportables:
  92. - CTools export API implementers (Context, Spaces, Boxes, Strongarm, Page
  93. Manager)
  94. - ImageCache
  95. - Views
  96. - [Other contributed modules][2]
  97. Features also provides faux-exportable functionality for the following Drupal
  98. core and contrib components:
  99. - CCK fields
  100. - CCK fieldgroups
  101. - Content types
  102. - Input filters
  103. - User roles/permissions
  104. - Custom menus and menu links *
  105. - Taxonomy vocabularies *
  106. * Currently in development.
  107. Security Concerns
  108. -----------------
  109. If you are using Features to export Roles and also use those Roles in other
  110. exportable code (like Views filters) you can wind up with an unintended
  111. security hole. When you import your Feature, if the Roles do not get created
  112. with the exact same Role IDs then your Views filters (or other component) will
  113. be referencing a different Role than you intended.
  114. For developers
  115. --------------
  116. Please read `API.txt` for more information about the concepts and integration
  117. points in the Features module.
  118. Maintainers
  119. -----------
  120. - yhahn (Young Hahn)
  121. - jmiccolis (Jeff Miccolis)
  122. [1]: http://drupal.org/project/drush
  123. [2]: (http://drupal.org/taxonomy/term/11478)