Download the PHP package hackpack/hack-class-scanner without Composer

On this page you can find all versions of the php package hackpack/hack-class-scanner. 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 hack-class-scanner

HackClassScanner

Build Status HHVM Status

A class that recursively scans a directory for Hack definitions of:

Installation

Install Composer then use the following in your project directory:

Use

To use the class, simply instantiate it with a set of files/base directories to scan and a set of files/directories to ignore.

The getNameToFileMap method takes one parameter specifying the type of the definition desired. getNameToFileMap will return a Map<string,string> where the keys are the names of the classes, interfaces, traits, etc... including the full name space and the values are the full path to the file in which the definition resides.

Please note that ALL files will be scanned by default (not just .php and/or .hh files). If you wish to only scan files with a particular extension, see the file name filter section below.

Filters

You can filter the results based on the name of the definition and/or the name of the file. Each filter must be a closure with a signature of function(string) : bool.

File Name Filters

To register a file name filter, call ClassScanner->addFileNameFilter() with the filter callback (see example below).

The input for a file name filter is the full path to the file (via realpath). If all registered filter functions return true for a particular file name, the file will be scanned. If at least one registered file filter returns false, the file will not be read (via file_get_contents).

Definition Name Filters

To register a name filter, call ClassScanner->addNameFilter() with the name type and the filter callback (see example below).

The input for a name filter is the name of the class, interface, trait, etc... including the full namespace. If at least one registered filter function returns false for a particular name, that name is guaranteed to not appear in the results. Note that the file in which a filtered definition appears may still be in the list if other non-filtered definitions are also in said file. If you would like to guarantee a file to be skipped, define a file name filter.

Example Filters

In this example, a simple regular expression is used to filter both file names and class names.

In this example, we are specifically looking for XHP classes, using the assumption that all XHP classes are defined in .xhp files.

Thanks

The file parsing algorithm and the majority of the tests were authored by Fred Emmott in fredemmott/definitions-finder


All versions of hack-class-scanner with dependencies

PHP Build Version
Package Version
Requires hhvm Version *
91carriage/phpunit-hhi Version ^4.5
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 hackpack/hack-class-scanner contains the following files

Loading the files please wait ....