Download the PHP package pfaciana/includefile without Composer

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

includefile

includefile is an include-pattern matcher designed for fast filesystem discovery.

It wraps automattic/ignorefile, but exposes include-first behavior: describe the files you want, exclude the directories or files you do not want, and stream the matching entries into whatever processing step comes next.

Installation

Pattern Model

Patterns are include-first.

The pattern syntax comes from Git-style ignore files, through automattic/ignorefile. Use Git ignore-pattern behavior as the baseline model; this package does NOT define a new glob language.

Internally, includefile converts include patterns into ignore-style rules for automattic/ignorefile. That matters because ! means "exclude from the include set" in this package, even though ! means "unignore" in a .gitignore file.

automattic/ignorefile compiles patterns to regex. It does not check the filesystem to find out whether an ambiguous path is a file or a directory. A pattern like .examples could refer to either one, so includefile has to classify ambiguous patterns before it can build traversal filters.

Ambiguous Files vs Directories

includefile classifies patterns as file patterns or directory patterns. That classification is a best guess based on the pattern text, not a filesystem check. It is used when building traversal filters.

Default rules:

So in short, no dot = directory, dot = file, unless hidden hidden dot = directory.

Force rules:

If you dont want to leave anything to change, you force how a pattern is treated.

Hidden names are biased toward directories because directory pruning is usually more important for names like .git, .agents, and .claude. Files like .gitattributes, .gitignore, and .env do exist; use @file: when the hidden pattern is meant to be a file.

So in short, end in slash = directory, starts with @file: (or !@file:) = file.

Directory Pruning

Some excluded directory patterns are terminal during traversal.

These exclude the directory and descendants, so discovery can skip descending into them.

Open-ended exclusions are different:

Those exclude contents but are not terminal, because a later include pattern may still make a descendant reachable.

Use terminal exclusions when nothing under that directory should be discovered. Use open-ended exclusions when later include patterns may re-include descendants.

This follows the same reachability model as Git ignore files, with the include/exclude meaning inverted. If traversal excludes a directory itself, later patterns for descendants under that directory cannot be reached during filesystem discovery.

File Discovery

A common use is to stream matching files from a base directory.

get_files() returns a generator. The default callback filter uses the include patterns for files and prunes terminal excluded directories before descending into them.

get_files()

IncludeFile::get_files() is the common helper for filesystem discovery. It creates the recursive iterators, applies an optional traversal filter, and yields matching entries.

The first argument is a directory path or a list of directory paths.

The second argument may be:

Config keys:

Extension filters are case-insensitive. Values like 'php', '.php', and '*.php' are equivalent. Dotted suffixes like 'inc.php' match the full filename suffix. An empty string matches extensionless files, and an empty list means no extension filter. Unsupported filterByExt values are treated as no extension filter.

Use it with getFilter() for normal include-pattern discovery. Use filterByExt beside filter when you want include-pattern filtering and extension filtering together. The built-in filterByExt check is for the default leaf/fileinfo traversal; use a callable filter when custom iterator modes or current modes need extension filtering.

Custom Discovery Filters

Use makeFilter() to extend the default callback filter without replacing its include-pattern behavior. Pass 'allowLinks' => TRUE to getFilter() or makeFilter() to let the traversal filter treat linked directories as children.

The optional callbacks receive:

Return TRUE or FALSE to short-circuit the default filter. Return NULL to continue to the default behavior.

Callbacks may omit trailing parameters, but declared parameters must keep the documented order.

For extension filtering, use get_files() with filterByExt. For default traversal behavior, getFilter() is shorthand for makeFilter( $baseDir ).

getDefaultCallbackFilter() is still available as a deprecated compatibility alias.

filterByExt is useful when the caller only wants specific file types. It runs after the traversal filter and before yielding files, so filter can prune directories while filterByExt keeps extension checks out of custom callback code.

See examples/file-discovery-basic.php for a direct file discovery example.

See examples/file-discovery-advanced.php for the full wrapper-style example. It normalizes a base directory, builds a reusable discovery function, adapts the native RecursiveCallbackFilterIterator callback, and passes extra context into the caller's custom filter.

See examples/get-files.php for using get_files() without include patterns.

Direct Pattern Matching

If you dont need to discover files, meaning you already know the exact files you want to test, then you can use the includes() and filter() methods.

Use includes() when you already have a path and only need to test it.

Use filter() when you already have an array of paths.

Use test() when you need the include state and the matching pattern.

Gotchas

When testing a raw directory path string with includes(), include the trailing /. Without it, automattic/ignorefile treats the path like a file path.

This is separate from pattern classification. As a pattern, src is treated as a directory pattern and includes src and descendants.

Strict mode is enabled by default. Invalid patterns throw Automattic\IgnoreFile\InvalidPatternException.

Pattern parsing comes from automattic/ignorefile; known incompatibilities with Git are inherited from that package.


All versions of includefile with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
automattic/ignorefile Version ^3.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 pfaciana/includefile contains the following files

Loading the files please wait ...