Download the PHP package codezero/composer-preload-files without Composer

On this page you can find all versions of the php package codezero/composer-preload-files. 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 composer-preload-files

Composer Preload Files Plugin

GitHub release Total Downloads

Autoload Your Files Before Vendor Files

This Composer plugin enables you to autoload files that you specify before any vendor files.

This package is based on the original funkjedi/composer-include-files by @funkjedi and its fork hopeseekr-contribs/composer-include-files by @hopeseekr. Because maintenance of these packages appears to be stalled, I decided to attempt and remake the package from scratch and fix any reported bugs in the process.

✅ Requirements

📦 Install

Install this package with Composer:

📘 Usage

Add the preload-files to your project's composer.json under the extra section:

The preload-files in the extra section will be loaded before the files in a standard autoload or autoload-dev section. This is true for your project, but also for any vendor package. Your project's preload files will always be loaded first.

🔌 Example Use Case

The best example use case is when you need to override a global helper function in a Laravel project. Those helper functions are declared in helper files that are loaded in the files array in the autoload section of composer.json:

These functions are declared like this:

If you add your own helper file to your project's autoload section to override such function, you will notice that Laravel's function is already loaded, and you can not redeclare it.

One way to solve this, is to manually require the helper file before Composer's autoload.php file. For Laravel, this means you need to require the file in your project's public/index.php file:

This works, but it is difficult, if not impossible to test (I did not find a way yet). If you are developing a package, it's also an extra step that users need take to install it.

Another solution is a package like this.

☕ Credits

🔒 Security

If you discover any security related issues, please e-mail me instead of using the issue tracker.

📑 Changelog

A complete list of all notable changes to this package can be found on the releases page.

📜 License

The MIT License (MIT). Please see License File for more information.


All versions of composer-preload-files with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.0
composer-plugin-api Version ^2.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 codezero/composer-preload-files contains the following files

Loading the files please wait ....