mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
Merge branch 'master' into feature/setup-wizard-7163
This commit is contained in:
commit
b27d1d0058
@ -1,6 +1,17 @@
|
|||||||
#!/usr/bin/php
|
#!/usr/bin/php
|
||||||
<?php
|
|
||||||
|
|
||||||
use Icinga\Application\Cli;
|
<?php
|
||||||
require_once dirname(__DIR__) . '/library/Icinga/Application/Cli.php';
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
Cli::start()->dispatch();
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
|
define('ICINGAWEB_BASEDIR', dirname(__DIR__));
|
||||||
|
// ICINGAWEB_BASEDIR is the parent folder for at least application, bin, modules, library/vendor and public
|
||||||
|
|
||||||
|
|
||||||
|
if (! @include_once ICINGAWEB_BASEDIR . '/library/Icinga/Application/Cli.php') {
|
||||||
|
// If the Icinga library wasn't found under ICINGAWEB_BASEDIR, require that the Icinga library is found in PHP's
|
||||||
|
// include path which is the case if Icinga Web 2 is installed via packages
|
||||||
|
require_once 'Icinga/Application/Cli.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
Icinga\Application\Cli::start()->dispatch();
|
||||||
|
@ -6,6 +6,7 @@ namespace Icinga\Application;
|
|||||||
|
|
||||||
use ErrorException;
|
use ErrorException;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use LogicException;
|
||||||
use Icinga\Application\Modules\Manager as ModuleManager;
|
use Icinga\Application\Modules\Manager as ModuleManager;
|
||||||
use Icinga\Data\ResourceFactory;
|
use Icinga\Data\ResourceFactory;
|
||||||
use Icinga\Exception\ConfigurationError;
|
use Icinga\Exception\ConfigurationError;
|
||||||
@ -101,24 +102,15 @@ abstract class ApplicationBootstrap
|
|||||||
*/
|
*/
|
||||||
protected function __construct($configDir = null)
|
protected function __construct($configDir = null)
|
||||||
{
|
{
|
||||||
|
if (! defined('ICINGAWEB_BASEDIR')) {
|
||||||
|
define('ICINGAWEB_BASEDIR', dirname($this->getBootstrapDirecory()));
|
||||||
|
}
|
||||||
|
define('ICINGAWEB_VENDORS', ICINGAWEB_BASEDIR . '/library/vendor');
|
||||||
|
define('ICINGAWEB_APPDIR', ICINGAWEB_BASEDIR . '/application');
|
||||||
|
|
||||||
|
$this->appDir = ICINGAWEB_APPDIR;
|
||||||
$this->libDir = realpath(__DIR__ . '/../..');
|
$this->libDir = realpath(__DIR__ . '/../..');
|
||||||
|
|
||||||
if (!defined('ICINGA_LIBDIR')) {
|
|
||||||
define('ICINGA_LIBDIR', $this->libDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (defined('ICINGAWEB_APPDIR')) {
|
|
||||||
$this->appDir = ICINGAWEB_APPDIR;
|
|
||||||
} elseif (array_key_exists('ICINGAWEB_APPDIR', $_SERVER)) {
|
|
||||||
$this->appDir = $_SERVER['ICINGAWEB_APPDIR'];
|
|
||||||
} else {
|
|
||||||
$this->appDir = realpath($this->libDir. '/../application');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!defined('ICINGAWEB_APPDIR')) {
|
|
||||||
define('ICINGAWEB_APPDIR', $this->appDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($configDir === null) {
|
if ($configDir === null) {
|
||||||
if (array_key_exists('ICINGAWEB_CONFIGDIR', $_SERVER)) {
|
if (array_key_exists('ICINGAWEB_CONFIGDIR', $_SERVER)) {
|
||||||
$configDir = $_SERVER['ICINGAWEB_CONFIGDIR'];
|
$configDir = $_SERVER['ICINGAWEB_CONFIGDIR'];
|
||||||
@ -416,7 +408,7 @@ abstract class ApplicationBootstrap
|
|||||||
*/
|
*/
|
||||||
protected function setupLogger()
|
protected function setupLogger()
|
||||||
{
|
{
|
||||||
if (($loggingConfig = $this->config->get('logging')) !== null) {
|
if (($loggingConfig = $this->config->logging) !== null) {
|
||||||
try {
|
try {
|
||||||
Logger::create($loggingConfig);
|
Logger::create($loggingConfig);
|
||||||
} catch (ConfigurationError $e) {
|
} catch (ConfigurationError $e) {
|
||||||
|
@ -79,7 +79,7 @@ abstract class Filter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
krsort($operators, SORT_NATURAL);
|
krsort($operators, version_compare(PHP_VERSION, '5.4.0') >= 0 ? SORT_NATURAL : SORT_REGULAR);
|
||||||
foreach ($operators as $id => $operator) {
|
foreach ($operators as $id => $operator) {
|
||||||
$f = $filter->getById($id);
|
$f = $filter->getById($id);
|
||||||
if ($f->getOperatorName() !== $operator) {
|
if ($f->getOperatorName() !== $operator) {
|
||||||
|
@ -201,7 +201,7 @@ class Tab extends AbstractWidget
|
|||||||
$caption = $view->escape($this->title);
|
$caption = $view->escape($this->title);
|
||||||
|
|
||||||
if ($this->icon !== null) {
|
if ($this->icon !== null) {
|
||||||
$caption = $view->img($this->icon, array('class' => 'icon')) . ' ' . $caption;
|
$caption = $view->img($this->icon, array('class' => 'icon')) . $caption;
|
||||||
}
|
}
|
||||||
if ($this->url !== null) {
|
if ($this->url !== null) {
|
||||||
$this->url->overwriteParams($this->urlParams);
|
$this->url->overwriteParams($this->urlParams);
|
||||||
|
@ -2,4 +2,8 @@
|
|||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
require_once dirname(__DIR__). '/library/Icinga/Application/webrouter.php';
|
if (! @include_once dirname(__DIR__) . '/library/Icinga/Application/webrouter.php') {
|
||||||
|
// If the Icinga library wasn't found under ICINGAWEB_BASEDIR, require that the Icinga library is found in PHP's
|
||||||
|
// include path which is the case if Icinga Web 2 is installed via packages
|
||||||
|
require_once 'Icinga/Application/webrouter.php';
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user