-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Persist icons and altsvcs on Postgres (#2189)
* Persist icons and altsvcs on Postgres * Fix list API to terminate SQL output with LF
- Loading branch information
Showing
33 changed files
with
588 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace HomoChecker\Contracts\Repository; | ||
|
||
interface AltsvcRepository | ||
{ | ||
/** | ||
* Retrieve all entries. | ||
* @return \stdClass[] The entries. | ||
*/ | ||
public function findAll(): array; | ||
|
||
/** | ||
* Save the entry. | ||
* @param string $url The URL. | ||
* @param string $protocol The protocol ID. | ||
* @param string $maxAge The max age. | ||
*/ | ||
public function save(string $url, string $protocol, string $maxAge): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace HomoChecker\Contracts\Repository; | ||
|
||
interface ProfileRepository | ||
{ | ||
/** | ||
* Save the profile. | ||
* @param string $screenName The screen name. | ||
* @param string $iconURL The icon URL. | ||
* @param string $expiresAt The expiration. | ||
*/ | ||
public function save(string $screenName, string $iconURL, string $expiresAt): void; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace HomoChecker\Domain; | ||
|
||
class Profile | ||
{ | ||
/** | ||
* @var ?string The icon URL. | ||
*/ | ||
protected ?string $iconUrl; | ||
|
||
/** | ||
* @param array|object $profile | ||
*/ | ||
public function __construct(array|object $profile = null) | ||
{ | ||
$profile = (object) $profile; | ||
|
||
$this->setIconUrl($profile->icon_url ?? null); | ||
} | ||
|
||
/** | ||
* Get the icon URL. | ||
* @return ?string The icon URL. | ||
*/ | ||
public function getIconUrl(): ?string | ||
{ | ||
return $this->iconUrl; | ||
} | ||
|
||
/** | ||
* Set the icon URL. | ||
*/ | ||
public function setIconUrl(?string $iconUrl): void | ||
{ | ||
$this->iconUrl = $iconUrl; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.