-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-> Better file structure -> Account token resets on password change! -> Fix the real user role is not really real user! -> Telemetry
- Loading branch information
Showing
62 changed files
with
1,096 additions
and
1,844 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
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,48 @@ | ||
<?php | ||
|
||
namespace MythicalClient\MythicalSystems; | ||
|
||
use MythicalClient\App; | ||
|
||
class Telemetry implements TelemetryCollection | ||
{ | ||
public static function send(TelemetryCollection|string $telemetryCollection): void | ||
{ | ||
try { | ||
App::getInstance(true)->getLogger()->debug('Sending telemetry data: ' . $telemetryCollection); | ||
$url = sprintf( | ||
"https://api.mythicalsystems.xyz/telemetry?authKey=%s&project=%s&action=%s&osName=%s&kernelName=%s&cpuArchitecture=%s&osArchitecture=%s", | ||
"AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F", | ||
"mythicalclient", | ||
urlencode((string) $telemetryCollection), | ||
urlencode(SYSTEM_OS_NAME), | ||
urlencode(SYSTEM_KERNEL_NAME), | ||
"amd", | ||
"64" | ||
); | ||
|
||
$curl = curl_init(); | ||
curl_setopt_array($curl, [ | ||
CURLOPT_URL => $url, | ||
CURLOPT_RETURNTRANSFER => true, | ||
CURLOPT_ENCODING => "", | ||
CURLOPT_MAXREDIRS => 10, | ||
CURLOPT_TIMEOUT => 10, | ||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | ||
CURLOPT_CUSTOMREQUEST => "GET", | ||
CURLOPT_POSTFIELDS => "", | ||
CURLOPT_HTTPHEADER => [ | ||
"Content-Type: application/json", | ||
"User-Agent: mythicalclient/" . APP_VERSION | ||
], | ||
]); | ||
|
||
curl_exec($curl); | ||
curl_close($curl); | ||
} catch (\Exception $e) { | ||
App::getInstance(true)->getLogger()->debug("Failed to send telemetry data: ". $e->getMessage()); | ||
// No one cares! | ||
} | ||
} | ||
} | ||
|
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,10 @@ | ||
<?php | ||
|
||
namespace MythicalClient\MythicalSystems; | ||
|
||
interface TelemetryCollection { | ||
public const USER_NEW = "user:new"; | ||
public const SERVICE_NEW = "service:new"; | ||
public const TICKET_OPEN = "ticket:open"; | ||
|
||
} |
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
Oops, something went wrong.