Building on the new syntax used to pass arguments to exportable default_hooks, here is a patch that also allows the exportable to specify a different file for a specific function output. For example, placing some exportable functions in the component-specific file, while placing other functions (like alter hooks) into the main features.inc exported file.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | features_different_export_files-1479068-5.patch | 1.26 KB | mpotter |
| #2 | features_different_export_files-1479068-2.patch | 1.29 KB | mpotter |
| #1 | features_different_export_files-1479068-1.patch | 826 bytes | mpotter |
Comments
Comment #1
mpotter commentedHere is the patch:
Comment #2
mpotter commentedHere is a new version that also prevents Features from creating an empty file when no content was written to it.
Comment #3
rypit commentedTested this with patch on a myriad of features: created, diffed, updated and reverted exportables of context, boxes, views, menus, taxonomies and fields. All work as intended.
Comment #4
hefox commentedThe if else could just be simplified as
$code = array_filter($code); before the foreach
Not sure if worth needs working it for that.
Comment #5
mpotter commentedYep, good suggestion. Here is the new patch.
Comment #6
mpotter commentedCommitted to 7179946
Comment #7
mpotter commented