aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/tests/autoload.php
blob: b98b13abdfc47c7fa4bb74af1fd9ecfce62ebbb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

error_reporting(E_ALL);

function getGeneratedFiles($dir, &$results = array())
{
    $files = scandir($dir);

    foreach ($files as $key => $value) {
        $path = realpath($dir.DIRECTORY_SEPARATOR.$value);
        if (!is_dir($path)) {
            $results[] = $path;
        } else if ($value != "." && $value != "..") {
            getGeneratedFiles($path, $results);
        }
    }
    return $results;
}

foreach (getGeneratedFiles("generated") as $filename)
{
    if (!is_dir($filename)) {
        include_once $filename;
    }

}