Skip to content

Commit 4dd3308

Browse files
authored
Merge pull request #130 from effone/skip-glob
Skip repeated file scan
2 parents c5d4b25 + 7c4187d commit 4dd3308

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

upload/inc/plugins/isango.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,10 +716,12 @@ function isango_gateway_error(string $gateway)
716716
function isango_config(string $gateway = "", string $mode = "")
717717
{
718718
$path = MYBB_ROOT . 'inc/plugins/isango/%s.ini';
719-
$gateways = array();
719+
static $gateways = array();
720720

721-
foreach (glob(sprintf($path, '*')) as $gate) {
722-
$gateways[] = strtolower(basename($gate, '.ini'));
721+
if (empty($gateways)) {
722+
foreach (glob(sprintf($path, '*')) as $gate) {
723+
$gateways[] = strtolower(basename($gate, '.ini'));
724+
}
723725
}
724726

725727
if (empty($gateway)) {

0 commit comments

Comments
 (0)