nytris/antilag

Installs: 464

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

v0.0.3 2024-11-13 12:42 UTC

This package is auto-updated.

Last update: 2024-11-13 12:44:26 UTC


README

Build Status

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']);
// ...

See also