Autoloader: Rename module namespace
This commit is contained in:
parent
e049d8f3c4
commit
6742696e09
|
@ -40,6 +40,9 @@ class Loader
|
|||
*/
|
||||
private $namespaces = array();
|
||||
|
||||
/**
|
||||
* Detach spl autoload method from stack
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
$this->unRegister();
|
||||
|
|
|
@ -30,6 +30,11 @@ use Icinga\Application\Config;
|
|||
use Icinga\Web\Hook;
|
||||
use Zend_Controller_Router_Route as Route;
|
||||
|
||||
/**
|
||||
* Module handling
|
||||
*
|
||||
* Register modules and initialize it
|
||||
*/
|
||||
class Module
|
||||
{
|
||||
/**
|
||||
|
@ -112,6 +117,11 @@ class Module
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for an enabled module by name
|
||||
* @param string $name
|
||||
* @return boolean
|
||||
*/
|
||||
public static function exists($name)
|
||||
{
|
||||
return Icinga::app()->moduleManager()->hasEnabled($name);
|
||||
|
@ -215,9 +225,6 @@ class Module
|
|||
|
||||
$this->app->getLoader()->registerNamespace($moduleName, $moduleLibraryDir);
|
||||
|
||||
// TODO(mh): Old namespace for convenience (#4409). Should be removed immediately
|
||||
$this->app->getLoader()->registerNamespace('Icinga\\'. $moduleName, $moduleLibraryDir);
|
||||
|
||||
$this->app->getLoader()->registerNamespace($moduleName. '\\Form', $this->getFormDir());
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
use Icinga\Web\ModuleActionController;
|
||||
use Icinga\Web\Hook;
|
||||
use Icinga\File\Csv;
|
||||
use Icinga\Monitoring\Backend;
|
||||
use Monitoring\Backend;
|
||||
|
||||
class Monitoring_ListController extends ModuleActionController
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
|
||||
use Icinga\Monitoring\Backend;
|
||||
use Monitoring\Backend;
|
||||
use Icinga\Web\ModuleActionController;
|
||||
use Icinga\Web\Hook;
|
||||
use Icinga\Monitoring\Object\Host;
|
||||
use Icinga\Monitoring\Object\Service;
|
||||
use Monitoring\Object\Host;
|
||||
use Monitoring\Object\Service;
|
||||
|
||||
class Monitoring_ShowController extends ModuleActionController
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use Icinga\Web\ModuleActionController;
|
||||
use Icinga\Web\Url;
|
||||
use Icinga\Monitoring\Backend;
|
||||
use Monitoring\Backend;
|
||||
use Zend_Soap_Server as ZfSoapServer;
|
||||
use Zend_Soap_AutoDiscover as ZfSoapAutoDiscover;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Icinga\Monitoring\Plugin\PerfdataSet;
|
||||
use Monitoring\Plugin\PerfdataSet;
|
||||
|
||||
class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@ $row_class = array_key_exists($event->state, $states) ? $states[$event->state] :
|
|||
<? if (! $object): ?>
|
||||
<td><?= $this->escape($event->host_name) ?></td>
|
||||
<? endif ?>
|
||||
<? if (! $object instanceof Icinga\Monitoring\Object\Service): ?>
|
||||
<? if (! $object instanceof Monitoring\Object\Service): ?>
|
||||
<td><? if ($object): ?>
|
||||
<?= $this->qlink(
|
||||
$event->service_description,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Icinga\Monitoring\Backend;
|
||||
use Monitoring\Backend;
|
||||
use Icinga\Util\Format;
|
||||
|
||||
$backend = Backend::getInstance($params->shift('backend'));
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring;
|
||||
namespace Monitoring;
|
||||
|
||||
use Icinga\Application\Config as IcingaConfig;
|
||||
use Icinga\Authentication\Manager as AuthManager;
|
||||
|
@ -62,7 +62,7 @@ class Backend
|
|||
$config = self::$backendConfigs[$name];
|
||||
$type = $config->type;
|
||||
$type[0] = strtoupper($type[0]);
|
||||
$class = '\\Icinga\\Monitoring\\Backend\\' . $type;
|
||||
$class = '\\Monitoring\\Backend\\' . $type;
|
||||
self::$instances[$name] = new $class($config);
|
||||
}
|
||||
return self::$instances[$name];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend;
|
||||
namespace Monitoring\Backend;
|
||||
|
||||
use Icinga\Data\DatasourceInterface;
|
||||
use Icinga\Exception\ProgrammingError;
|
||||
|
@ -66,7 +66,7 @@ class AbstractBackend implements DatasourceInterface
|
|||
|
||||
protected function tableToClassName($virtual_table)
|
||||
{
|
||||
return 'Icinga\\Monitoring\\View\\'
|
||||
return 'Monitoring\\View\\'
|
||||
// . $this->getName()
|
||||
// . '\\'
|
||||
. ucfirst($virtual_table)
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend;
|
||||
namespace Monitoring\Backend;
|
||||
|
||||
use Icinga\Data\Db\Connection;
|
||||
|
||||
/**
|
||||
* This class provides an easy-to-use interface to the IDO database
|
||||
*
|
||||
* You should usually not directly use this class but go through Icinga\Monitoring\Backend.
|
||||
* You should usually not directly use this class but go through Monitoring\Backend.
|
||||
*
|
||||
* New MySQL indexes:
|
||||
* <code>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Ido\Query;
|
||||
namespace Monitoring\Backend\Ido\Query;
|
||||
|
||||
use Icinga\Data\Db\Query;
|
||||
use Icinga\Application\Benchmark;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Ido\Query;
|
||||
namespace Monitoring\Backend\Ido\Query;
|
||||
|
||||
class CommentQuery extends AbstractQuery
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Ido\Query;
|
||||
namespace Monitoring\Backend\Ido\Query;
|
||||
|
||||
class ContactQuery extends AbstractQuery
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Ido\Query;
|
||||
namespace Monitoring\Backend\Ido\Query;
|
||||
|
||||
class ContactgroupQuery extends AbstractQuery
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Ido\Query;
|
||||
namespace Monitoring\Backend\Ido\Query;
|
||||
|
||||
class CustomvarQuery extends AbstractQuery
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Ido\Query;
|
||||
namespace Monitoring\Backend\Ido\Query;
|
||||
|
||||
use Icinga\Exception\ProgrammingError;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Ido\Query;
|
||||
namespace Monitoring\Backend\Ido\Query;
|
||||
|
||||
class HostgroupQuery extends AbstractQuery
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Ido\Query;
|
||||
namespace Monitoring\Backend\Ido\Query;
|
||||
|
||||
class HoststatusQuery extends AbstractQuery
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Ido\Query;
|
||||
namespace Monitoring\Backend\Ido\Query;
|
||||
|
||||
class ServicegroupQuery extends AbstractQuery
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Ido\Query;
|
||||
namespace Monitoring\Backend\Ido\Query;
|
||||
|
||||
class ServicestatusQuery extends AbstractQuery
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Ido\Query;
|
||||
namespace Monitoring\Backend\Ido\Query;
|
||||
|
||||
class StatusQuery extends AbstractQuery
|
||||
{
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
/**
|
||||
* Icinga Livestatus Backend
|
||||
*
|
||||
* @package Icinga\Monitoring
|
||||
* @package Monitoring
|
||||
*/
|
||||
namespace Icinga\Monitoring\Backend;
|
||||
namespace Monitoring\Backend;
|
||||
|
||||
use Icinga\Protocol\Livestatus\Connection;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Backend\Livestatus\Query;
|
||||
namespace Monitoring\Backend\Livestatus\Query;
|
||||
|
||||
use Icinga\Data\AbstractQuery;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring;
|
||||
namespace Monitoring;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Web\Session;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Object;
|
||||
namespace Monitoring\Object;
|
||||
|
||||
use Icinga\Data\AbstractQuery as Query;
|
||||
use Icinga\Monitoring\Backend\AbstractBackend;
|
||||
use Monitoring\Backend\AbstractBackend;
|
||||
|
||||
abstract class AbstractObject
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Object;
|
||||
namespace Monitoring\Object;
|
||||
|
||||
use Icinga\Data\AbstractQuery as Query;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Object;
|
||||
namespace Monitoring\Object;
|
||||
|
||||
use Icinga\Data\AbstractQuery as Query;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring;
|
||||
namespace Monitoring;
|
||||
|
||||
require_once ICINGA_LIBDIR . '/Icinga/Application/Cli.php';
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Plugin;
|
||||
namespace Monitoring\Plugin;
|
||||
|
||||
class Perfdata
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\Plugin;
|
||||
namespace Monitoring\Plugin;
|
||||
|
||||
class PerfdataSet
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\View;
|
||||
namespace Monitoring\View;
|
||||
|
||||
class CommentView extends MonitoringView
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\View;
|
||||
namespace Monitoring\View;
|
||||
|
||||
class ContactView extends MonitoringView
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\View;
|
||||
namespace Monitoring\View;
|
||||
|
||||
class ContactgroupView extends MonitoringView
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\View;
|
||||
namespace Monitoring\View;
|
||||
|
||||
class CustomvarView extends MonitoringView
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\View;
|
||||
namespace Monitoring\View;
|
||||
|
||||
class EventHistoryView extends MonitoringView
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\View;
|
||||
namespace Monitoring\View;
|
||||
|
||||
class HostgroupView extends MonitoringView
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\View;
|
||||
namespace Monitoring\View;
|
||||
|
||||
class HoststatusView extends MonitoringView
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\View;
|
||||
namespace Monitoring\View;
|
||||
|
||||
use Icinga\Data\AbstractQuery;
|
||||
use Icinga\Data\Filter;
|
||||
|
@ -13,11 +13,11 @@ use Icinga\Data\Filter;
|
|||
*
|
||||
* You should not directly instantiate such a view but always go through the
|
||||
* Monitoring Backend. Using the Backend's select() method selecting from
|
||||
* 'virtualtable' returns a Icinga\Monitoring\View\VirtualtableView instance.
|
||||
* 'virtualtable' returns a Monitoring\View\VirtualtableView instance.
|
||||
*
|
||||
* Usage example:
|
||||
* <code>
|
||||
* use Icinga\Monitoring\Backend;
|
||||
* use Monitoring\Backend;
|
||||
* $backend = Backend::getInstance();
|
||||
* $query = $backend->select()->from('viewname', array(
|
||||
* 'one_column',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\View;
|
||||
namespace Monitoring\View;
|
||||
|
||||
class ServicegroupView extends MonitoringView
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Monitoring\View;
|
||||
namespace Monitoring\View;
|
||||
|
||||
class StatusView extends MonitoringView
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue