public function testArrayOutput() { $this->pile = new Pile($this->testArray); $array = $this->pile->toArray(); $this->assertTrue(is_array($array)); $this->compareArrayToTest($array); }
/** * Build the request object */ public function __construct() { $vars = ['request' => $_REQUEST, 'get' => $_GET, 'post' => $_POST, 'cookies' => $_COOKIE, 'files' => $this->organiseFiles($_FILES), 'server' => $_SERVER]; parent::__construct($vars); $this->method = $this->server->REQUEST_METHOD; $this->requestURI = explode("/", substr(@$this->server->REQUEST_URI, 1)); }
/** * Construct the router * * @param $baseURI = "/" * @param $routesDir = DIR . "/routes" */ public function __construct($baseURI = "/", $routesDir = "/") { $this->routesDir = $routesDir; $this->baseURI = $baseURI; parent::__construct(); $this->loadRoutes(); }
/** * Get a list of all the log files * * @param string $logDir * @return Pile */ public function getFiles($logDir) { $fileArray = []; $dir = new \DirectoryIterator($logDir); foreach ($dir as $file) { $name = $file->getFilename(); if ($file->isDot() || $file->getFilename() == ".gitignore") { continue; } $fileData = ['fileName' => $name, 'fileDate' => substr($name, 4), 'lastModified' => $file->getMTime()]; $fileArray[] = $fileData; } $files = new Pile($fileArray); $files->sort('lastModified', true); return $files; }