Exemplo n.º 1
0
 /**
  * Displays detailed bucket's logs for a given bucket Id
  * 
  * @param Integer $bucketId
  */
 protected function displayAlreadyAppliedPerBucket($bucketId)
 {
     echo '';
     $summary = $this->db->getBucketsSummarizedLogs($bucketId);
     if ($summary) {
         echo 'Start date' . "           " . 'Execution' . "  " . 'Status' . "  " . 'Id' . "  " . 'Script' . PHP_EOL;
         $logs = $summary->fetchAll();
         echo $this->displayColoriedStatus($logs[0]);
     }
     echo "Detailed logs execution for bucket " . $bucketId . PHP_EOL;
     $details = $this->db->getBucketsDetailedLogs($bucketId);
     if ($details) {
         echo 'Start date' . "           " . 'Level' . "  " . 'Message' . PHP_EOL;
         foreach ($details->fetchAll() as $row) {
             $level = $row['level'];
             $message = $row['timestamp'] . "  " . $level . "  " . $row['message'] . PHP_EOL;
             echo LoggerAppenderConsoleColor::chooseColor($level, $message);
         }
     }
 }
Exemplo n.º 2
0
        require $filePath;
        $dbDriverName = 'ForgeUpgrade_Db_Driver_' . $dbDriverName;
    } else {
        echo "Error: invalid --dbdriver" . PHP_EOL;
    }
}
try {
    $dbDriver = new $dbDriverName();
} catch (PDOException $e) {
    echo 'Connection faild: ' . $e->getMessage() . PHP_EOL;
    return -1;
}
// Special logger to display nice colors according to levels
$logger = Logger::getRootLogger();
$logger->removeAllAppenders();
$appender = new LoggerAppenderConsoleColor('LoggerAppenderConsoleColor');
$appender->setLayout(new LoggerLayoutSimple());
$appender->setThreshold($options['core']['verbose']);
$appender->activateOptions();
$logger->addAppender($appender);
// Go
$upg = new ForgeUpgrade($dbDriver);
$upg->setOptions($options);
$upg->run($func);
//
// Function definitions
//
/**
 * Print Help
 */
function usage()
Exemplo n.º 3
0
}
if ($func == 'help') {
    usage();
    exit;
}
// Get the DB connexion
try {
    $dbDriver = new $dbDriverName();
} catch (PDOException $e) {
    echo 'Connection faild: ' . $e->getMessage() . PHP_EOL;
    return -1;
}
// Go
$logger = Logger::getRootLogger();
$logger->removeAllAppenders();
$appender = new LoggerAppenderConsoleColor('LoggerAppenderConsoleColor');
$appender->setLayout(new LoggerLayoutTTCC());
$appender->activateOptions();
$logger->addAppender($appender);
$upg = new ForgeUpgrade($dbDriver);
$upg->setIncludePaths($includePaths);
$upg->setExcludePaths($excludePaths);
$upg->run($func, $paths);
//
// Function definitions
//
/**
 * Print Help
 */
function usage()
{