Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Configuration

Jon Ursenbach edited this page Jan 31, 2017 · 31 revisions

In order to instruct Mill on where to look for documentation, and any constraints you may have, Mill requires the use of an XML configuration file (mill.xml).

<?xml version="1.0" encoding="UTF-8"?>
<mill
    name="Movie showtimes API"
    sinceApiVersion="1.0"
    defaultApiVersion="1.1"
    latestApiVersion="1.2"
    bootstrap="vendor/autoload.php"
>
    <controllers>
        <filter>
            <directory name="src/Controllers/" suffix=".php" />
        </filter>
    </controllers>

    <representations>
        <filter>
            <directory name="src/Representations/" method="create" suffix=".php"  />

            <class name="\My\Application\Representations\Representation" noMethod="true" />

            <exclude>
                <class name="\My\Application\Representations\Error" />
                <class name="\My\Application\Representations\CodedError" />
            </exclude>
        </filter>

        <errors>
            <class name="\My\Application\Representations\Error" needsErrorCode="false" />
            <class name="\My\Application\Representations\CodedError" needsErrorCode="true" />
        </errors>
    </representations>
</mill>

Mill has an included XML schema definition which you can use and reference if you'd like.

Options

Option Optional Description
sinceApiVersion 🚫 This is the first version of your API. eg: "1.0"
defaultApiVersion If you happen to have a latest API version that's different than that normal developers of your API get, this is your "default" API version. So if your latest is "1.2", but normal users are on "1.1", this would be "1.1".
latestApiVersion The absolute latest version of your API.
bootstrap 🚫 Relative path to a PHP bootstrap file that will get loaded before Mill does any work. This is usually a Composer vendor/autoload.php file. This is necessary so Mill can access, and parse your API classes for documentation.

Clone this wiki locally