Exemple #1
0
        $class = "\\yentu\\commands\\" . ucfirst($options['__command__']);
        unset($options['__command__']);
        Config::readPath(Yentu::getPath('config'), 'yentu');
        $command = new $class();
        $command->run($options);
    } else {
        ClearIce::output(ClearIce::getHelpMessage());
    }
} catch (\yentu\exceptions\CommandException $e) {
    ClearIce::resetOutputLevel();
    ClearIce::error("Error! " . $e->getMessage() . "\n");
} catch (\ntentan\atiaa\exceptions\DatabaseDriverException $e) {
    ClearIce::resetOutputLevel();
    ClearIce::error("Database driver failed: " . $e->getMessage() . "\n");
    Yentu::reverseCommand($command);
} catch (\yentu\exceptions\DatabaseManipulatorException $e) {
    ClearIce::resetOutputLevel();
    ClearIce::error("Failed to perform database action: " . $e->getMessage() . "\n");
    Yentu::reverseCommand($command);
} catch (\ntentan\atiaa\DescriptionException $e) {
    ClearIce::resetOutputLevel();
    ClearIce::error("Failed to perform database action: " . $e->getMessage() . "\n");
    Yentu::reverseCommand($command);
} catch (\yentu\exceptions\SyntaxErrorException $e) {
    ClearIce::resetOutputLevel();
    ClearIce::error("Error found in syntax: {$e->getMessage()}\n");
    Yentu::reverseCommand($command);
} catch (\PDOException $e) {
    ClearIce::resetOutputLevel();
    ClearIce::error("Failed to connect to database: {$e->getMessage()}\n");
}