function file_exists_with_path($directory) { global $data; foreach($data['site_paths'] as $path) { if(file_exists($path . '/' . $directory)) { return true; } } return false; } // MODULES // Récupération des modules foreach($data['site_module'] as $key => $value) { $data['site_' . $key] = 'module/system/' . $data['document_type'] . '/' . $data['site_module'][$key] . '.tpl'; try { if(file_exists_with_path('module/system/php/' . $data['site_module'][$key] . '.php')) { require 'module/system/php/' . $data['site_module'][$key] . '.php'; } else { throw new myException('warning', 5, 'File "module/system/php/' . $data['site_module'][$key] . '.php" not found'); } } catch (myException $e) { exception_handler($e); } }