Skip to content

Instantly share code, notes, and snippets.

View nimmneun's full-sized avatar

Stefan nimmneun

View GitHub Profile
@nimmneun
nimmneun / CsvReader.php
Created June 28, 2015 21:35
another php csv reader
<?php
/**
* User: nimmneun
* Date: 28.06.2015 19:46
*/
class CsvReader
{
private $lines;
private $delimiter;
private $wrapper;
@nimmneun
nimmneun / Shell.php
Last active September 15, 2018 23:09
Just a simple php shell_exec wrapper
<?php
/**
* @author nimmneun
* @since 28.06.2015 11:36
*/
class Shell
{
private $out;
private $cmd;
private $exc;
@nimmneun
nimmneun / CsvReader.php
Last active August 29, 2015 14:23
Simple php csv reader
<?php
/**
* @author nimmneun
* @since 27.06.2015 06:05
*/
class CsvReader
{
/**
* The single line strings.
* @var array
@nimmneun
nimmneun / Trunk.php
Last active August 29, 2015 14:22
Rather dumb approach to an object factory *lol
<?php
/**
* Universal Object factory ... well kinda :p
*
* @author nimmneun
* @since 06.06.2015 03:07
*/
class Trunk
{
/**
@nimmneun
nimmneun / loader.php
Created June 3, 2015 22:29
Another lol autoloader
<?php
/**
* @author nimmneun
* @since 04.06.2015 23:52
*/
const DS = DIRECTORY_SEPARATOR;
spl_autoload_register(function($class)
{
if (false === isset($GLOBALS['classes']))
@nimmneun
nimmneun / xmlify.php
Last active November 28, 2015 15:54
xmlify array (with CDATA) imho a nifty way to convert an array to an XML string =)
<?php
// Convert n-dimensinal array to xml style string & wrap CDATA.
function xmlify($arr)
{
$str = null;
foreach ($arr as $k => $v) {
if (is_array($v)) {
$str .= "<$k>" . xmlify($v) . "</$k>";
} else {
@nimmneun
nimmneun / Autoload.php
Last active August 29, 2015 14:19
Bad! Autoloader
<?php
/**
* @Author neun
* @since 20.04.2015 23:55
*/
Autoload::load();
class Autoload
{
<?php
/**
* @Author neun
* @since 17.04.2015 23:51
*/
class XMLifier
{
/**
* Regex chars that _dont_ need to be wrapped in CDATA.
* @var string
@nimmneun
nimmneun / XMLifier.php
Last active August 29, 2015 14:18
Create XML string from array
<?php
/**
* @Author neun
* @since 09.04.2015 21:23
*/
class XMLifier
{
/**
* Regex chars that _dont_ need to be wrapped in CDATA.
* @var string