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