Skip to content

Commit

Permalink
Differentiate between Craft Version & Edition
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuapease committed May 20, 2024
1 parent f79a3be commit 5c86035
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/PhoneHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public function init(): void
// If enabled hasn't been configured, enable for non-devMode environments
$enabled = $this->getSettings()->enabled ?? Craft::$app->getConfig()->getGeneral()->devMode === false;

$this->phoneHome->sendPayload();

if (!$enabled) {
return;
}
Expand Down
5 changes: 5 additions & 0 deletions src/endpoints/NotionEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class NotionEndpoint implements EndpointInterface
{
private const PROPERTY_URL = "Url";
private const PROPERTY_ENVIRONMENT = "Environment";
private const PROPERTY_CRAFT_EDITION = "Craft Edition";
private const PROPERTY_CRAFT_VERSION = "Craft Version";
private const PROPERTY_PHP_VERSION = "PHP Version";
private const PROPERTY_DB_VERSION = "DB Version";
Expand All @@ -50,6 +51,9 @@ class NotionEndpoint implements EndpointInterface
self::PROPERTY_ENVIRONMENT => [
'class' => SelectDb::class,
],
self::PROPERTY_CRAFT_EDITION => [
'class' => SelectDb::class,
],
self::PROPERTY_CRAFT_VERSION => [
'class' => SelectDb::class,
],
Expand Down Expand Up @@ -160,6 +164,7 @@ public function send(SitePayload $payload): void
$page = $page->addProperty(self::PROPERTY_NAME, Title::fromString($payload->siteName))
->addProperty(self::PROPERTY_URL, Url::create($payload->siteUrl))
->addProperty(self::PROPERTY_ENVIRONMENT, Select::fromName($payload->environment))
->addProperty(self::PROPERTY_CRAFT_EDITION, Select::fromName($payload->craftEdition))
->addProperty(self::PROPERTY_CRAFT_VERSION, Select::fromName($payload->craftVersion))
->addProperty(self::PROPERTY_PHP_VERSION, Select::fromName($payload->phpVersion))
->addProperty(self::PROPERTY_DB_VERSION, Select::fromName($payload->dbVersion))
Expand Down

0 comments on commit 5c86035

Please sign in to comment.