mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #9249 from murrant/ns-collision
Config class collides with Config in model namespace
This commit is contained in:
@ -3,10 +3,9 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Fico7489\Laravel\Pivot\Traits\PivotEventTrait;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Database\Query\JoinClause;
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Exceptions\InvalidIpException;
|
||||
use LibreNMS\Util\IP;
|
||||
use LibreNMS\Util\IPv4;
|
||||
@ -144,7 +143,7 @@ class Device extends BaseModel
|
||||
*/
|
||||
public function displayName()
|
||||
{
|
||||
if (Config::get('force_ip_to_sysname') && $this->sysName && IP::isValid($this->hostname)) {
|
||||
if (\LibreNMS\Config::get('force_ip_to_sysname') && $this->sysName && IP::isValid($this->hostname)) {
|
||||
return $this->sysName;
|
||||
}
|
||||
|
||||
@ -167,7 +166,7 @@ class Device extends BaseModel
|
||||
return $name;
|
||||
}
|
||||
|
||||
$length = Config::get('shorthost_target_length', $length);
|
||||
$length = \LibreNMS\Config::get('shorthost_target_length', $length);
|
||||
if ($length < strlen($name)) {
|
||||
$take = substr_count($name, '.', 0, $length) + 1;
|
||||
return implode('.', array_slice(explode('.', $name), 0, $take));
|
||||
|
Reference in New Issue
Block a user