Download the PHP package bnomei/kirby-nitro without Composer

On this page you can find all versions of the php package bnomei/kirby-nitro. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-nitro

⛽️ Kirby Nitro

Release Downloads Coverage Maintainability Discord

Nitro speeds up the loading of content in your Kirby project.

Commercial Usage


Support open source!

This plugin is free but if you use it in a commercial project please consider to sponsor me or make a donation.
If my work helped you to make some cash it seems fair to me that I might get a little reward as well, right?

Be kind. Share a little. Thanks.

‐ Bruno
 

M O N E Y
Github sponsor Patreon Buy Me a Coffee Paypal dontation Hire me

Installation

Checklist: When to use this plugin?

Global & Atomic Cache

The Nitro cache is a global cache. This means that the cache is shared between all HTTP_HOST environments. This will make it behave like a single database connection.

The Nitro cache is by default an atomic cache. This means that the cache will block the cache file for the full duration of your request to maintain data consistency. This will make it behave like a database with locks.

[!WARNING] No matter how many php-fpm workers you have, only one will be running at a time when Nitro is in atomic mode! You have been warned! But this is the only way to guarantee data consistency, and it will still be wicked fast.

Usecase

The plugin will speed up Kirby setups, loading 100-2000 page models in a single request by providing a special cache. It solves the three major performance bottlenecks in Kirby that I know of and links the cache between CLI and HTTP requests.

It does this by:

Setup

For each template you want to be cached you need to use a model to add the content cache logic using a trait.

site/models/default.php

or

site/models/article.php

[!NOTE] You can also use the trait for user models. File models are patched automatically.

Using the Cache

You can use the single-file-based cache of Nitro to store your own key-value pairs, just like with a regular cache in Kirby.

The Nitro cache is a bit smarter than the default cache in Kirby. It allows you optionally provide keys as arrays, it will serialize values automatically (like Kirby fields to their ->value()) and storing a value can be canceled.

[!WARNING] Since the Nitro cache is fully loaded with every request I would not advise to store too many big chunks of data (like HTML output or when having too many models in total).

Using the Cache Driver in Kirby

You can also use the singe-file-based cache of Nitro as a cache driver for Kirby. This will allow you to use it for caching of other extensions in Kirby.

[!NOTE] I would highly recommend to use the Nitro cache for Kirby's UUID cache.

site/config/config.php

Settings

bnomei.nitro. Default Description
global true all HTTP_HOSTs will share the same cache
atomic true will lock the cache while a request is processed to achieve data consistency
sleep 1000 duration in MICRO seconds before checking the lock again
auto-unlock-cache true will forcibly unlock the cache if it could not get a lock within set time
auto-clean-cache true will clean the cache once before the first get()
patch-dir-class always on monkey-patch the \Kirby\Filesystem\Dir class to use Nitro for caching
patch-files-class true monkey-patch the \Kirby\CMS\Files class to use Nitro for caching its content
max-dirty-cache 512 write every N changes or on destruct
json-encode-flags JSON_THROW_ON_ERROR
model.read true read from cache for all models that use the ModelWithNitro trait
model.write true write to cache for all models that use the ModelWithNitro trait

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

MIT

It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.


All versions of kirby-nitro with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2.0
getkirby/composer-installer Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bnomei/kirby-nitro contains the following files

Loading the files please wait ....