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