Is it possible to create a custom PHP Composer installer that places code in multiple different directories? I would like to link to a repository that is setup like this:
/trunk
- /public
- /library
- /content
and composer extract that to
/myproject/public
/myproject/library
/myproject/content
Is that possible? I know I need a custom installer to do this, but I’m not exactly sure how to setup the installer to export code from the repo and put it in multiple different directories.
You can create a custom installer which takes care of installing your packages into these directories. You indicate which custom installer is to be used using the “type” attribute on a package. Custom installers allow you to run any PHP code after downloading a package, so you can do anything there you can think of, in particular move different files to different places. For further details on creating a custom installer please see http://getcomposer.org/doc/articles/custom-installers.md
In general though I agree with what people commented on your question, you really should not do this to begin with. Try and restructure your project so you do not need this functionality and you will save yourself a lot of work.