X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Process%2FPhp7.php;h=8733aa2447fabcf895fde94647b985670eb663f3;hb=7555a8629d59778dc70e23f4467638f6326388f9;hp=66822bac8be27fd688cc46021be2d38ad6c3ae07;hpb=a138f612065b18fca162cd70250c8cfa4571a858;p=Pman.Core diff --git a/Process/Php7.php b/Process/Php7.php index 66822bac..8733aa24 100644 --- a/Process/Php7.php +++ b/Process/Php7.php @@ -22,26 +22,39 @@ class Pman_Core_Process_Php7 extends Pman die("CLI only"); } } - + function get($base, $opts = array()) { - $dir = array($this->rootDir); - $cls = array(); + set_error_handler(function ($errno, $errstr, $errfile, $errline ){ +// throw new ErrorException($errstr, $errno, 0, $errfile, $errline); + print_r(array( + $errno, + $errstr, + $errfile, + $errline + )); + }); -// $this->scan($this->rootDir, 'Pman'); - $this->scan($dir, $cls); + $this->scan(array("Pman")); + $this->scan(array("Hebe")); + + exit; } - function scan($dir, $cls) + function scan($route = array()) { - foreach (scandir(implode('/', $dir)) as $d) { + $dir = $this->rootDir . "/" . implode("/", $route); + + echo "Looking for {$dir}\n"; + + foreach (scandir($dir) as $d) { if (!strlen($d) || $d[0] == '.') { continue; } if (is_dir($d)) { - $this->scan(array_merge($dir, array($d)), array_merge($cls, array($d))); + $this->scan(array_merge($route, array($d))); continue; } @@ -49,7 +62,17 @@ class Pman_Core_Process_Php7 extends Pman continue; } + if(empty($route)){ + continue; + } + try { + + require_once implode('/', $route) . "/" . $d; + + } catch (ErrorException $ex) { + echo $ex->getMessage() . "\n"; + } }