For context, this is the PHP Code (anonymized and ...
# community-help
s
For context, this is the PHP Code (anonymized and stripped to the essential)
Copy code
use \Typesense\Client;
$ts_client = new Client(
			array(
				'nearest_node'               => array(
					'host'     => 'host-here',
					'port'     => '443',
					'protocol' => 'https',
				),
				'nodes'                      => array(
					array(
						'host'     => 'host-here',
						'port'     => '443',
						'protocol' => 'https',
					),
					array(
						'host'     => 'host-here',
						'port'     => '443',
						'protocol' => 'https',
					),
					array(
						'host'     => 'host-here',
						'port'     => '443',
						'protocol' => 'https',
					),
				),
				'api_key'                    => 'api-here',
				'connection_timeout_seconds' => 1800,
			)
		);

		$collection = 'my_collection';

		// Fetch current document
		try {
			$document = $ts_client->collections[ $collection ]->documents[ (string) $post_id ]->retrieve();
		} catch ( \Exception $e ) {
			// And here I received https://:443/collections/my_collection/documents/Document_ID? instead of the full proper URL
			return;
		}
r
is your entire configuration really hardcoded? or does it come from env variables or other files?
s
Well originally it’s of course not hardcoded but yes, at this point it was since I couldn’t figure out what’s going on! I think it’s related to dependency of composer and CRON, it’s truly the only real difference between my working code and non working code Maybe I’ll just use curl.