Creates data model visualisations of SilverStripe DataObjects, showing fields, relations and ancestry. Can output images in .png, .svg and raw GraphViz "dot" format. Flexible configuration options and can be called from command line and URL.
Example call: http://example.com/Silvergraph/png?location=cms,framework,mysite
- Composer/Packagist: Install composer, run
composer require froog/silvergraph(* for version) and visit?flush=1to update the routing table. - Manual: Download and extract silvergraph as
SilverGraphfolder in the top level of your site and visit?flush=1to update the routing table.
- Install Graphviz via Homebrew:
brew install graphvizand note down the location - Add the location to your
_ss_environment.phpfile, postpending 'dot' to the end of the path, e.g.:define('SILVERGRAPH_GRAPHVIZ_PATH', '/usr/local/Cellar/graphviz/2.38.0/bin/dot'); - Visit
?flush=1to update the routing table.
- SilverStripe 3.0.0+
- To create images: GraphViz (latest version) http://www.graphviz.org/
- To install (Debian/Ubuntu):
apt-get install graphviz
- Default png image:
sake Silvergraph/png > datamodel.png - Parameters:
sake Silvergraph/png location=mysite,cms inherited=1 exclude=SiteTree > datamodel.png - Default dot file:
sake Silvergraph/dot > datamodel.dot
- Default png image: http://example.com/Silvergraph/png
- Parameters: http://example.com/Silvergraph/png?location=mysite,cms&inherited=1&exclude=SiteTree
- Default dot file: http://example.com/Silvergraph/dot
location=mysite(default) Only graph classes under the /mysite folderlocation=/Graph ALL classes in every module (warning - may take a long time and could generate a large .png)location=mysite,mymoduleOnly graph classes under /mysite and /mymodule folders
exclude=SiteTreeexclude=SiteTree,File
relations=0Don't show any relationsrelations=1(default) Don't show inherited relationsrelations=2Show inherited relations (verbose)
fields=0Don't show any fieldsfields=1(default) Show only fields defined on selffields=2Show inherited fields (verbose)
ancestry=0Don't show any ancestry relationsancestry=1(default) Show ancestry relations
include-root=0(default) Don't graph DataObjectinclude-root=1Graph DataObject
group=0(default) Don't group by modulesgroup=1Group the modules into their own container
rankdir=xWhere x isTB(default) ,LR,RL, orBT(top-bottom, left-right, right-left, bottom-top)
