Download the PHP package hhvm/hhvm-autoload without Composer

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

HHVM-Autoload

The autoloader for autoloading classes, enums, functions, typedefs, and constants on HHVM.

Continuous Integration

Usage

  1. Add an hh_autoload.json file (see section below)
  2. composer require hhvm/hhvm-autoload
  3. Require the autoload file from your entrypoint functions using require_once (__DIR__ . '(/..)(repeat as needed)/vendor/autoload.hack');
  4. Call Facebook\AutoloadMap\initialize() to register the autoloader with hhvm.
  5. To re-generate the map, run vendor/bin/hh-autoload, composer dump-autoload, or any other command that generates the map

Configuration (hh_autoload.json)

A minimal configuration file is:

This will look for autoloadable definitions in src/, and also look in vendor/. Projects in vendor/ are only processed if they also contain a hh_autoload.json file.

Previously we also supported projects without hh_autoload.json by simulating Composer's autoload behavior, but we no longer do because that mostly applied to PHP files which HHVM can no longer parse.

The following settings are optional:

Use In Development (Failure Handlers)

When you add, remove, or move definitions, there are several options available:

Facebook\AutoloadMap\HHClientFallbackHandler is probably the most convenient for Hack development.

HHClientFallbackHandler

If you are working in Hack, this handler will remove the need to manually rebuild the map in almost all circumstances.

It asks hh_client for definitions that aren't in the map, and has the following additional behaviors:

You can override these behaviors in a subclass.

Custom Handlers

Information you may need is available from:

Use with HH\Facts

HHVM 4.109 introduced ext-facts and ext-watchman. Unlike the static pre-built autoloader which is built into a repo authoratative build, this native autoloader works incrementally and is suitable for autoloading in your development environment. For more information about setting up this autoloader, see the blog post for hhvm 4.109.

When using a native autoloader (either the repo auth or ext-facts autoloader), you do not need hhvm-autoload to require classes/functions/types/constants at runtime. If you (and your vendor dependencies) do not call any functions in the Facebook\AutoloadMap namespace, other than Facebook\AutoloadMap\initialize(), you don't need hhvm-autoload anymore. In that case, you could drop this dependency and remove the calls to initialize(). If you are using other functions, like Facebook\AutoloadMap\Generated\map(), you'd still need the vendor/autoload.hack file that hhvm-autoload generates.

Hhvm-autoload supports outputting a vendor/autoload.hack file which forwards all queries to ext-facts. Facebook\AutoloadMap\Generated\map_uncached() will always be up to date in this mode, since HH\Facts is always up to date. Facebook\AutoloadMap\Generated\map() is memoized (within a request), since some code may rely on getting the same result from multiple calls. You can enable this mode by adding "useFactsIfAvailable": true to the hh_autoload.json config file. Hhvm-autoload will emit a shim file instead of a full map. This option is ignored if HH\Facts\enabled() returns false, or when --no-facts is passed to vendor/bin/hh-autoload. We recommend passing --no-facts when building for production (specifically repo auth mode). Returning a hardcoded dict is faster than asking HH\Facts.

Important to note. Autoloading with a native autoloader does not respect hh_autoload.json. The repo auth autoloader allows any code to use any symbol. The facts autoloader honors the configuration in .hhvmconfig.hdf instead. Make sure that the configuration in hh_autoload.json and .hhvmconfig.hdf match.

How It Works

Contributing

We welcome GitHub issues and pull requests - please see CONTRIBUTING.md for details.

License

hhvm-autoload is MIT-licensed.


All versions of hhvm-autoload with dependencies

PHP Build Version
Package Version
Requires composer-plugin-api Version ^1.0|^2.0
hhvm Version ^4.153
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 hhvm/hhvm-autoload contains the following files

Loading the files please wait ....