From 6864a89de0330796232f2ebb3c1b1d5ec226a52f Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Tue, 28 Apr 2026 14:55:38 +0200 Subject: [PATCH] fix: infer CLI SSL from host protocol --- bin/posthog | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/bin/posthog b/bin/posthog index 3add455..2568b50 100755 --- a/bin/posthog +++ b/bin/posthog @@ -34,13 +34,21 @@ if (empty($options['apiKey'])) { error('apiKey flag required'); } +$initOptions = array( + 'debug' => array_key_exists('debug', $options), +); + +if (array_key_exists('host', $options)) { + $initOptions['host'] = $options['host']; +} + +if (array_key_exists('no-ssl', $options)) { + $initOptions['ssl'] = false; +} + PostHog::init( $options['apiKey'], - array( - 'host' => $options['host'], - 'debug' => array_key_exists('debug', $options), - 'ssl' => !array_key_exists('no-ssl', $options) - ) + $initOptions ); switch ($options['type']) {