mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Remove Laravel helpers (#11428)
* Remove Laravel helpers * Replace qualifier with import
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
namespace LibreNMS\Validations;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Validator;
|
||||
|
||||
@@ -68,7 +69,7 @@ class Programs extends BaseValidation
|
||||
return;
|
||||
}
|
||||
|
||||
if (str_contains($output, '::1 is unreachable') || str_contains($output, 'Address family not supported')) {
|
||||
if (Str::contains($output, '::1 is unreachable') || Str::contains($output, 'Address family not supported')) {
|
||||
$validator->warn("IPv6 is disabled on your server, you will not be able to add IPv6 devices.");
|
||||
return;
|
||||
}
|
||||
@@ -81,7 +82,7 @@ class Programs extends BaseValidation
|
||||
$getcap_out = shell_exec("$getcap $cmd");
|
||||
preg_match("#^$cmd = (.*)$#", $getcap_out, $matches);
|
||||
|
||||
if (is_null($matches) || !str_contains($matches[1], 'cap_net_raw+ep')) {
|
||||
if (is_null($matches) || !Str::contains($matches[1], 'cap_net_raw+ep')) {
|
||||
$validator->fail(
|
||||
"$bin should have CAP_NET_RAW!",
|
||||
"setcap cap_net_raw+ep $cmd"
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
namespace LibreNMS\Validations;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Util\Env;
|
||||
use LibreNMS\Util\Git;
|
||||
@@ -99,7 +100,7 @@ class User extends BaseValidation
|
||||
);
|
||||
|
||||
$files = array_filter(explode(PHP_EOL, $find_result), function ($file) use ($ignore_files) {
|
||||
if (starts_with($file, $ignore_files)) {
|
||||
if (Str::startsWith($file, $ignore_files)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user