Esempio n. 1
0
 /**
  * Converts the known connections to XML and converts to a Propel-friendly conf file
  * 
  * @param boolean $system
  * @param boolean $nonSystem
  * @param boolean $quiet 
  */
 protected function buildConnections($system, $nonSystem, $quiet)
 {
     $opts = array();
     if ($system) {
         $opts[] = '--system';
     }
     if ($nonSystem) {
         $opts[] = '--non-system';
     }
     if ($quiet) {
         $opts[] = '--quiet';
     }
     Meshing_Console_Utils::runCommand('Meshing_Console_Command_Connection_Regen', $opts);
 }
Esempio n. 2
0
 /**
  * Provides either a command listing or specific command help
  * 
  * @todo Expand internal help format to specify whether a boolean switch is mandatory
  */
 public function run()
 {
     // Reads the commands dynamically from the file system
     $commands = Meshing_Console_Utils::getCommands(true);
     if (array_key_exists(0, $this->argv)) {
         $command = $this->argv[0];
         if ($className = array_search($command, $commands)) {
             $this->commandHelp($className);
         } else {
             throw new Zend_Console_Getopt_Exception('Command not recognised (use no arguments to see list)');
         }
     } else {
         $this->generalHelp();
     }
 }
Esempio n. 3
0
 public function run()
 {
     $commands = Meshing_Console_Utils::getCommands($this->opts->hidden);
     $this->listCommands($commands);
 }
Esempio n. 4
0
<?php

// System initialisation (some hardwiring required before autoloader kicks in)
$projectRoot = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..');
require_once $projectRoot . '/lib/Meshing/Paths.php';
require_once $projectRoot . '/lib/Meshing/Utils.php';
Meshing_Utils::initialise(new Meshing_Paths());
// Pop off the script name, grab the command, pop again
array_shift($argv);
$command = array_key_exists(0, $argv) ? $argv[0] : null;
array_shift($argv);
if ($command) {
    $className = Meshing_Console_Utils::getCommandClass($command);
    if ($className === false) {
        echo "Unrecognised command.\n";
        exit(1);
    }
} else {
    $className = 'Meshing_Console_Command_Help';
}
// Run the implementation
try {
    $ok = Meshing_Console_Utils::runCommand($className, $argv);
} catch (Zend_Console_Getopt_Exception $e) {
    echo $e->getMessage() . "\n";
    exit(1);
} catch (Meshing_Console_RunException $e) {
    echo $e->getMessage() . "\n";
    exit(2);
}