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 class Pman_Core_Php7 extends Pman
13 {
14     
15     static $cli_desc = "Tests for PHP compatibilty, by including files..."; 
16     
17     
18     
19     function getAuth()
20     {
21         if (empty($this->cli)) {
22             die("CLI only");
23         }
24         
25     }
26     
27     function get()
28     {
29         $base = realpath(__DIR__ . '/../..');
30         var_dump($base);
31         exit;
32         $this->scan($base, '');
33     }
34     
35     function scan($p,$pr, $path=false) {
36         
37         
38         
39         $full_path = array($p,$pr);
40         $class_path = array();
41         if ($path !== false)  {
42             $full_path= array_merge($full_path, $path);
43             $class_path = array_merge($class_path, $path);
44         }
45         //print_r("CHKDIR:    ". implode('/', $full_path)."\n");
46         
47         foreach(scandir(implode('/', $full_path)) as $d) {
48             
49             if (!strlen($d) || $d[0] == '.') {
50                 continue;
51             }
52             $chk = $full_path;
53             $chk[] = $d;
54             
55             $clp = $class_path;
56             
57             
58             
59             //print_r("CHK:          " . implode('/', $chk)."\n");
60             // is it a file.. and .PHP...
61             if (!is_dir(implode('/', $chk))) {
62                 if (!preg_match('/\.php$/',$d)) {
63                     continue;
64                 }
65                 $clp[] = preg_replace('/\.php$/','', $d);
66                 
67                 //print_r("CLP:          " . implode('/', $clp)."\n");
68                 var_dump(implode('/', $clp ));
69                 continue;
70             }
71             $clp[] = $d;
72             // otherwise recurse...
73             //print_r("RECURSE:        " . implode('/', $clp)."\n");
74             
75             $this->scan($p,$pr, $clp);
76         }
77     }
78     
79     
80 }