The League of Extraordinary Packages

Our Packages:

Presented by The League of Extraordinary Packages

Getting Started

Uri parser

Uri schemes

Uri manipulations

Uri components

Upgrading Guide

Ftp URI

To ease working with FTP URIs, the library comes bundle with a URI specific FTP class League\Uri\Schemes\Ftp.

Validation

The scheme of a FTP URI must be equal to ftp or be undefined. It can not contains a query and or a fragment component.

Adding contents to the fragment or query components throws an UriException exception

<?php

use League\Uri\Schemes\Ftp as FtpUri;

$uri = FtpUri::createFromString('ftp://thephpleague.com/path/to/image.png;type=i');
$uri->withQuery('p=1'); // will throw an League\Uri\Schemes\UriException

Apart from the fragment, the query components and the scheme definition, the FTP URIs share the same validation rules as Http URIs.