Skip to content

Commit

Permalink
Remove sqlite example, avoid dev dependency on ext-sqlite3
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Feb 4, 2021
1 parent 43e4c46 commit edbb151
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"react/promise": "^2.7"
},
"require-dev": {
"clue/reactphp-sqlite": "^1.0.0",
"phpunit/phpunit": "^9.5 || ^7.5"
}
}
17 changes: 0 additions & 17 deletions examples/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,6 @@
);
});

$factory = new Clue\React\SQLite\Factory($loop);
$db = $factory->openLazy('count.db', null, ['idle' => 0.001]);
$db->exec('CREATE TABLE IF NOT EXISTS hits (id INTEGER PRIMARY KEY AUTOINCREMENT, datetime STRING)');

$app->get('/count', function (ServerRequestInterface $request) use ($db) {
$db->query('INSERT INTO hits (datetime) VALUES (?)', [date(DATE_RFC3339_EXTENDED) ]);
return $db->query('SELECT COUNT(*) AS count FROM hits')->then(function (Clue\React\SqLite\Result $result) {
return new React\Http\Message\Response(
200,
['Content-Type' => 'text/plain'],
$result->rows[0]['count'] . "\n"
);
});
});

//$app->post('/api/streams/{topic}', new TopicAddController($db));

$app->redirect('/test', '/');

//$app->cgi('/adminer.php', __DIR__ . '/adminer.php');
Expand Down

0 comments on commit edbb151

Please sign in to comment.