Process/Php7.php
[Pman.Core] / Process / Php7.php
1 <?php
2
3 /**
4  *
5  * PHP7 produces all sorts of pointless warnings... this attempts to just include all the files,
6  * so that you can view them..??
7  *
8  * would be nice to write the code to fix them.
9  *
10  */
11 require_once 'Pman.php';
12
13 class Pman_Core_Process_Php7 extends Pman 
14 {
15
16     static $cli_desc = "Tests for PHP compatibilty, by including files...";
17     static $cli_opts = array();
18
19     function getAuth() 
20     {
21         if (empty($this->bootLoader->cli)) {
22             die("CLI only");
23         }
24     }
25
26     function get($base, $opts = array()) 
27     {
28         $dir = array($this->rootDir);
29         $cls = array();
30         
31 //        $this->scan($this->rootDir, 'Pman');
32         $this->scan($dir, $cls);
33     }
34     
35     function scan($dir, $cls) 
36     {
37         foreach (scandir(implode('/', $dir)) as $d) {
38             
39             if (!strlen($d) || $d[0] == '.') {
40                 continue;
41             }
42             
43             if (is_dir($d)) {
44                 $this->scan(array_merge($dir, array($d)), array_merge($cls, array($d)));
45                 continue;
46             }
47             
48             if (!preg_match('/\.php$/', $d)) {
49                 continue;
50             }
51             
52             
53             
54         }
55         
56     }
57
58 //    function scan($p, $pr, $path = false) 
59 //    {
60 //        $full_path = array($p, $pr);
61 //        $class_path = array();
62 //        if ($path !== false) {
63 //            $full_path = array_merge($full_path, $path);
64 //            $class_path = array_merge($class_path, $path);
65 //        }
66 //        //print_r("CHKDIR:    ". implode('/', $full_path)."\n");
67 //
68 //        foreach (scandir(implode('/', $full_path)) as $d) {
69 //
70 //            if (!strlen($d) || $d[0] == '.') {
71 //                continue;
72 //            }
73 //            $chk = $full_path;
74 //            $chk[] = $d;
75 //
76 //            $clp = $class_path;
77 //
78 //
79 //
80 //            //print_r("CHK:          " . implode('/', $chk)."\n");
81 //            // is it a file.. and .PHP...
82 //            if (!is_dir(implode('/', $chk))) {
83 //                if (!preg_match('/\.php$/', $d)) {
84 //                    continue;
85 //                }
86 //                $clp[] = preg_replace('/\.php$/', '', $d);
87 //
88 //                //print_r("CLP:          " . implode('/', $clp)."\n");
89 //                require_once "Pman/" . implode('/', $clp) . '.php';
90 //                continue;
91 //            }
92 //            $clp[] = $d;
93 //            // otherwise recurse...
94 //            //print_r("RECURSE:        " . implode('/', $clp)."\n");
95 //
96 //            $this->scan($p, $pr, $clp);
97 //        }
98 //    }
99
100     function output() 
101     {
102         die("DONE");
103     }
104
105 }