-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.nstrack.php
57 lines (49 loc) · 1.47 KB
/
.nstrack.php
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
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* This is a config file for NStrack
*/
/** Directory which contains the source code */
Config::setSourceDir(Config::dir() . 'src/');
/** Class references that are known to be broken */
Config::setIgnore([
// 3rd-party tools
'FirePHP_Insight',
'PDFLib',
'scssc',
'PHPBrowserMobProxy_Client',
'Net_Server_Driver_Fork',
'HTTP_Server',
'DashboardPage',
'SaunterPHP_Framework_Exception',
'TCPDF_STATIC',
'ntlm_sasl_client_class',
// Missing modules
'GalleryConstants',
'utf8', // Needs to die
]);
$kohana = ['Event', 'Kohana', 'Kohana_Exception', 'Kohana_404_Exception'];
Config::setSort(function($a, $b) use ($kohana) {
if (is_array($a)) $a = array_shortest($a);
if (is_array($b)) $b = array_shortest($b);
$a_has_ns = (strpos($a, '\\') !== false);
$b_has_ns = (strpos($b, '\\') !== false);
if (!$a_has_ns and $b_has_ns) return -1;
if ($a_has_ns and !$b_has_ns) return 1;
$a_is_kohana = in_array($a, $kohana);
$b_is_kohana = in_array($b, $kohana);
if (!$a_is_kohana and $b_is_kohana) return -1;
if ($a_is_kohana and !$b_is_kohana) return 1;
if ($a < $b) return -1;
if ($a > $b) return 1;
return 0;
});
Config::setGroup(function(array $classes, $has_ns) use ($kohana) {
if ($has_ns) {
$section = 'sprout';
} else if (in_array(reset($classes), $kohana)) {
$section = 'kohana';
} else {
$section = 'php';
}
return $section;
});