Context: extract dependency building from the container

This commit is contained in:
Zankaria
2024-04-09 11:20:04 +02:00
parent 3c49645af0
commit f93dd1fae5
2 changed files with 29 additions and 15 deletions

View File

@@ -5,9 +5,8 @@
require_once 'inc/bootstrap.php';
use Vichan\AppContext;
use Vichan\Driver\HttpDriver;
use Vichan\Driver\Log;
use Vichan\{Context, WebDependencyFactory};
use Vichan\Driver\{HttpDriver, Log};
use Vichan\Service\{RemoteCaptchaQuery, NativeCaptchaQuery};
/**
@@ -172,7 +171,7 @@ function strip_image_metadata(string $img_path): int {
*/
$dropped_post = false;
$context = new AppContext($config);
$context = new Context(new WebDependencyFactory($config));
// Is it a post coming from NNTP? Let's extract it and pretend it's a normal post.
if (isset($_GET['Newsgroups']) && $config['nntpchan']['enabled']) {