/** * Tests metrics */ public function testMetrics() { /** @type UsageService $_service */ $_service = Usage::service(); $_stats = $_service->gatherStatistics(); $this->assertNotEmpty($_stats); }
/** * Make sure the payload is kosher * * @param array $data * * @return bool */ protected function checkPayload(&$data = []) { if (empty($data) || !is_array($data)) { $data = []; } try { if (empty(array_get($data, 'install-key'))) { $data['install-key'] = Usage::service()->generateInstallKey(); } } catch (\Exception $_ex) { \Log::warning('[dfe.license] No "root" user.'); // No users return false; } return true; }
/** * Builds the parameter list to send with any home page links * * @return array The parameters to send with links */ protected function getLinkParameters() { /** @noinspection PhpUndefinedMethodInspection */ return ['e_k' => Usage::service()->generateInstallKey()]; }