PHP Auto Include AutoLoadOne Generator

AutoloadOne is a program that generates an autoload class (Auto Include) for PHP that is project specific. This class is useful to use classes on code without calling each "include" manually. It is a direct alternative to Composer's autoload, but it works differently.
Composer's autoload, scans the folders during runtime, while this library only scans the folder once, and it stores the result.

Contrary to other alternatives, it supports the easiest way to autoload classes using PHP without sacrifice performance. How it works?. AutoLoadOne pre-calculates every class of a project and generates a single autoload.php (or the name indicated) file that it's ready to use. You don't need a specific folder, structure or rule to use it. Just generate the autoload file class, include, and you are ready to load any class (even classes without a namespace, classes in the namespace in different folders, multiple classes defined in a single file...).

AutoLoadOne is a replacement to Composer's Autoload, rendering obsolete the use of psr-0 or psr-4.

NOTE: If you run the dev-distro, then you must exclude the example/ folder because it contains @autorun tags.

Last Update 26 Jan, 2023

"Universal Autoloading classes in PHP, any class, any time!"

Table of Contents

PHP Auto Include AutoLoadOne Generator Table of Contents How it Works? When I should re-run AutoLoadOne? Composer Autoload features: AutoLoadOne extended features: Getting started Usage using the CLI Usage via code Usage (generate code via Web) Usage (via cli) Usage of the generated file (autoload.php) Note Autorun Extension Statistic and optimization How can I reduce the map? Test AutoLoadOne Optimized AutoLoadOne Composer's autoload (using optimize) Why the size matter?. Lookup usage? How many lookup are called?. TEST II (Magento 2.2.3) Let's say we have 1000 concurrent users Compression and Magento. Code execution. Benchmark Security Composer.json Version Todo

How it Works?

1️⃣
Run AutoLoadOne.php as CLI or as Web.
2️⃣
AutoLoadOne will generate a single file called autoload.php (or the name indicated) based in your project. For the record, it takes mere 1.5 seconds to scan WordPress and yes, it is compatible with WordPress.
3️⃣
Include the generated file (ex: autoload.php) in your project code and start using it.

When I should re-run AutoLoadOne?

You don't need to run it again if you are adding a new class with the same namespace in the same folder.

Also, you could edit autoload.php manually by adding more classes and namespaces.

Or you could run AutoLoadOne.php again and replace the old generated file.

Composer Autoload features:

版权声明:

1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。
2、网站不提供资料下载,如需下载请到原作者页面进行下载。
3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考学习用!
4、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。