-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCreateClassMap.php
More file actions
46 lines (38 loc) · 1.24 KB
/
CreateClassMap.php
File metadata and controls
46 lines (38 loc) · 1.24 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Create Class Map
*
* @package Molajo
* @copyright 2014-2015 Amy Stephen. All rights reserved.
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
function createClassMap($base, $qcn_prefix, array $exclude_array = array())
{
$function_class_map = array();
$objects = new RecursiveIteratorIterator (
new RecursiveDirectoryIterator($base),
RecursiveIteratorIterator::SELF_FIRST
);
foreach ($objects as $file_path => $file_object) {
$include = true;
if (count($exclude_array) === 0) {
} else {
foreach ($exclude_array as $search_for) {
if (strrpos($file_object->getPath(), $search_for) === false) {
} else {
$include = false;
}
}
}
if ($file_object->getExtension() == 'php') {
} else {
$include = false;
}
if ($include === true) {
$qcn = $qcn_prefix . $file_object->getBaseName('.php');
$path = $file_object->getPath() . '/' . $file_object->getFileName();
$function_class_map[$qcn] = $path;
}
}
return $function_class_map;
}