Fully convert core to a modern module (#13347)

* Core module WIP

* update OS::make()

* core WIP

* try to finish up

* switch all core do os Model

* Mock WIP

* Working tests

* cleanup

* phpstan fixes

* style fixes

* fix agent

* trim space too
and a couple of cleanups

* corrected ios test data

* missed space

* update test data

* put escapes back

* another net-snmp difference

* Fix class description

* revert snmp.inc.php change, that can be a different PR

* revert snmp.inc.php change, that can be a different PR
This commit is contained in:
Tony Murray
2021-10-19 15:43:43 -05:00
committed by GitHub
parent 17b97abbd2
commit f94f7f23b8
24 changed files with 639 additions and 503 deletions

View File

@@ -1075,15 +1075,7 @@ function get_vm_parent_id($device)
*/
function str_to_class($name, $namespace = null)
{
$pre_format = str_replace(['-', '_'], ' ', $name);
$class = str_replace(' ', '', ucwords(strtolower($pre_format)));
$class = preg_replace_callback('/^(\d)(.)/', function ($matches) {
$numbers = ['Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine'];
return $numbers[$matches[1]] . strtoupper($matches[2]);
}, $class);
return $namespace . $class;
return \LibreNMS\Util\StringHelpers::toClass($name, $namespace);
}
/**