added a comment - - edited
Valid point; I hadn't considered that .zfproject.xml would end up out of sync with the actual project directory structure.
In the patch I attached zf disable layout removes the layout config entry from application.ini and associated layout information from .zfproject.xml, but leaves the layout scripts intact.
When you call zf enable layout after calling zf disable layout it will add the resources.layout.layoutPath entry in [production] section. Unless run in pretend mode, zf enable layout always calls Zend_Tool_Project_Provider_Layout::createResource, which updates the .zfproject.xml file with the structure Kim outlined in his comment on 30/Jun/2011 @ 2:26PM. If i'm reading the code correctly, then zf enable layout will always overwrite the existing layout script file, ( Zend_Tool_Project_Provider_Layout::enable always calls $layoutScriptFile->create())
Should we consider changing that behaviour? ie: zf disable layout comments out layout lines in application.ini, zf enable layout enables commented-out lines (or creates new ones if they don't already exist) and doesn't overwrite an existing layout file
Kim, I've cleaned up your patch a little (modified formatting and output messages to match existing code, removed some unnecessary lines) and added code to remove the layoutsDirectory entry from .zfproject.xml when zf disable layout is called.
I've attached the patch, and will commit it soon. Can you try it out for me first to make sure the changes I added are OK?