Skip to content

yorickdewid/php-atree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-atree

Fast memory tree storage structure for PHP

Atree is an in-memory search tree optimized for fast data retrieval. The search tree is based on a radix tree but avoids the wasted space of internal nodes.

Atree allows PHP developers to quickly store data in memory regardless of their datatype or size.

Building

Follow the usual PHP extension instructions

phpize
./configure --enable-atree
make
make test

Installing

Copy the extension from modules/atree.* to your php extension directory. Then load the extension from the php.ini config file.

extension=atree.so
# in case of Windows
extension=atree.dll

Will load the extension from the extension_dir directive.

Example

$db = new atree();
// Add new keypair to the tree
$db->put("key", "value");
$db->put("key2", array("foo","bar"));
// Request value by key
echo $db->get("key2");

For more examples see the example.php

License

BSD 3-cause

About

Fast memory tree storage structure for PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published