X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Process%2FPhp7.php;h=608107da8a81881d0d4bf19f5042ed1ebaf74a7e;hb=443623f47935eb52acd65a3ff0d84eab1fd5a98b;hp=0d6b7e086131c600c1ac79ce4170784208043a54;hpb=4a8fbb301dff94bf81acf3615393ec03b257ed05;p=Pman.Core diff --git a/Process/Php7.php b/Process/Php7.php index 0d6b7e08..608107da 100644 --- a/Process/Php7.php +++ b/Process/Php7.php @@ -8,73 +8,73 @@ * would be nice to write the code to fix them. * */ +require_once 'Pman.php'; -class Pman_Core_Php7 extends Pman +class Pman_Core_Process_Php7 extends Pman { - - static $cli_desc = "Tests for PHP compatibilty, by including files..."; - - - - function getAuth() + + static $cli_desc = "Tests for PHP compatibilty, by including files..."; + static $cli_opts = array(); + + function getAuth() { - if (empty($this->cli)) { + if (empty($this->bootLoader->cli)) { die("CLI only"); } - } - function get() + function get($base, $opts = array()) { - $base = realpath(__DIR__ . '/../..'); - var_dump($base); + 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(array("Pman")); + $this->scan(array($this->bootLoader->project)); + exit; - $this->scan($base, ''); } - function scan($p,$pr, $path=false) { - - - - $full_path = array($p,$pr); - $class_path = array(); - if ($path !== false) { - $full_path= array_merge($full_path, $path); - $class_path = array_merge($class_path, $path); - } - //print_r("CHKDIR: ". implode('/', $full_path)."\n"); + function scan($route = array()) + { + $dir = $this->rootDir . "/" . implode("/", $route); - foreach(scandir(implode('/', $full_path)) as $d) { + foreach (scandir($dir) as $d) { if (!strlen($d) || $d[0] == '.') { continue; } - $chk = $full_path; - $chk[] = $d; - - $clp = $class_path; + if (is_dir("{$dir}/{$d}")) { + $this->scan(array_merge($route, array($d))); + continue; + } + if (!preg_match('/\.php$/', $d)) { + continue; + } - //print_r("CHK: " . implode('/', $chk)."\n"); - // is it a file.. and .PHP... - if (!is_dir(implode('/', $chk))) { - if (!preg_match('/\.php$/',$d)) { - continue; - } - $clp[] = preg_replace('/\.php$/','', $d); + try { - //print_r("CLP: " . implode('/', $clp)."\n"); - var_dump(implode('/', $clp )); - continue; + require_once implode('/', $route) . "/" . $d; + + } catch (ErrorException $ex) { + echo $ex->getMessage() . "\n"; } - $clp[] = $d; - // otherwise recurse... - //print_r("RECURSE: " . implode('/', $clp)."\n"); - $this->scan($p,$pr, $clp); } + } - -} \ No newline at end of file + function output() + { + die("DONE"); + } + +}