SilverStripe API docs for the core system in different versions, generated through Sami.
- The documentation is generated from working copies located in
src/. This folder is initially empty, the working copies are created through
- The PHP code does not have to be accessible through the website, all documents are static HTML files.
- All generated content to be viewed publicly should be stored in the
- Set up your vhost to serve from
- PHP 7.0 or newer
- Clone the repo to your local development environment
composer installwhich will install Sami
makedoc.shto build the static API docs (will take some time and generates ~900Mb new files)
Generate the Docs
- Run the
makedoc.shscript as a cronjob, usually a nightly run at 3am is fine:
0 3 * * * /sites/api/www/makedoc.sh
Add a New Version
- Copy a version section block in
sami.jsonand ensure you use the appropriate value for
versionmapdepending on whether the module started its life at version 1 or version 4 (for SilverStripe 4)
makedoc.shand confirm the generation runs through properly
- Make a commit of the updated
- Update the redirections in
.htaccessto the stable version number (if changing major versions)
- Make a separate commit with the redirection (explained in deployment below)
Please note: Often the
master branch will be representing an unstable major version. When this needs
to be updated, please edit
Deployment to production
This is now hosted on SilverStripe Platform, you can deploy from the dashboard.
makedoc.sh is run on a nightly cron as defined in
The project comes with a simple PHP script to convert PHP symbols (classes, methods, properties)
to their URL representations in the API docs, and redirects there.
The lookup is primarily used by doc.silverstripe.org
to drive its custom
[api:<symbol-name>] links in Markdown, without coupling it tightly
to the used API generator URL layout.
q: (required) Class name, method name (
), as well as property name ((::$
version: (optional) Version of the targeted module. Should map to a folder name. Defaults to trunk. Will switch current unstable major version (e.g. 4) to "master".
module: (optional) Module name. Should map to a folder name. Defaults to framework.
trunkversion of framework
3.0version of framework
3.6version of framework (or whatever is the latest stable minor version)
DPSPaymentclass docs in the
master(4.x) version of framework
While SilverStripe self-hosts this project, community contributions to the code are very welcome :) Please check out our guide to contributing code on silverstripe.org