Download the PHP package kafkiansky/discovery without Composer

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

PHP Discovery

test Total Downloads

Contents

Installation

Usage

It is often necessary to find all classes that implement specific interface(s), inherit a specific class or use specific traits. This information could be used, in example, to implement autowiring in IOC containers. To avoid parsing the entire project, you could use classes information from the autoload_classmap.php file that the composer uses for optimization.

Class Implements

Discover all classes that implement specific interface(s):

Discover all classes that implement all of specific interfaces:

Discover all classes that implement one of specific interfaces:

Class Extends

Discover all classes that extend specific class:

Class Uses

Discover all classes that use specific trait. This rule recursively searches for the desired trait among the parent traits and among the traits of traits:

Class Has Attributes

Discover all classes that use specific attributes.

All

Discover all classes that satisfy list of rules:

Any

Discover all classes that satisfy at least one rule from list:

None

Discover all classes that do not satisfy any rule:

Loader constraints

If you want to specify which classes can be loaded, you can use the LoaderConstraint interface implementation. Out of the box comes the Kafkiansky\Discovery\CodeLocation\Composer\LoadOnlyApplicationCode class that load only classes that matches namespaces from autoload.psr4 section of your composer.json file.

Composer loader

By default, the ComposerClassmapClassLoader search the autoload_classmap.php in vendor/composer/autoload_classmap.php path and require it. If you want pass your own classmap loader, overload the default loader using withClassMapLoader method:

Array loader

For testing purposes you may use the Kafkiansky\Discovery\CodeLocation\ArrayClassLoader:

Performance optimization

In production, you will want to cache classes that match the rules to avoid unnecessary checks. Then you must use DiscoveryWithCache:

Or if you want to cache conditionally, use cacheIf callable to specify when to cache and when not:

Testing

License

The MIT License (MIT). See License File for more information.


All versions of discovery with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 kafkiansky/discovery contains the following files

Loading the files please wait ....