someniatko/amqp-url-parser

Parser of the AMQP (i.e. RabbitMQ) URLs

v0.2.0 2023-02-08 13:27 UTC

This package is auto-updated.

Last update: 2024-11-08 17:42:27 UTC


README

AMQP 0-9-1 URL parser.

Tested against all examples from the RabbitMQ URI specification (Appendix A)

Based on league/uri.

Usage

composer install someniatko/amqp-url-parser

<?php

declare(strict_types=1);

namespace YourCode;

use Someniatko\AmqpUrlParser\Parser;

$url = Parser::parse('amqp://username:password@host:1234/vhost');

$host = $url->host;
$port = $url->port;
$username = $url->username;
$password = $url->password;
$vhost = $url->vhost;