getmodules gestion des erreurs
This commit is contained in:
parent
8dff1cd069
commit
fed10aa71d
@ -134,12 +134,14 @@ class helper {
|
||||
* du nom réel
|
||||
* du numéro de version
|
||||
*/
|
||||
public static function getModules() {
|
||||
$dirs = array_diff(scandir('module'), array('..', '.'));
|
||||
public static function getModules($folder = 'module') {
|
||||
|
||||
$dirs = array_diff(scandir($folder), array('..', '.'));
|
||||
foreach ($dirs as $key => $value) {
|
||||
// Dossier non vide
|
||||
if (file_exists('module/' . $value . '/' . $value . '.php')) {
|
||||
if (file_exists($folder . '/' . $value . '/' . $value . '.php')) {
|
||||
// Lire les constantes
|
||||
try {
|
||||
$class_reflex = new \ReflectionClass($value);
|
||||
$class_constants = $class_reflex->getConstants();
|
||||
// Constante REALNAME
|
||||
@ -159,6 +161,9 @@ class helper {
|
||||
'realName' => $realName,
|
||||
'version' => $version
|
||||
];
|
||||
} catch (Exception $e){
|
||||
// on ne fait rien
|
||||
}
|
||||
}
|
||||
}
|
||||
return($modules);
|
||||
|
0
module/gps/gps.php
Normal file
0
module/gps/gps.php
Normal file
Loading…
Reference in New Issue
Block a user