Skip to content

Instantly share code, notes, and snippets.

@DarkGhostHunter
Last active July 18, 2023 18:14
Show Gist options
  • Save DarkGhostHunter/ae68c47003915000265be81341400a04 to your computer and use it in GitHub Desktop.
Save DarkGhostHunter/ae68c47003915000265be81341400a04 to your computer and use it in GitHub Desktop.
Preloader script
<?php
/**
* This file is generated automatically by Preloader.
*
* This script uses Composer Autoload file and `require_once` to preload the files in this
* list. Add this file to your `php.ini` in `opcache.preload` to preload this list into
* PHP at startup. Additionally, this file also includes information about Opcache.
*
*
* Add (or update) this line in `php.ini`:
*
* opcache.preload=/www/app/vendor/preload.php
*
* --- Config ---
* Generated at: 2019-11-20 15:20:49 UTC
* Opcache
* - Used Memory: 130585 B
* - Free Memory: 294896 B
* - Wasted Memory: 347764 B
* - Cached files: 2675
* - Hit rate: 94%
* - Misses: 542
* Preloader config
* - Memory limit: 32 MB
* - Overwrite: false
* - Files excluded: 0
* - Files appended: 0
*/
require_once '/www/app/vendor/autoload.php';
$files = [
'/www/app/ClassFoo.php',
'/www/app/ClassBar.php',
'/www/app/ClassBaz.php',
'/www/app/ClassQuz.php',
'/www/app/ClassQux.php',
'/www/app/vendor/author/package/src/Example.php',
// ...
];
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