nytris / antilag
Installs: 780
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=8.1
- asmblah/php-code-shift: ^0.1.17
Requires (Dev)
- mockery/mockery: 1.6.11
- phpstan/phpstan: ^1.10
- phpstan/phpstan-mockery: ^1.1
- phpunit/phpunit: ^10.2
README
Caches filesystem hits during early Nytris boot when open_basedir
is enabled,
prior to Nytris Boost starting.
Usage
Install this package with Composer:
$ composer require nytris/antilag
Configure Nytris platform:
nytris.config.php
<?php declare(strict_types=1); use Nytris\Antilag\AntilagPackage; use Nytris\Antilag\Stage; use Nytris\Boot\BootConfig; use Nytris\Boot\PlatformConfig; $bootConfig = new BootConfig(new PlatformConfig(__DIR__ . '/var/cache/nytris/')); $bootConfig->installPackage(new AntilagPackage(stage: Stage::STAGE_2)); // (Other Nytris packages, Nytris Boost is recommended...) $bootConfig->installPackage(new AntilagPackage(stage: Stage::STAGE_3)); return $bootConfig;
Invoke Stage 1 as early as possible
e.g. from a front controller:
app.php
<?php if (getenv('ENABLE_NYTRIS_ANTILAG') !== 'no') { require dirname(__DIR__) . '/vendor/nytris/antilag/antilag.php'; Antilag::stage1(); } // Using Symfony as an example: $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); // ...