Skip to content

Instantly share code, notes, and snippets.

View nzuwera's full-sized avatar

Nzuwera Gilbert nzuwera

View GitHub Profile
@nzuwera
nzuwera / EasyTree.php
Created February 10, 2018 19:45 — forked from studentIvan/EasyTree.php
EasyTree php tree build algorithm
<?php
/**
* 1. This Algorithm can help you build tree as a nested php array from array like ('id' => x, 'parent_id' => y)
* 2. Algorithm speed = {O(n log n) + О(N)}
*/
class EasyTree
{
public static
$idKeyName = 'id', $parentIdKeyName = 'parent_id', $childrenKeyName = 'children';
@nzuwera
nzuwera / cli.args.php
Created January 9, 2018 14:07 — forked from jadb/cli.args.php
Parse PHP CLI arguments
http://pwfisher.com/nucleus/index.php?itemid=45
This command line option parser supports any combination of three types of options (switches, flags and arguments) and returns a simple array.
<?php
/**
* CommandLine class
*
* @package Framework
*/
/**
<?php
/**
* Simple FTP Class
*
* @package SFTP
* @name SFTP
* @version 1.0
* @author Shay Anderson 05.11
* @link shayanderson.com
* @license http://www.gnu.org/licenses/gpl.html GPL License