dbConnect() public method

Use database configuration settings from config file to establish default connection.
public dbConnect ( mixed $dsn = null ) : DB
$dsn mixed
return DB
Ejemplo n.º 1
0
    -r, --reset

        Reset user information

    -h, --help

        Display this message

EOF;
        exit;
    }
    echo "Bootstrapping Dokku-alt-manager\n";
    // First lets test database
    echo "Connecting do database: ";
    $app->dbConnect();
    echo "OK\n";
    // See if database needs updating
    echo "Updating Database: ";
    $app->add('Controller_Migrator_MySQL')->migrate();
    echo "OK\n";
    // Should we reset users?
    if (isset($options['r']) || isset($options['reset'])) {
        $app->add('Model_User')->each('delete');
        echo "User access list emptied.\n";
    }
    // Should we import key
    if (isset($options['k']) || isset($options['key'])) {
        $file = $options['k'] ?: $options['key'];
        if ($file == '-') {
            $file = 'php://stdin';