[]]; $file = $config['file']; if (!is_array($file)) { $file = [NULL => $file]; } foreach ($file as $d => $f) { $data[$d] = htpasswd_load($f); } // Load the plugin. require_once __DIR__ . '/BridgeHtpasswd.php'; require_once __DIR__ . '/htpasswd.inc'; return new BridgeHtpasswd($data, $config); } function htpasswd_load($file) { $data = []; if (file_exists($file) && is_readable($file)) { $lines = explode("\n", trim(file_get_contents($file))); foreach ($lines as $line) { list($user, $password) = explode(":", trim($line), 2); $data[$user] = $password; } } return $data; }