Prints content of folder.
@param bool $dots True if show dots, false otherwise.
177614
public function content($dots = true) {
		$content = scandir($this->path);
		foreach($content as $file) {
			if($dots == false) {
				if((strcmp($file, ".") == 0) or (strcmp($file, "..") == 0)) {
					continue;
				}
			}
			echo "<a href='".$this->path."/".$file."'>".$file."</a><br>";
		}
	}
1364829
private function scan_dir($folder, $files = [])
    {
        // Ensure maximum portability.
        $folder = \trailingslashit($folder);

        if (isset($this->visited[ $folder ])) {
            return $files;
        }

        // Check the target exists.
        if (\is_dir($folder)) {
            // Scan the directory for files to include.
            $contents = \scandir($folder);
            $this->visited[ $folder ] = null;
        }

        if (!empty($contents)) {
            // go through each file, adding it to the $files list.
            foreach ($contents as $file) {
                $path = $folder . $file;

                $class = \str_replace([\get_stylesheet_directory(), \get_template_directory(), '.php'], '', $path);
                $class = \trim(
                    \str_replace(['/', 'theme'], ['\\', 'Theme'], $class),
                    '\\'
                );

                if ('.' === $file || '..' === $file) {
                    continue;
                } elseif (\pathinfo($path, PATHINFO_EXTENSION) === 'php') {
                    $files[ $class ] = $path;
                } elseif (\is_dir($path)) {
                    // Sub directory, scan this dir as well.
                    $files = $this->scan_dir(\trailingslashit($path), $files);
                }
            }
        }

        return $files;
    }
609784
public function createFolder($folder, $allFolders = FALSE)
    {
        if (substr($folder, -1) != '/') $folder = $folder . '/';
        if (!is_dir($folder)) {
            @mkdir($folder, 0777, $allFolders) or die ("Error creating folder '{$folder}'.");
        }
    }
530868
public static function outputStyles($output = '')
    {
        self::lookIfProcessFiles('style', 'header');

        $template = self::$templates['style'];
        $styles = self::$data['style']['header'];

        foreach ($styles as $value) {
            $output .= sprintf(
                $template,
                $value['url']
            );
        }

        self::$data['style']['header'] = [];

        return ! empty($output) ? $output : false;
    }
1305834
static function contents($directory) {
        if (!self::exists($directory)) return null;

        $dircontents = [];

        $contents = scandir($directory);

        foreach ($contents as $content) {
            if ($content != '.' && $content != '..') {
                array_push($dircontents, $content);
            }
        }

        return $dircontents;
    }
218413
private function printAdminBarTree( $tree, $nodes, $ul = true ) {
		if ( is_countable( $tree ) && count( $tree ) > 0 ) {
			if ( $ul ) {
				echo '<ul class="ul-disc">';
			}
			foreach ( $tree as $node ) {
				$title = trim( strip_tags( html_entity_decode( $nodes[ $node['name'] ]->title ) ) );
				$href = $nodes[ $node['name'] ]->href;
				if ( ! empty( $title ) && $href !== '#' ) {
					echo "<li><a href='{$href}'>{$title}</a>";
					$this->printAdminBarTree( $node['children'], $nodes, true );
					echo '</li>';
				} else {
					$this->printAdminBarTree( $node['children'], $nodes, false );
				}
			}
			if ( $ul ) {
				echo '</ul>';
			}
		}
	}
774080
public function runDot($dotString)
    {
        $descriptorSpec = array(
            0 => array("pipe", "r"), // stdin
            1 => array("pipe", "w"), // stdout
            2 => array("pipe", "a") // stderr
        );

        $process = proc_open('dot -Tsvg', $descriptorSpec, $pipes);

        if (is_resource($process)) {
            fwrite($pipes[0], $dotString);
            fclose($pipes[0]);

            $svg = stream_get_contents($pipes[1]);
            fclose($pipes[1]);

            proc_close($process);
            $svg = explode('<svg ', $svg);

            // has it worked out?
            if (count($svg) < 2) {
                return false;
            }

            return '<svg ' . $svg[1];
        }

        return false;
    }
63685
public function output($flags = 0x00003) {
    if (($flags & self::OUTPUT_HEADER) == self::OUTPUT_HEADER) {
      $this->sendHeaders();
    }
    
    if ($this->outputClosure instanceof \Closure) {
      $c = $this->outputClosure;
      $c();
      return;
    }
    
    if (($flags & self::OUTPUT_BODY) == self::OUTPUT_BODY) {
      print $this->body;
    }
  }
1222166
public function execute($files)
  {
    printLn('=> PageWriter.');
    $pages = Application::db()->retrieve('page_list');

    $writer = new DataWriter();

    foreach($pages as $page) {
      $tmpl = $this->make_data($page);
      $writer->write($tmpl['slug'], 'index.html', $tmpl['html']);
    }
  }
462070
public function printResults()
    {
        echo $this->getHeader();
        echo $this->getErrors();
        echo $this->getFailures();
        echo $this->getWarnings();
        echo $this->getFooter();
    }
826552
private function render($row = 0)
    {
        if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
            $rows = ($this->showSummary ? array_merge($this->rows, [$this->getSummary()]) : $this->rows);
            $this->output->reWrite($rows, !$this->showSummary);
        } else {
            $this->output->writeln($this->rows[$row]);
        }
    }
349643
function output( $string = false, $addEOL = true )
    {
        if ( $this->isQuiet() )
            return;
        print( $string );
        if ( $addEOL )
            print( $this->endlineString() );
    }
359935
public function writeContent()
    {
        $dirPath = dirname($this->getPath());

        if (!is_dir($dirPath)) {
            mkdir($dirPath, 0755, true);
        }

        file_put_contents(
            $this->getPath(),
            $this->getContent()
        );
    }
164140
public function output()
    {
        if ($this->_output) {
            return;
        }
        if ($this->getFormat() === 'html') {
            $this->outputHtml();
        } else {
            $this->outputPlaintext();
        }
        $this->_output = true;
    }
1265318
public function printDescription(Project $project)
    {
        if ($project->getDescription() !== null) {
            self::$out->write($project->getDescription() . PHP_EOL);
        }
    }
913584
public function folders($folders)
    {
        foreach((array) $folders as $folderPath)
        {
            if (! $this->file->exists($folderPath))
            {
                $this->file->makeDirectory($folderPath);
            }
        }
    }
346702
public function markdownPosts($dir = null)
    {

        $source = collect($this->markdownFiles($dir));

        if (empty($source)) {
            return false;
        }

        //map files
        $files = $source->map(
            function ($file) {

                    $array = $this->markdownToArray($file);
                    $arr['url'] = $array['url'];
                    $arr['last_modified'] = $array['last_modified'];
                    $arr['time_ago'] = $array['time_ago'];
                    $arr['link'] = $array['link'];
                    $arr['title'] = $array['title'];
                    $arr['excerpt'] = $array['excerpt'];
                    $arr['content'] = $array['content'];
                    return $arr;

            }
        );

        return $files;

    }