Download the PHP package patkruk/laravel-cached-settings without Composer

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

Laravel Cached Settings

Build Status

Provides a basic container for your configuration parameters and settings.

Key-value pairs are stored in your database and, if cache is enabled in the package configuration file, also in your caching system. When you try to retrieve a value from the container, the caching system is always checked first and if the value exists, the database layer is never touched. In case the value is not in your cache, it's retrieved from the persistent storage and also automatically added to the caching layer.

The package uses the current environment name to oraganize settings in order to allow you have different values based on the environment the application is running in. Therefore, a value added while in "local", won't be available in "production" or "testing".

One of the artisan commands the package offers, allows you to import a json file into the persistant storage system. See below for more info.

Installation

Add the package to your composer.json file:

Use composer to install the package:

Pusblish a configuration file using artisan:

Configuration

Registering the Package

Add an alias to the bottom of app/config/app.php

and register this service provider at the bottom of the $providers array:

Running Migrations

You can specify the table name in the published package config file.

Usage

Adding a new setting:

You can use "dot" notation to imitate a multi-dimensional array:

Retrieving a setting:

Checking if a setting exists:

It checks the persistent storage and returns a boolean.

Updating a setting:

Deleting a setting:

This command removes a setting from the caching and persistent storages!

Deleting all settings:

This command removes all settings from the caching and persistent storages!

Refreshing a setting in cache:

If you have changed a value directly in the database or just want to make sure that your cache is up-to-date, you can refresh individual settings.

The value in your cache is updated with the one from the database.

Refreshing all settings in cache:

You can update your cache with the values from the database with just one command.

Getting a list of all keys:

This command returns an array of all keys currently stored in the database.

Getting all key and settings:

This command returns an associative array of all settings.

Getting all settings (table dump):

This command returns a dump of the entire table.

Artisan Commands

The packages provides 5 different artisan commands for your convenience:

Setting a parameter:

Or simply run the command below and provide the needed info when asked:

You can always specify the environment by using the "env" option:

Returning a parameter:

Or simply:

Refreshing all parameters in cache:

Deleting all parameters (cache and database):

Importing a JSON file:

This command allows you to import a file with a JSON object which has string or number fields only. Example:

As always, you can specify the environment by using the "env" option:

License

Laravel Cached Settings is open-sourced software licensed under the MIT license


All versions of laravel-cached-settings with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version 4.1.*
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 patkruk/laravel-cached-settings contains the following files

Loading the files please wait ....