Skip to content

Instantly share code, notes, and snippets.

@DarkGhostHunter
Last active November 27, 2019 18:51
Show Gist options
  • Save DarkGhostHunter/6301bdb5524859d8e8aa8bdf815adfb2 to your computer and use it in GitHub Desktop.
Save DarkGhostHunter/6301bdb5524859d8e8aa8bdf815adfb2 to your computer and use it in GitHub Desktop.
Preload final file
<?php
/**
* Preloading @generated by Composer
*/
// Autoload the classes so those can be preloaded using `require_once`.
require_once __DIR__.'/../autoload.php';
// File list
$files = [
'/var/www/app/Foo.php',
'/var/www/app/Bar.php',
'/var/www/helpers/basic.php',
'/var/www/helpers/advanced.php',
'/var/www/vendor/Foo/Bar/src/Class.php',
'/var/www/vendor/Foo/Bar/helpers/helpers.php',
'/var/www/vendor/Foo/Bar/config.php',
// ...
];
// Preload all root project files
foreach ($files as $file) {
require_once $file;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment