Skip to content
Everett Griffiths edited this page Mar 3, 2014 · 5 revisions

Repoman's export functionality is designed to get existing MODX objects (Chunks, Settings, Tvs, et al) from MODX and into your local repository. This is useful when you decide to roll up your sleeves and get your various bits of code organized and finally get it under version control and releasable as a MODX package.

Exporting can be complex because it revolves around database queries, and those queries can be complex. Before we go into specific examples, remember the following behavior:

  • Exporting is always from MODX to the filesystem. The goal of an export operation is having a file-based representation of an object or objects.
  • Elements (Chunks, Snippets, Templates and Plugins) are created as flat static file with a DocBlock -- this ensures that you'll be able to easily edit them. You can choose to "move" the elements by adjusting the source file to point to the new file location in the target repository.
  • All other Objects (e.g. System Settings) are created as JSON arrays, either in your database/objects/ directory or as seed data inside database/seeds/.

Examples

When exporting elements (e.g. Plugins or Templates), Repoman will automatically associate the common related objects (namely plugin-events and TVs)

php repoman export /path/to/my/package --classname=modTemplate

php repoman export /path/to/my/package --classname=modSnippet '--where={"name":"SomeSnippet"}'

Clone this wiki locally