Skip to content
Kevin Herrera edited this page Aug 16, 2016 · 1 revision

The following is an example build configuration file for Composer.

# Make the application executable.
chmod: 0755

# Filter unwanted files and directories.
filter:

    # Exclude some unwanted paths.
    exclude:

        name:

            # Exclude SCM directories.
            - '.git'

            # Exclude Composer package manifests.
            - 'composer.json'

        path:

            # Exclude the PHAR compiler script.
            - 'src/Composer/Compiler.php'

            # Exclude installation metadata.
            - 'vendor/composer/installed.json'

        regex:

            # Exclude documentation.
            - '/docs/'

            # Exclude test cases.
            - '/[Tt]ests/'

    # Includes some wanted paths.
    include:

        name:

            # Include licenses.
            - 'LICENSE'

        path:

            # Include the main script.
            - 'bin/composer'

            # Include the certificate authority bundle.
            - 'vendor/composer/ca-bundle/res/cacert.pem'

            # Include the hidden input manager.
            - 'vendor/seld/cli-prompt/res/hiddeninput.exe'

        regex:

            # Include JSON files.
            - '/\.json$/'

            # Include PHP scripts.
            - '/\.php$/'

# Modify the contents of some files.
replace:

    files:

        # Remove the shebang line from the main script.
        'bin/composer':
            '/^#![^\n\r]+[\n\r]+/m': ''

# The Sqon build configuration.
sqon:

    # Enable file compression.
    compression: GZIP

    # Use the executable as the main script.
    main: 'bin/composer'

    # Commit to "composer.sqon".
    output: 'composer.sqon'

    # List paths we want to include in the Sqon.
    paths:
        - 'bin/composer'
        - 'res'
        - 'src'
        - 'vendor/autoload.php'
        - 'vendor/composer'
        - 'vendor/justinrainbow/json-schema'
        - 'vendor/psr'
        - 'vendor/seld/cli-prompt'
        - 'vendor/seld/jsonlint'
        - 'vendor/symfony'

    # Load some necessary plugins.
    plugins:
        - class: Sqon\Builder\Plugin\Chmod
        - class: Sqon\Builder\Plugin\Filter
        - class: Sqon\Builder\Plugin\Replace

    # The PHP bootstrap script needs a shebang line.
    shebang: '#!/usr/bin/env php'

Notes

  • Requires sqon/app 0.2.0, the chdir() call is removed.
  • Git information placeholders are not replaced.
  • PHP scripts are not compacted.
  • The custom stubs are not used.
    • There is no apc check.
    • The COMPOSER_DEV_WARNING_TIME constant is not defined.
Clone this wiki locally