diff --git a/src/Pusher.php b/src/Pusher.php index 72b6b8a..427dcc8 100755 --- a/src/Pusher.php +++ b/src/Pusher.php @@ -80,7 +80,7 @@ public function __construct(string $auth_key, string $secret, string $app_id, ar $this->settings['auth_key'] = $auth_key; $this->settings['secret'] = $secret; $this->settings['app_id'] = $app_id; - $this->settings['base_path'] = '/apps/' . $this->settings['app_id']; + $this->settings['base_path'] = (isset($options['path']) ? $options['path'] : '') . '/apps/' . $this->settings['app_id']; foreach ($options as $key => $value) { // only set if valid setting/option @@ -217,7 +217,7 @@ private function validate_channel(string $channel): void * * @throws PusherException If $socket_id is invalid */ - private function validate_socket_id(string $socket_id): void + protected function validate_socket_id(string $socket_id): void { if ($socket_id !== null && !preg_match('/\A\d+\.\d+\z/', $socket_id)) { throw new PusherException('Invalid socket ID ' . $socket_id); @@ -265,7 +265,7 @@ private function sign(string $path, string $request_method = 'GET', array $query */ private function channels_url_prefix(): string { - return $this->settings['scheme'] . '://' . $this->settings['host'] . ':' . $this->settings['port'] . $this->settings['path']; + return $this->settings['scheme'] . '://' . $this->settings['host'] . ':' . $this->settings['port']; } /**