1. Go to this page and download the library: Download snapshotpl/preloader library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
snapshotpl / preloader example snippets
use DarkGhostHunter\Preloader\Preloader;
Preloader::make()->autoload(__DIR__ . '/vendor/autoloader.php')
->output(__DIR__.'/preloader.php')
->generate();
Preloader::make()->when(false); // You will never run, ha ha ha!
// index.php
App::make();
$response = $app->run();
$response->sendToBrowser();
// A week after deployment
$weekAfterDeploy = $app->deploymentTimestamp() + (7*24*60*60);
// If a week has passed, and no script was created, do it!
\DarkGhostHunter\Preloader\Preloader::make()
->when(time() > $weekAfterDeploy)
->autoload(__DIR__ , '/../vendor/autoload.php')
->memory(256) // 256MB of memory limit
->output(PHP_LOCALSTATEDIR . '/preload.php') // put it in /var.
->generate();
ini
opcache.preload=/www/app/preload.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.