Download the PHP package lastdragon-ru/path without Composer

On this page you can find all versions of the php package lastdragon-ru/path. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package path

Path

Provides utilities for working with file and directory paths in an object-oriented way for all path types.

[include:artisan]: <lara-asp-documentator:requirements "{$directory}">

Requirements

Requirement Constraint Supported by
PHP ^8.5 HEAD ⋯ 11.0.0
^8.4 HEAD ⋯ 9.2.0
^8.3 10.3.0 ⋯ 9.2.0

Installation

Motivation

Most similar packages consider file/directory paths as strings. It is work until we need to modify and/or actively work with them. Relative path resolution depends on the type of base path, for example:

The strings (in general case) don't allow us to distinguish the directory path from the file path, and so resolve the path of file.txt correctly. Strings also cannot ensure type safety - there is no way to disallow passing a directory path where only a file path is wanted, and vice versa. To solve all these problems, the package defines FilePath.

The (string) $baseDirectory->resolve($file) is:

The (string) $baseFile->resolve($file) is:

The (string) $baseFile->file('../../file.md') is:

What is supported

The package works only with paths, not with URL/URI/etc, and doesn't interact with OS. The following table shows possible path types.

Type Example Root
Type::Absolute /path /
Type::Relative path, ./path, ../path
Type::Home ~, ~/, ~/path ~/
Type::User ~username, ~username/path ~username/
Type::Unc \\ComputerName\SharedFolder\Resource \\ComputerName\SharedFolder
Type::WindowsAbsolute C:\path C:\
Type::WindowsRelative C:path C:/<current directory>^1 or C:\^1

As a path separator, any/mix of //\ can be used, but in the normalized form all \ will always be converted into /:

The (string) $base->resolve($file) is:

The (string) $win->normalized() is:

Home ~/

OS independent means that unlike e.g. \Symfony\Component\Filesystem\Path the user home directory ~/ will not be replaced to the actual path, moreover paths stated with ~/ will be treatment like absolute paths (because in almost all cases it is an absolute path).

The $home->type is:

The (string) $home->resolve($file) is:

The (string) $home->file('../../../file.md') is:

Windows

Nothing special here except how the relative path resolves^1:

The (string) $base->resolve(new FilePath('C:file.txt')) is:

The (string) $base->resolve(new FilePath('D:file.txt')) is:

Universal Naming Convention (UNC)

In UNC, the root is \\server\share, so relative paths resolve based on it:

The (string) $base->resolve($file) is:

Making path relative

The (string) $base->relative(new FilePath('~/file.txt')) is:

The $base->relative(new FilePath('/file.txt')) is:

Upgrading

Please follow Upgrade Guide.

Contributing

Please use the main repository to report issues, send pull requests, or ask questions.

"\LastDragon_ru\Path\DirectoryPath"
"\LastDragon_ru\Path\FilePath"
"\LastDragon_ru\Path\Type::Absolute"
"\LastDragon_ru\Path\Type::Home"
"\LastDragon_ru\Path\Type::Relative"
"\LastDragon_ru\Path\Type::Unc"
"\LastDragon_ru\Path\Type::User"
"\LastDragon_ru\Path\Type::WindowsAbsolute"
"\LastDragon_ru\Path\Type::WindowsRelative"

All versions of path with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4|^8.5
ext-mbstring Version *
symfony/polyfill-php85 Version ^1.36.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lastdragon-ru/path contains the following files

Loading the files please wait ...