Commit ff582aae authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

- Ajout des binaires pour l'utilisation en ligne de commande

 - Up du gitignore
parent be076acb
Loading
Loading
Loading
Loading
+1 −0
Changes for .gitignore: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
node_modules
.idea
+1 −1
Changes for bin/unicaen-signature: 1 added line, 1 removed line.
Original line number Diff line number Diff line
#!/usr/bin/env php
<?php

include(__DIR__ . '/doctrine-module.php');
 No newline at end of file
include(__DIR__ . '/unicaen-signature.php');
 No newline at end of file
+5 −1
Changes for bin/unicaen-signature.php: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -33,11 +33,11 @@ if (is_readable('init_autoloader.php')) {
    throw new RuntimeException('Error: vendor/autoload.php could not be found. Did you run php composer.phar install?');
}

$console = new \Symfony\Component\Console\Application();
$appConfig = include 'config/application.config.php';
if (file_exists('config/development.config.php')) {
    $appConfig = ArrayUtils::merge($appConfig, include 'config/development.config.php');
}

$app = Application::init($appConfig);

$commands = [];
@@ -78,7 +78,11 @@ function scanCommandFiles(string $namespace, string $dir){
}

foreach ($paths as $namespace=>$path) {
    // On ne garde que UnicaenSignature ici
    // TODO Trouver un système plus propre en allant voir sur Doctrine comment c'est fait
    if( $namespace == "UnicaenSignature\Command\\" ) {
        $commands = scanCommandFiles($namespace, $path);
        $console->addCommands($commands);
    }
}
exit($console->run());
 No newline at end of file