Download the PHP package dryas/f3_tree without Composer

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

F3_Tree

A Tree helper for the PHP Fat-Free framework (F3) implementing the modified preorder tree traversal algorithm

Latest Stable Version Total Downloads License

What is Modified Preorder Tree Traversal

MPTT is a fast algorithm for storing hierarchical data (like categories and their subcategories) in a relational database. This is a problem that most of us have had to deal with, and for which we've used an adjacency list, where each item in the table contains a pointer to its parent and where performance will naturally degrade with each level added as more queries need to be run in order to fetch a subtree of records.

The aim of the modified preorder tree traversal algorithm is to make retrieval operations very efficient. With it you can fetch an arbitrary subtree from the database using just two queries. The first one is for fetching details for the root node of the subtree, while the second one is for fetching all the children and grandchildren of the root node.

The tradeoff for this efficiency is that updating, deleting and inserting records is more expensive, as there's some extra work required to keep the tree structure in a good state at all times. Also, the modified preorder tree traversal approach is less intuitive than the adjacency list approach because of its algorithmic flavour.

For more information about the modified preorder tree traversal method, read this excellent article called Storing Hierarchical Data in a Database.

What is F3_Tree

F3_Tree is a tree helper plugin for the Fat-Free Framework that provides an implementation of the modified preorder tree traversal algorithm making it easy to implement the MPTT algorithm in your applications.

It provides methods for adding nodes anywhere in the tree, deleting nodes, moving and copying nodes around the tree and methods for retrieving various information about the nodes.

F3_Tree is based on the fantastic Zebra_Mptt library by Stefan Gabos and uses table locks making sure that database integrity is always preserved and that concurrent MySQL sessions don't compromise data integrity. Also, F3_Tree uses a caching mechanism which has as result the fact that regardless of the type, or the number of retrieval operations, the database is read only once per script execution!

Instead of using the Mysqli extension for database access like the original Zebra_Mptt library is using, the F3_Tree library uses the PDO extension like it is used in the Fat-Free Framework.

Features

Requirements

PHP 5.0.0+, MySQL 4.1.22+, Fat-Free Framework 3.7.3+

Attention: As PDO offers connectors to different database systems, it is likely that the library also works with other database systems than MySQL (which I'm mostly using). I'm always glad if you want to offer your support on making the library more compatible with different database systems by doing a pull request with your changes. Thanks!

Installation

You can install F3_Tree via Composer

Or you can install it manually by downloading the latest version, unpacking it, and then including it in your project

Install MySQL table

Notice a directory called install containing a file named f3_tree.sql. This file contains the SQL code that will create the table used by the class to store its data. Import or execute the SQL code using your preferred MySQL manager (like phpMyAdmin) into a database of your choice.

How to use

Documentation

You can find more detailed information in the F3_Tree wiki:

Documentation


All versions of f3_tree with dependencies

PHP Build Version
Package Version
Requires php Version >=5.0.0
bcosca/fatfree-core Version ^3.6
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 dryas/f3_tree contains the following files

Loading the files please wait ....