Download the PHP package dominator/tree without Composer

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

Build Status SensioLabsInsight

Overview

This library provides handling of data that is structured hierarchically using parent ID references. A typical example is a table in a relational database where each record’s “parent” field references the primary key of another record. Of course, usage is not limited to data originating from a database, but anything: you supply the data, and the library uses it, regardless of where the data came from and how it was processed.

It is important to know that the tree structure created by this package is read-only: you can’t use it to perform modifications of the tree nodes. If you need a library for that, you might want to take a look at nicmart/tree.

On the other hand, one nice thing is that it’s pretty fast. This does not only mean the code itself, but also that the constructor takes the input data in a format that is simple to create. For instance, to create a tree from database content, a single SELECT is sufficient, regardless of the depth of the tree and even for thousands of nodes.

Installation

The preferred way to install Tree is through Composer. For this, simply execute composer require bluem/tree (depending on your Composer installation, it could be “composer.phar” instead of “composer”) and everything should work fine. Or you manually add"bluem/tree": "~2.0" to the dependencies in your composer.json file and subsequently install/update dependencies.

Alternatively, you can clone the repository using git or download a tagged release.

Updating

As this library uses semantic versioning, you will get fixes and feature additions when running composer update, but not changes which break the API.

Usage

Creating a tree

Updating the tree with new data

Retrieving nodes

Getting a node’s parent, siblings, children, ancestors and descendants

Accessing a node’s properties

Example: Using it with a self-joined database table

Running Tests

PHPUnit is configured as a dev dependency, so running tests is a matter of:

If you want to see TestDox output or coverage data, you can comment in the commented lines in the <log> section of phpunit.xml.dist.

Version History

2.0 (2018-02-04)

1.5.3 (2016-05-20)

1.5.2 (2016-05-10)

1.5.1 (2016-01-16)

1.5 (2015-01-14)

1.4 (2015-01-07)

1.3 (2014-11-07)

1.2 (2014-10-14)

1.1 (2014-09-24)

1.0 (2014-06-26)

Author & License

This code was written by Carsten Blüm (www.bluem.net) and licensed under the BSD 2-Clause license.


All versions of tree with dependencies

PHP Build Version
Package Version
Requires php Version =5.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 dominator/tree contains the following files

Loading the files please wait ....