Commit current progress.

This commit is contained in:
calcu1on
2025-03-23 08:44:18 -04:00
parent e3425095dd
commit bef289950b
9 changed files with 145 additions and 30 deletions

View File

@@ -15,7 +15,7 @@ final class CharacterImport extends DrushCommands {
public function importCharacters(): void {
$http_client = \Drupal::httpClient();
$character_endpoint = "https://dchadwick.ddev.site/api/character-list";
$data = $http_client->get($character_endpoint)->getBody()->getContents();
$data = $http_client->get($character_endpoint, ['verify'=>FALSE,])->getBody()->getContents();
$json_data = json_decode($data, TRUE);
// Create the queue.
$character_import_queue = \Drupal::queue('character_import');

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace Drupal\dc_core\Plugin\Block;
use Drupal\Core\Block\Attribute\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\StringTranslation\TranslatableMarkup;
#[Block(
id: "copyright_block",
admin_label: new TranslatableMarkup("Copyright Block"),
category: new TranslatableMarkup("DC Core")
)]
final class CopyrightBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build(): array {
$year = date('Y');
"<p>&#169; Dan Chadwick {$year}</p>";
$build = [
'#markup' => "<p>&#169; Dan Chadwick {$year}</p>",
];
return $build;
}
}