<?xml version="1.0" encoding="utf-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.loader.classmap-generator">
    <title>The Class Map Generator utility: bin/classmap_generator.php</title>

    <sect2 id="zend.loader.classmap-generator.intro">
        <title>Overview</title>

        <para>
            The script <filename>bin/classmap_generator.php</filename> can be used to generate class
            map files for use with <link linkend="zend.loader.class-map-autoloader">the
                ClassMapAutoloader</link>.
        </para>

        <para>
            Internally, it consumes both <link linkend="zend.console.getopt">Zend_Console_Getopt</link> (for parsing command-line
            options) and <link linkend="zend.file.class-file-locater">Zend_File_ClassFileLocater</link> for
            recursively finding all PHP class files in a given tree.
        </para>
    </sect2>

    <sect2 id="zend.loader.classmap-generator.quick-start">
        <title>Quick Start</title>

        <para>
            You may run the script over any directory containing source code. By default, it will
            look in the current directory, and will write the script to
            <filename>autoload_classmap.php</filename> in the directory you specify.
        </para>

        <programlisting language="sh"><![CDATA[
php classmap_generator.php Some/Directory/
]]></programlisting>

    </sect2>

    <sect2 id="zend.loader.classmap-generator.options">
        <title>Configuration Options</title>

        <variablelist>
            <title>Class Map Generator Options</title>

            <varlistentry>
                <term>--help or -h</term>

                <listitem>
                    <para>
                        Returns the usage message. If any other options are provided, they will be
                        ignored.
                    </para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term>--library or -l</term>

                <listitem>
                    <para>
                        Expects a single argument, a string specifying the library directory to
                        parse. If this option is not specified, it will assume the current working
                        directory.
                    </para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term>--output or -o</term>

                <listitem>
                    <para>
                        Where to write the autoload class map file. If not provided, assumes
                        "autoload_classmap.php" in the library directory.
                    </para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term>--overwrite or -w</term>

                <listitem>
                    <para>
                        If an autoload class map file already exists with the name as specified via
                        the <varname>--output</varname> option, you can overwrite it by specifying
                        this flag. Otherwise, the script will not write the class map and return a
                        warning.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </sect2>
</sect1>
