2017 © Pedro Peláez
 

library packer

Simple Key-Value Storage for PHP. dead simple.

image

mauris/packer

Simple Key-Value Storage for PHP. dead simple.

  • Thursday, March 22, 2018
  • by mauris
  • Repository
  • 1 Watchers
  • 7 Stars
  • 64 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 2 % Grown

The README.md

Packer-PHP

Simple Key-Value Storage for PHP., (*1)

Packer aims to be a zero-config, zero-install and works as PHP works library that developers can quickly pull into their project for use immediately for small and medium scaling usage., (*2)

Build Status, (*3)

Installation via Composer

To use Packer in your project, add a dependency to mauris/packer in your project's composer.json file. The following is a minimal sample configuration to use Packer in your project., (*4)

{
    "require": {
        "mauris/packer": "1.0"
    }
}

After which run the command:, (*5)

php composer.phar install

Learn more about Composer., (*6)

Usage

Once you have installed Packer as your project's dependencies using Composer, you can use the Packer class directly in your code., (*7)

To work with a Packer file, you create an instance of Packer like this:, (*8)

$packer = new Packer\Packer('config.pack');

Writing / Overwriting

To write a key and value entry to the Packer file, simply use the write($key, $value) method like this:, (*9)

$packer->write('autorun', false);

Reading

To fetch a value from a Packer file, use the read($key) method., (*10)

$autorun = $packer->read('autorun');

Deleting

To delete a value from the Packer file:, (*11)

$packer->delete('autorun');
// $packer->exist('autorun') === false

Fetch all keys

To iterate through the Packer file, you can fetch the keys using the keys() method:, (*12)

echo '<ul>';
foreach($packer->keys() as $key){
    echo '<li>' . $packer->read($key) . '</li>';
}
echo '</ul>';

Clearing

To remove all entries from the Packer file:

$packer->clear();

License

Packer is released open source under the New BSD 3-Clause License., (*13)

The Versions

22/03 2018

dev-master

9999999-dev http://github.com/mauris/Packer-PHP

Simple Key-Value Storage for PHP. dead simple.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

database storage key memory hash

11/10 2012

1.0.0

1.0.0.0 http://github.com/thephpdeveloper/Packer-PHP

Simple Key-Value Packer Storage for PHP

  Sources   Download

BSD-3-Clause

database storage key memory hash

11/10 2012

1.0.1

1.0.1.0 http://github.com/thephpdeveloper/Packer-PHP

Simple Key-Value Storage for PHP. dead simple.

  Sources   Download

BSD-3-Clause

database storage key memory hash

11/10 2012

1.0.2

1.0.2.0 http://github.com/thephpdeveloper/Packer-PHP

Simple Key-Value Storage for PHP. dead simple.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.0

 

database storage key memory hash