Download the PHP package phlak/splat without Composer

On this page you can find all versions of the php package phlak/splat. 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 splat

Join our Community Become a Sponsor One-time Donation
Latest Stable Version Total Downloads License Tests Status


Glob-like file and pattern matching utility.

Requirements

Installation

Install Splat with Composer.

composer require phlak/splat

Then import the Glob or Pattern classes as needed.

Patterns

Glob methods accept a $pattern as the first parameter. This can be a string or an instance of \PHLAK\Splat\Pattern.

A pattern string may contain one or more of the following special matching expressions.

Matching Expressions

Assertions

The following assertions can be use to assert that a string is followed by, or not followed by, another pattern.

For example, a pattern of *.tar(!.{gz,xz}) will match a string ending with .tar or .tar.bz but not tar.gz or tar.xz.

Converting Patterns To Regular Expressions

Glob patterns can be converted to a regular expression pattern.

You can control regular expression line anchors via the $anchors parameter.

Pattern Character Escaping

Sometimes you may have characters in a string that shouldn't be treated as matching expression characters. In those situations you can escape any character by preceeding it with a backslash (\).

You may also escape glob pattern characters from a string programmatically with the Pattern::escape() method.

Methods

Files In

Get a list of files in a directory matching a glob pattern.

Returns a Symfony Finder Component containing the files matching the glob pattern within the specified directory (e.g. foo.txt, foo/bar.txt, foo/bar/baz.txt, etc.).


Exact Match

Test if a string matches a glob pattern.


Match Start

Test if a string starts with a glob pattern.


Match End

Test if a string ends with a glob pattern.


Match Within

Test if a string contains a glob pattern.


Filter an Array (of Strings)

Filter an array of strings to values matching a glob pattern.


Reject an Array (of Strings)

Filter an array of strings to values not matching a glob pattern.

Changelog

A list of changes can be found on the GitHub Releases page.

Troubleshooting

For general help and support join our GitHub Discussion or reach out on Bluesky.

Please report bugs to the GitHub Issue Tracker.

Copyright

This project is licensed under the MIT License.


All versions of splat with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
symfony/finder Version ^6.0 || ^7.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 phlak/splat contains the following files

Loading the files please wait ....