diff --git a/src/AuditLog/AuditLog.php b/src/AuditLog/AuditLog.php index 91df2f8..faf2407 100644 --- a/src/AuditLog/AuditLog.php +++ b/src/AuditLog/AuditLog.php @@ -3,10 +3,10 @@ namespace Misuzu\AuditLog; use InvalidArgumentException; use RuntimeException; +use Index\Data\DbStatementCache; use Index\Data\IDbConnection; use Index\Data\IDbResult; use Index\Net\IPAddress; -use Misuzu\DbStatementCache; use Misuzu\Pagination; use Misuzu\Users\User; diff --git a/src/Changelog/Changelog.php b/src/Changelog/Changelog.php index 2aa977b..6d39201 100644 --- a/src/Changelog/Changelog.php +++ b/src/Changelog/Changelog.php @@ -4,10 +4,10 @@ namespace Misuzu\Changelog; use InvalidArgumentException; use RuntimeException; use Index\DateTime; +use Index\Data\DbStatementCache; use Index\Data\DbTools; use Index\Data\IDbConnection; use Index\Data\IDbResult; -use Misuzu\DbStatementCache; use Misuzu\Pagination; use Misuzu\Users\User; diff --git a/src/Comments/Comments.php b/src/Comments/Comments.php index bb85365..f264942 100644 --- a/src/Comments/Comments.php +++ b/src/Comments/Comments.php @@ -3,9 +3,9 @@ namespace Misuzu\Comments; use InvalidArgumentException; use RuntimeException; +use Index\Data\DbStatementCache; use Index\Data\IDbConnection; use Index\Data\IDbResult; -use Misuzu\DbStatementCache; use Misuzu\Pagination; use Misuzu\Users\User; diff --git a/src/Config/DbConfig.php b/src/Config/DbConfig.php index 8133723..c2e2459 100644 --- a/src/Config/DbConfig.php +++ b/src/Config/DbConfig.php @@ -4,11 +4,11 @@ namespace Misuzu\Config; use RuntimeException; use InvalidArgumentException; use Index\Data\DataException; +use Index\Data\DbStatementCache; use Index\Data\DbTools; use Index\Data\IDbConnection; use Index\Data\IDbStatement; use Index\Data\IDbResult; -use Misuzu\DbStatementCache; use Misuzu\Pagination; class DbConfig implements IConfig { diff --git a/src/DbStatementCache.php b/src/DbStatementCache.php deleted file mode 100644 index 3e0d3cd..0000000 --- a/src/DbStatementCache.php +++ /dev/null @@ -1,40 +0,0 @@ -dbConn = $dbConn; - } - - private static function hash(string $query): string { - return hash('xxh3', $query, true); - } - - public function get(string $query): IDbStatement { - $hash = self::hash($query); - - if(array_key_exists($hash, $this->stmts)) { - $stmt = $this->stmts[$hash]; - $stmt->reset(); - return $stmt; - } - - return $this->stmts[$hash] = $this->dbConn->prepare($query); - } - - public function remove(string $query): void { - unset($this->stmts[self::hash($query)]); - } - - public function clear(): void { - foreach($this->stmts as $stmt) - $stmt->close(); - $this->stmts = []; - } -} diff --git a/src/Emoticons/Emotes.php b/src/Emoticons/Emotes.php index 63b18c2..53b3222 100644 --- a/src/Emoticons/Emotes.php +++ b/src/Emoticons/Emotes.php @@ -3,8 +3,8 @@ namespace Misuzu\Emoticons; use InvalidArgumentException; use RuntimeException; +use Index\Data\DbStatementCache; use Index\Data\IDbConnection; -use Misuzu\DbStatementCache; class Emotes { private const EMOTE_ORDER = [ diff --git a/src/News/News.php b/src/News/News.php index 3bcc8c7..2042fa0 100644 --- a/src/News/News.php +++ b/src/News/News.php @@ -4,9 +4,9 @@ namespace Misuzu\News; use InvalidArgumentException; use RuntimeException; use Index\DateTime; +use Index\Data\DbStatementCache; use Index\Data\IDbConnection; use Index\Data\IDbResult; -use Misuzu\DbStatementCache; use Misuzu\Pagination; use Misuzu\Comments\CommentsCategoryInfo; use Misuzu\Users\User; diff --git a/src/Profile/ProfileFields.php b/src/Profile/ProfileFields.php index 6cc28d1..1268035 100644 --- a/src/Profile/ProfileFields.php +++ b/src/Profile/ProfileFields.php @@ -3,10 +3,10 @@ namespace Misuzu\Profile; use InvalidArgumentException; use RuntimeException; +use Index\Data\DbStatementCache; use Index\Data\DbTools; use Index\Data\IDbConnection; use Index\Data\IDbResult; -use Misuzu\DbStatementCache; use Misuzu\Users\User; class ProfileFields {