The YamlDirectoryCreator code combined with an example module for drupal.