2017 © Pedro Peláez
 

library console-command-service-provider

A Silex Service Provider for common console commands for Cache, Doctrine DBAL, and Assetic

image

essgeebee/console-command-service-provider

A Silex Service Provider for common console commands for Cache, Doctrine DBAL, and Assetic

  • Tuesday, April 8, 2014
  • by tentwofour
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

console-command-service-provider

A Silex Service Provider for common console commands for Cache, Doctrine DBAL, and Assetic, (*1)

Installing

Add the dependency to your composer.json, (*2)

"essgeebee/console-command-service-provider"    : "dev-master"

Installing the skeleton app/console and src/console.php files

Note that these files assume a particular project structure - see the templates/console file for more details, (*3)

Add to your composer.json, (*4)

"autoload": {
        "psr-0": { 
          ...
          "Ten24": "vendor/essgeebee/console-command-service-provider/src/" 
        }
    },
...    
"scripts": {
        "post-install-cmd": [ 
            "Ten24\\Composer\\ConsoleCommandInstaller::postInstallCmd"
        ],
        "post-update-cmd": [ 
            "Ten24\\Composer\\ConsoleCommandInstaller::postUpdateCmd"
        ]
    }

Run, (*5)

composer run-script post-update-cmd

or, (*6)

composer run-script post-install-cmd

This will attempt to create the directories 'app' and 'src' at the root of your project if they don't exist, and copy templates/console and templates/console.php to app/ and src/, respectively., (*7)

From your terminal, you should now be able to run, (*8)

app/console

and get something to this effect:, (*9)

MyProject version 0.1

Usage:
  [options] command [arguments]

Options:
  --help           -h Display this help message.
  --quiet          -q Do not output any message.
  --verbose        -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
  --version        -V Display this application version.
  --ansi              Force ANSI output.
  --no-ansi           Disable ANSI output.
  --no-interaction -n Do not ask any interactive question.

Available commands:
  help                       Displays help for a command
  list                       Lists commands
assetic
  assetic:dump               Dumps all assets to the filesystem
cache
  cache:clear                Clears the cache
doctrine
  doctrine:database:create   Creates the configured databases
  doctrine:database:drop     Drops the configured databases
  doctrine:schema:load       Load schema
  doctrine:schema:show       Output schema declaration

Registered Commands

By default, the following commands are registered to the console: - doctrine:schema:show - doctrine:schema:load - doctrine:database:create - doctrine:database:drop - cache:clear - assetic:dump, (*10)

Configuration Options

The Provider looks for its options within the $app['ten24.consolecommand.options']. Here's a list of the available options - all keys within $app['ten24.consolecommand.options']. Note that the required options do have a default value, that may not align to your project structure., (*11)

  • doctrine
    • schemaFile (required, default: $app['root.dir']./app/config/database/schema.php)
    • registerSchemaShow (optional, default: true)
    • registerSchemaLoad (optional, default: true)
    • registerDatabaseDrop (optional, default: true)
    • registerDatabaseCreate (optional, default: true)
  • cache
    • cachePath (required, default: $app['root.dir']./app/cache)
    • registerClear (optional, default: true)
  • assetic
    • registerDump (optional, default: true)

The Versions

08/04 2014

dev-master

9999999-dev

A Silex Service Provider for common console commands for Cache, Doctrine DBAL, and Assetic

  Sources   Download

Unlicense

The Requires

 

The Development Requires

silex service-provider