public function createConfiguration(array $options)
    {
        if (isset($options['file'])) {
            $sourceSpec = array(
                'filepath' => $options['file']
            );
            $f = $options['file'];
        } else {
            // strip controller options
            $sourceSpec = array(
                'content' => $options['content'],
                'id' => $options['id'],
            );
            $f = $options['id'];
            unset($options['content'], $options['id']);
        }
        // something like "builder,index.php" or "directory,file.html"
        $selectionId = strtr(substr($f, 1 + strlen(dirname(dirname($f)))), '/\\', ',,');

        if (isset($options['minifyAll'])) {
            // this will be the 2nd argument passed to Minify_HTML::minify()
            $sourceSpec['minifyOptions'] = array(
                'cssMinifier' => array('Minify_CSSmin', 'minify'),
                'jsMinifier' => array('JSMin\\JSMin', 'minify'),
            );
            unset($options['minifyAll']);
        }

        $sourceSpec['contentType'] = Minify::TYPE_HTML;
        $sources[] = new Minify_Source($sourceSpec);

        return new Minify_ServeConfiguration($options, $sources, $selectionId);
    }