Download the PHP package shov/laravel-registry without Composer

On this page you can find all versions of the php package shov/laravel-registry. 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 laravel-registry

Installation

Run in root of project composer require shov/laravel-registry

Register service provider in your config/app.php

Usage

You allow to use DI or Facade to get registry instance

Methods

Method Description
has(string $key): bool Checks does the Registry has value for given key (including the immutable).
get(string $key, $default = null): mixed Tries to get value by given key, in a case there is no value for given key will be returned default value.
all(array $defaults = []): array Fetches all stored values (as key-value pairs array). Returns default array if no values. Includes immutable.
set(string $key, $value): static Tries to set/rewrite value by key. Be careful if key refers to immutable you will got an exception.
values(array $pairs): static Tries to set/rewrite values by key and do it with key-value pairs array. Be careful if one given of keys refers to immutable you will got an exception.
immutable(string $key, $value): static Tries to set immutable value for given key. Be careful if key already refers to immutable you will got an exception. Important thing is this condition: if you make immutable with key the same of existing the regular one, you can't to get the regular value because getting immutable values has the priority, but you still possible to reset regular value with this key using set()
forget(string $key): static Removes regular key-value pair. Be careful if key refers to immutable you will got an exception.
flush(bool $force): static Removes all regular key-value pairs. If you pass the true for $force all immutable pairs will removed as well.
getImmutableKeys(): array Returns one-dimension array of keys of immutable pairs stored in Registry.
stopPersist(): static After calling this function all changes will be holding just in memory and will be lost when script was terminated.

Overview

The goal of this project is implement this interface:

And provide it via IoC container two ways:

  1. DI via public function __constructor(Registry $registry)
  2. As the Facade Registry::has('key');

The save and loading data are making with the members given by constructor according to interfaces SaverInterface, LoaderInterface. I would like to provide several implementation looks like DbSaver, StorageSaver, FakeSaver (which do nothing when saving). So let's going to interfaces:

Then it should be great to publish the config which set the implementations we will use when run

For a while I'll put the tasks to the Issues tab

Locking

Well now I explain my point about locking.

First, the locking isn't persisting, that means the pairs which you have to lock, should be locked every time script run in code. Before you'll lock it the values can be changed.

Consequently as well as you desired make the pair locked you've got no method to unlock while script going on.

However the important thing is keeping in you mind the regular Registry has a global storage and any other process can change the value of the locked pair.

Global instances are dangerous. Actually I have to make think about it bit more. May be there is the reason to persist locked pairs or otherwise don't persist them never

The case I put locking to another instance:

Just now I put locking to the backlog for a while.


All versions of laravel-registry with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
illuminate/support Version ~5.4
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 shov/laravel-registry contains the following files

Loading the files please wait ....