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 //        $this->scan($this->rootDir, 'Pman');
29 //        $this->scan($this->rootDir);
30         
31         foreach (scandir($this->rootDir) as $d) {
32             echo "{$d}\n";
33         }
34     }
35     
36     function scan($dir) 
37     {
38         $full_path = array($p, $pr);
39         $class_path = array();
40         if ($path !== false) {
41             $full_path = array_merge($full_path, $path);
42             $class_path = array_merge($class_path, $path);
43         }
44         //print_r("CHKDIR:    ". implode('/', $full_path)."\n");
45
46         foreach (scandir(implode('/', $full_path)) as $d) {
47
48             if (!strlen($d) || $d[0] == '.') {
49                 continue;
50             }
51             $chk = $full_path;
52             $chk[] = $d;
53
54             $clp = $class_path;
55
56
57
58             //print_r("CHK:          " . implode('/', $chk)."\n");
59             // is it a file.. and .PHP...
60             if (!is_dir(implode('/', $chk))) {
61                 if (!preg_match('/\.php$/', $d)) {
62                     continue;
63                 }
64                 $clp[] = preg_replace('/\.php$/', '', $d);
65
66                 //print_r("CLP:          " . implode('/', $clp)."\n");
67                 require_once "Pman/" . implode('/', $clp) . '.php';
68                 continue;
69             }
70             $clp[] = $d;
71             // otherwise recurse...
72             //print_r("RECURSE:        " . implode('/', $clp)."\n");
73
74             $this->scan($p, $pr, $clp);
75         }
76     }
77
78 //    function scan($p, $pr, $path = false) 
79 //    {
80 //        $full_path = array($p, $pr);
81 //        $class_path = array();
82 //        if ($path !== false) {
83 //            $full_path = array_merge($full_path, $path);
84 //            $class_path = array_merge($class_path, $path);
85 //        }
86 //        //print_r("CHKDIR:    ". implode('/', $full_path)."\n");
87 //
88 //        foreach (scandir(implode('/', $full_path)) as $d) {
89 //
90 //            if (!strlen($d) || $d[0] == '.') {
91 //                continue;
92 //            }
93 //            $chk = $full_path;
94 //            $chk[] = $d;
95 //
96 //            $clp = $class_path;
97 //
98 //
99 //
100 //            //print_r("CHK:          " . implode('/', $chk)."\n");
101 //            // is it a file.. and .PHP...
102 //            if (!is_dir(implode('/', $chk))) {
103 //                if (!preg_match('/\.php$/', $d)) {
104 //                    continue;
105 //                }
106 //                $clp[] = preg_replace('/\.php$/', '', $d);
107 //
108 //                //print_r("CLP:          " . implode('/', $clp)."\n");
109 //                require_once "Pman/" . implode('/', $clp) . '.php';
110 //                continue;
111 //            }
112 //            $clp[] = $d;
113 //            // otherwise recurse...
114 //            //print_r("RECURSE:        " . implode('/', $clp)."\n");
115 //
116 //            $this->scan($p, $pr, $clp);
117 //        }
118 //    }
119
120     function output() 
121     {
122         die("DONE");
123     }
124
125 }