Process/Php7.php
[Pman.Core] / Process / Php7.php
index 074ecb6..4dea8bc 100644 (file)
  *
  */
 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);
-        exit;
-        $this->scan($base, '');
+//        $this->scan($this->rootDir, 'Pman');
+//        $this->scan($this->rootDir);
+        
+        foreach (scandir($this->rootDir) as $d) {
+            echo "{$d}\n";
+        }
     }
     
-    function scan($p,$pr, $path=false) {
-        
-        
-        
-        $full_path = array($p,$pr);
+    function scan($dir) 
+    {
+        $full_path = array($p, $pr);
         $class_path = array();
-        if ($path !== false)  {
-            $full_path= array_merge($full_path, $path);
+        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) {
-            
+
+        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)) {
+                if (!preg_match('/\.php$/', $d)) {
                     continue;
                 }
-                $clp[] = preg_replace('/\.php$/','', $d);
-                
+                $clp[] = preg_replace('/\.php$/', '', $d);
+
                 //print_r("CLP:          " . implode('/', $clp)."\n");
-                var_dump(implode('/', $clp ));
+                require_once "Pman/" . implode('/', $clp) . '.php';
                 continue;
             }
             $clp[] = $d;
             // otherwise recurse...
             //print_r("RECURSE:        " . implode('/', $clp)."\n");
-            
-            $this->scan($p,$pr, $clp);
+
+            $this->scan($p, $pr, $clp);
         }
     }
-    
-    
-}
\ No newline at end of file
+
+//    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");
+//
+//        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");
+//                require_once "Pman/" . implode('/', $clp) . '.php';
+//                continue;
+//            }
+//            $clp[] = $d;
+//            // otherwise recurse...
+//            //print_r("RECURSE:        " . implode('/', $clp)."\n");
+//
+//            $this->scan($p, $pr, $clp);
+//        }
+//    }
+
+    function output() 
+    {
+        die("DONE");
+    }
+
+}