惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
Intezer
S
Schneier on Security
AI
AI
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Hacker News
The Hacker News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threat Research - Cisco Blogs
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
Forbes - Security
Forbes - Security
L
Lohrmann on Cybersecurity
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Help Net Security
Help Net Security
A
Arctic Wolf
T
Troy Hunt's Blog
Scott Helme
Scott Helme
T
The Exploit Database - CXSecurity.com
S
Security @ Cisco Blogs
T
Threatpost
The Cloudflare Blog
月光博客
月光博客
Cyberwarzone
Cyberwarzone
S
Security Affairs
M
MIT News - Artificial intelligence
Simon Willison's Weblog
Simon Willison's Weblog
WordPress大学
WordPress大学
人人都是产品经理
人人都是产品经理
Application and Cybersecurity Blog
Application and Cybersecurity Blog
AWS News Blog
AWS News Blog
The Register - Security
The Register - Security
H
Hacker News: Front Page
P
Privacy International News Feed
Cisco Talos Blog
Cisco Talos Blog
Know Your Adversary
Know Your Adversary
宝玉的分享
宝玉的分享
V
V2EX
F
Fortinet All Blogs
罗磊的独立博客
B
Blog RSS Feed
腾讯CDC
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - Franky
Security Latest
Security Latest

Feed of "schmarty/gem-diamond"

issue when using indieauth[dot]com? gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond proxy for profile images gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond gem-diamond
gem-diamond
schmarty · 2024-07-29 · via Feed of "schmarty/gem-diamond"

共有 3 个文件被更改,包括 41 次插入7 次删除

@ -6,20 +6,19 @@ use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Schmarty\Micropubkit\Controllers\Common\{ResponseAware,ResponseAwareTrait};
use Schmarty\Micropubkit\Controllers\Common\{TemplatesAware,TemplatesAwareTrait};
class Controller implements ResponseAware {
class Controller implements ResponseAware, TemplatesAware {
use ResponseAwareTrait;
use TemplatesAwareTrait;
private \League\Plates\Engine $templates;
private \App\Model\Site $site;
private \App\Model\SiteCheck $siteCheck;
public function __construct(\League\Plates\Engine $templates, \App\Model\Site $site, \App\Model\SiteCheck $siteCheck) {
$this->templates = $templates;
public function __construct(\App\Model\Site $site, \App\Model\SiteCheck $siteCheck) {
$this->site = $site;
$this->siteCheck = $siteCheck;
$this->templates->addData(['hostname' => $_SERVER['SERVER_NAME']]);
}
public function index(ServerRequestInterface $request): ResponseInterface {

@ -0,0 +1,31 @@
<?php declare(strict_types=1);
namespace App;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Psr\Http\Server\MiddlewareInterface;
use Schmarty\Micropubkit\Controllers\Common\{TemplatesAware,TemplatesAwareTrait};
class TemplatesCommonMiddleware implements MiddlewareInterface, TemplatesAware
{
use TemplatesAwareTrait;
/**
* {@inheritdoc}
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
// add common bits that our temlpates need to know
$this->templates->addData([
'hostname' => $_SERVER['SERVER_NAME']
]);
// and pass along
return $handler->handle($request);
}
}
@ -24,12 +24,16 @@ $app->container->addShared(App\Model\SiteCheck::class)->addArgument(App\DB::clas
// set up controller for welcome and forms
$app->container->addShared(App\Controller::class)
->addArgument(League\Plates\Engine::class)
->addArgument(App\Model\Site::class)
->addArgument(App\Model\SiteCheck::class);
// set up middleware
$app->container->add(App\TemplatesCommonMiddleware::class);
// allow login everywhere but be chill about it
$app->route->middleware($app->optionalAuthMiddleware);
$app->route
->middleware($app->optionalAuthMiddleware)
->middleware($app->container->get(App\TemplatesCommonMiddleware::class));
// set up app-specific routes
$app->route->get('/', 'App\\Controller::index')->setName('loginForm');