/functions/tree.php

Description

tree.php

This file provides functions to walk trees of folders, for instance to delete a whole tree.

Includes
require_once (SM_PATH.'functions/imap.php') (line 16)

Clearly, this needs the IMAP functions..

Functions
addChildNodeToTree (line 54)

Will insert a new value into the tree, based on a given comparison value.

void addChildNodeToTree (mixed $comparisonValue, mixed $value, array &$tree)
  • mixed $comparisonValue: comparisonValue the value to determine where the new element should be placed.
  • mixed $value: value the new node to insert
  • array &$tree: tree the tree to insert the node in, by ref
findParentForChild (line 26)

Recursive function to find the correct parent for a new node.

  • return: the index of the parent
int findParentForChild (mixed $value, int $treeIndexToStart, array $tree)
  • mixed $value: value the value to find a parent for
  • int $treeIndexToStart: treeIndexToStart where to start the search, usually the root node (0)
  • array $tree: tree the tree to search
simpleWalkTreePre (line 172)

Recursive function that outputs a tree In-Pre-Order.

void simpleWalkTreePre (int $index, array $tree)
  • int $index: index the node to start (usually 0)
  • array $tree: tree the tree to walk
walkTreeInPostOrderCreatingFoldersUnderTrash (line 134)

Recursively walk a tree of folders to create them under the trash folder.

void walkTreeInPostOrderCreatingFoldersUnderTrash ( $index,  $imap_stream,  $tree,  $topFolderName)
  • $index
  • $imap_stream
  • $tree
  • $topFolderName
walkTreeInPreOrderDeleteFolders (line 120)

Recursively delete a tree of mail folders.

void walkTreeInPreOrderDeleteFolders (int $index, stream $imap_stream, array $tree)
  • int $index: index the place in the tree to start, usually 0
  • stream $imap_stream: imap_stream the IMAP connection to send commands to
  • array $tree: tree the tree to walk
walkTreeInPreOrderEmptyTrash (line 81)

Recursively walk the tree of trash mailboxes and delete all folders and messages

void walkTreeInPreOrderEmptyTrash (int $index, stream $imap_stream, array $tree)
  • int $index: index the place in the tree to start, usually 0
  • stream $imap_stream: imap_stream the IMAP connection to send commands to
  • array $tree: tree the tree to walk

Documentation generated on Fri, 28 Nov 2014 04:21:58 +0100 by phpDocumentor 1.4.3