title: How to create composer library package that auto generates code when included
body: <p>Every time I create a new PHP project I basically use the same MVC folder structure that I adopted and like, I use the same base classes, interfaces, and the same PDO DAL implementation.
  When I'm creating a new project I copy&amp;paste all the needed files to the new project in addition to few changes, like changes to namespaces (to match the new project name) etc.</p>
  
  <p>I thought, why not creating a simple script to copy those files and folders, and make the additional changes.
  So now, when I create a new project I just run the script and the code is generated automatically, which is much nicer.</p>
  
  <p>And then I thought, I want it to be even simpler. I don't want to save the code in my computer, I want to save it on Github, and since I use and love composer, I thought I will make the Github project a composer package.
  But when trying to implement it I realized that I can't make the new composer package auto generate the code that I want, or at least I don't know how to make it do that.
  I tried googling it with no success.</p>
  
  <p>Does anyone knows how to achieve this?</p>