Download the PHP package pbergman/tree-helper without Composer

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

Tree builder helper

this is a small library for symfony console to print a tree in a fluent and flexible way.

The output is similar as the linux tree command, an can be used to debug/output relational data.

Usage:

or

that will output:

for other example see the the tests.

Methods

newNode($name)

Create an new node and bind it to the parent

addNode($node)

Append node to tree

end()

Will return the parent object (if set else null)

getRoot()

Will return the root node

printTree($output)

Print the tree to output

findNode($name)

Search a node by title

toArray()

Returns a array representation of the data

getTitle()

Returns the title of the node

setTitle($title)

Sets the title of the node

addValue($value)

Add a value to the node, this can be a valid scalar or a object with method __toString

addArray($array)

Add a nested array to node

setValues($array)

Add a flat array to node, this be set as the values of the node

setParent($parent)

Set the parent of the node, will trow a RuntimeException is the the node all ready is linked to the given node, so we don`t get infinite loops.

getNodes()

Get all the (child) nodes defined in the node, all the nodes are only saved in the root so to get all nodes you probably have to do this $t->getRoot()->getNodes(); else it will return the nodes where the parent is set as node where from you calling the method.

setMaxDepth($depth)

Set the max depth of the node values, this can be done globally (on root) or on a specific node.

getMaxDepth()

Return the max depth that is set

setFormats()

Set the form that is used for example:

no it will use a 2 space indent instead of 4, see tests

setFormat($id, $format)

Overwrite a specific format


All versions of tree-helper with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
symfony/console Version >=2.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 pbergman/tree-helper contains the following files

Loading the files please wait ....