All Projects → c9s → php-r3

c9s / php-r3

Licence: other
high performance r3 router extension for PHP

Programming Languages

c
50402 projects - #5 most used programming language
PHP
23972 projects - #3 most used programming language

Build Status

Build

Please note that --with-pcre-dir is required when your php is not compiled with bundled libpcre.

Build on Linux:

git submodule init
git submodule update
./configure --enable-r3 --with-pcre-dir=/usr --with-libdir=lib/x86_64-linux-gnu
make && make test
make install

Build on OS X (Macports):

git submodule init
git submodule update
phpize
./configure --enable-r3 --with-pcre-dir=/opt/local
make clean
make

Example

$tree = r3_tree_create_persist("app", 10);
if (!r3_tree_is_compiled($tree)) {
    r3_tree_insert($tree, "/foo/bar", ["simplecallback"]);
    r3_tree_insert($tree, "/foo/zoo", ["simplecallback"]);
    r3_tree_insert($tree, "/hack/zzz", ["simplecallback"]);
    r3_tree_compile($tree);
}
$data = r3_tree_match($tree, "/hack/zzz");
print_r($data);
$tree = r3_tree_create_persist("app", 10);

$ret = r3_tree_insert($tree, "/foo/bar", "simplecallback");
$ret = r3_tree_insert($tree, "/foo/zoo", ["controller","simplecallback"]);
$ret = r3_tree_insert($tree, "/hack/zzz", ["callable","simplecallback"]);
$ret = r3_tree_compile($tree);
$data = r3_tree_match($tree, "/foo/bar");
$ret = r3_tree_delete_persist("app");
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].