diff --git a/db.php b/db.php index 398b75e..efa1583 100755 --- a/db.php +++ b/db.php @@ -1,11 +1,19 @@ quote($string), 1, -1); + } +} + yourls_db_sqlite_connect(); /** @@ -39,7 +47,7 @@ function yourls_db_sqlite_connect() { */ $attributes = yourls_apply_filter( 'db_connect_attributes', array() ); // attributes as key-value pairs - $ydb = new \YOURLS\Database\YDB( $dsn, "", "", array(), $attributes ); + $ydb = new CustomYDB( $dsn, "", "", array(), $attributes ); $ydb->init(); // Past this point, we're connected @@ -141,7 +149,7 @@ function yourls_sqlite_last_24h_hits() { FROM `yourls_log` WHERE `shorturl` $keyword_range AND `click_time` > datetime('now', '-1 day') GROUP BY `time`;"; - $rows = $ydb->get_results( $query ); + $rows = $ydb->fetchObjects( $query ); $_last_24h = array(); foreach( (array)$rows as $row ) { diff --git a/readme.md b/readme.md index f7cee2c..4f1c09c 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# An unofficial SQLite Driver for YOURLS 1.8.2 +# An unofficial SQLite Driver for YOURLS 1.9.2 This is a fork of a [fork](https://github.com/reanimus/yourls-sqlite) of the [original](https://github.com/ozh/yourls-sqlite), but now outdated SQLite driver for [YOURLS](https://yourls.org/). To my knowledge, it's the only actively maintained version, now with a readily available Docker image (thanks [@Niduroki](https://github.com/Niduroki)).