From 33f1d041649d82e2a0545336040a9b4f4d4d55ac Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 24 Aug 2018 15:05:22 +0800 Subject: [PATCH] Process/Php7.php --- Process/Php7.php | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/Process/Php7.php b/Process/Php7.php index a5abf2f9..e0a89ab0 100644 --- a/Process/Php7.php +++ b/Process/Php7.php @@ -23,8 +23,48 @@ class Pman_Core_Php7 extends Pman } } - - + function cliHelpSearch($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"); + + foreach(scandir(implode('/', $full_path)) as $d) { + + if (!strlen($d) || $d[0] == '.') { + continue; + } + $chk = $full_path; + $chk[] = $d; + + $clp = $class_path; + + + + //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); + + //print_r("CLP: " . implode('/', $clp)."\n"); + var_dump(implode('/', $clp )); + continue; + } + $clp[] = $d; + // otherwise recurse... + //print_r("RECURSE: " . implode('/', $clp)."\n"); + + $this->cliHelpSearch($p,$pr, $clp); + } -- 2.39.2