1 | <?php |
||
48 | class BuildTypeFromFiles |
||
49 | { |
||
50 | /** |
||
51 | * what kind of operating system are we running on? |
||
52 | * |
||
53 | * @param array $pathsToFiles |
||
54 | * a list of paths to use for the supported builders |
||
55 | * use this to override the default paths where the builders |
||
56 | * search |
||
57 | * @return OsType|null |
||
58 | * OsType if we know what kind of operating system we are running on |
||
59 | * null otherwise |
||
60 | */ |
||
61 | public function __invoke($pathsToFiles = []) |
||
65 | |||
66 | /** |
||
67 | * what kind of operating system are we running on? |
||
68 | * |
||
69 | * @return OsType|null |
||
70 | * OsType if we know what kind of operating system we are running on |
||
71 | * null otherwise |
||
72 | */ |
||
73 | public function usingDefaultPaths() |
||
77 | |||
78 | /** |
||
79 | * what kind of operating system are we running on? |
||
80 | * |
||
81 | * @param array $pathsToFiles |
||
82 | * a list of paths to use for the supported builders |
||
83 | * use this to override the default paths where the builders |
||
84 | * search |
||
85 | * @return OsType|null |
||
86 | * OsType if we know what kind of operating system we are running on |
||
87 | * null otherwise |
||
88 | */ |
||
89 | public static function usingPaths($pathsToFiles = []) |
||
100 | |||
101 | /** |
||
102 | * use a specific builder to try and work out which operating system |
||
103 | * we are on |
||
104 | * |
||
105 | * @param string $builderClass |
||
106 | * the class to use as a builder |
||
107 | * @param array $pathsToFiles |
||
108 | * a list of paths to override |
||
109 | * @return OsType|null |
||
110 | * OsType if we know what kind of operating system we are running on |
||
111 | * null otherwise |
||
112 | */ |
||
113 | private static function buildUsingBuilder($builderClass, $pathsToFiles) |
||
122 | |||
123 | /** |
||
124 | * a list of builders to try in a specific order |
||
125 | * |
||
126 | * @var array |
||
127 | */ |
||
128 | private static $builders = [ |
||
129 | BuildTypeFromLsbRelease::class, |
||
130 | BuildTypeFromEtcRedhatRelease::class, |
||
131 | BuildTypeFromEtcIssue::class, |
||
132 | BuildTypeFromSwVers::class, |
||
133 | ]; |
||
134 | } |
||
135 |