示例#1
0
文件: Base.php 项目: halfer/Meshing
 /**
  * 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);
 }
示例#2
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);
}