getTree() публичный Метод

Get the tree.
public getTree ( ) : array
Результат array
Пример #1
0
 /**
  * Method to create sub directories within the zip archive
  *
  * @param  array $branch
  * @param  string $level
  * @param  string $orig
  * @return void
  */
 public function addDir($branch, $level = null, $orig = null)
 {
     if (!is_array($branch)) {
         $dir = new Dir($branch);
         $branch = $dir->getTree();
     }
     foreach ($branch as $leaf => $node) {
         if (is_array($node)) {
             if (null === $level) {
                 $new = basename($leaf);
                 $orig = substr($leaf, 0, strrpos($leaf, $new));
             } else {
                 $new = $level . $leaf;
             }
             $this->archive->addEmptyDir($new);
             $this->addDir($node, $new, $orig);
         } else {
             $this->archive->addFile($orig . $level . '/' . $node, $level . '/' . $node);
         }
     }
 }