Index update.

This commit is contained in:
Pachira 2022-02-16 20:49:49 +00:00
parent 50d49de806
commit 50ea20b897
4 changed files with 16 additions and 16 deletions

@ -1 +1 @@
Subproject commit e322527cf5aa76596edf1e5d1282886c4e88e9ed
Subproject commit 3eb650c246c8932722da203ca75a0a54c5c69ef9

View file

@ -2,8 +2,8 @@
namespace Makai;
use Index\Data\DbType;
use Index\Data\IDatabaseConnection;
use Index\Data\IDatabaseResult;
use Index\Data\IDbConnection;
use Index\Data\IDbResult;
class Languages {
private const QUERY = 'SELECT pl.`language_id`, pl.`language_name`, pl.`language_colour` FROM `fm_proglangs` AS pl';
@ -12,9 +12,9 @@ class Languages {
private const QUERY_PROJECT_COLOUR = 'SELECT pl.`language_colour` FROM `fm_proglangs` AS pl LEFT JOIN `fm_projects_proglangs` AS ppl ON ppl.`language_id` = pl.`language_id` WHERE pl.`language_colour` IS NOT NULL AND ppl.`project_id` = ? ORDER BY ppl.`priority` LIMIT 1';
private IDatabaseConnection $conn;
private IDbConnection $conn;
public function __construct(IDatabaseConnection $conn) {
public function __construct(IDbConnection $conn) {
$this->conn = $conn;
}
@ -43,7 +43,7 @@ class Languages {
return $result->getInteger(0);
}
private static function createObject(IDatabaseResult $result): LanguageInfo {
private static function createObject(IDbResult $result): LanguageInfo {
return new LanguageInfo(
$result->getString(0), // id
$result->getWString(1, 'utf-8'), // name

View file

@ -1,8 +1,8 @@
<?php
namespace Makai;
use Index\Data\IDatabaseConnection;
use Index\Data\IDatabaseResult;
use Index\Data\IDbConnection;
use Index\Data\IDbResult;
class Projects {
private const QUERY = 'SELECT `project_id`, `project_name`, COALESCE(`project_name_clean`, REPLACE(LOWER(`project_name`), \' \', \'-\')), `project_summary`, `project_description`, `project_featured`, `project_order`, `project_homepage`, `project_repository`, `project_forum`, UNIX_TIMESTAMP(`project_archived`), `project_type`, UNIX_TIMESTAMP(`project_created`), `project_colour` FROM `fm_projects` WHERE `project_deleted` IS NULL';
@ -10,9 +10,9 @@ class Projects {
private const QUERY_ALL = self::QUERY . ' ORDER BY `project_order` DESC';
private const QUERY_FEATURED = self::QUERY . ' AND `project_featured` <> 0 ORDER BY RAND() LIMIT 3';
private IDatabaseConnection $conn;
private IDbConnection $conn;
public function __construct(IDatabaseConnection $conn) {
public function __construct(IDbConnection $conn) {
$this->conn = $conn;
}
@ -40,7 +40,7 @@ class Projects {
return $objs;
}
private static function createObject(IDatabaseResult $result): ProjectInfo {
private static function createObject(IDbResult $result): ProjectInfo {
return new ProjectInfo(
$result->getString(0), // id
$result->getWString(1, 'utf-8'), // name

View file

@ -2,15 +2,15 @@
namespace Makai;
use Index\Data\DbType;
use Index\Data\IDatabaseConnection;
use Index\Data\IDatabaseResult;
use Index\Data\IDbConnection;
use Index\Data\IDbResult;
class SSHKeys {
private const QUERY = 'SELECT `key_id`, `key_level`, `key_algo`, `key_body`, `key_comment`, UNIX_TIMESTAMP(`key_created`), UNIX_TIMESTAMP(`key_deprecated`) FROM `fm_public_keys` WHERE `key_level` >= ?';
private IDatabaseConnection $conn;
private IDbConnection $conn;
public function __construct(IDatabaseConnection $conn) {
public function __construct(IDbConnection $conn) {
$this->conn = $conn;
}
@ -34,7 +34,7 @@ class SSHKeys {
return $objs;
}
private static function createObject(IDatabaseResult $result): SSHKeyInfo {
private static function createObject(IDbResult $result): SSHKeyInfo {
return new SSHKeyInfo(
$result->getString(0),
$result->getInteger(1),