Skip to content

Commit

Permalink
Re-Fix installer source tree..
Browse files Browse the repository at this point in the history
refs #3761
  • Loading branch information
Johannes Meyer committed Oct 10, 2013
1 parent 9501537 commit c0cf7f3
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 33 deletions.
1 change: 1 addition & 0 deletions config/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ indexController = "dashboard"
moduleFolder = "/etc/icinga2-web/enabledModules"
dateFormat = "d/m/Y"
timeFormat = "g:i A"
installed = "1"


[logging]
Expand Down
4 changes: 2 additions & 2 deletions installer/controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
require_once 'Zend/Session.php';
require_once 'Zend/Session/Namespace.php';
require_once 'Zend/Controller/Action.php';
require_once realpath(__DIR__ . '/../Report.php');
require_once realpath(__DIR__ . '/../forms/WizardForm.php');
require_once realpath(__DIR__ . '/../forms/StartForm.php');
require_once realpath(__DIR__ . '/../forms/DbConfigForm.php');
require_once realpath(__DIR__ . '/../forms/AuthConfigForm.php');
require_once realpath(__DIR__ . '/../forms/RequirementsForm.php');
require_once realpath(__DIR__ . '/../forms/ConfirmationForm.php');
require_once realpath(__DIR__ . '/../forms/BackendConfigForm.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Util/Report.php');

use \Zend_Session;
use \Zend_Session_Namespace;
use \Zend_Controller_Action;
use \Icinga\Installer\Report;
use \Icinga\Util\Report;
use \Icinga\Installer\Pages\StartForm;
use \Icinga\Installer\Pages\DbConfigForm;
use \Icinga\Installer\Pages\AuthConfigForm;
Expand Down
2 changes: 1 addition & 1 deletion installer/forms/AuthConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
namespace Icinga\Installer\Pages;

use \Zend_Config;
use \Icinga\Installer\Validators\PasswordValidator;
use \Icinga\Web\Form\Validator\PasswordValidator;

/**
* Wizard-page that prompts the user to configure the authentication
Expand Down
2 changes: 1 addition & 1 deletion installer/forms/ConfirmationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function create()

if ($session->backendDetails['backend_ido_host'] !== null) {
$backendDetails = array(
'Database provider: ' . $session->backendDetails['backend_ido_provider'],
'Database provider: ' . $dbProviders[$session->backendDetails['backend_ido_provider']],
'Hostname: ' . $session->backendDetails['backend_ido_host'],
'Port: ' . (empty($session->backendDetails['backend_ido_port']) ? 'Default port' :
$session->backendDetails['backend_ido_port']),
Expand Down
35 changes: 18 additions & 17 deletions installer/forms/WizardForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,33 @@
require_once 'Zend/Db.php';
require_once 'Zend/Form.php';
require_once 'Zend/Config.php';
require_once 'Zend/Validate/Abstract.php';
require_once 'Zend/Form/Element/Xhtml.php';
require_once 'Zend/Form/Element/Submit.php';
require_once 'Zend/Form/Decorator/Abstract.php';
require_once realpath(__DIR__ . '/../validators/PasswordValidator.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Web/Form.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Web/Form/Element/Note.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Web/Form/Decorator/HelpText.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Web/Form/Decorator/BootstrapForm.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Util/ConfigAwareFactory.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Application/DbAdapterFactory.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Authentication/UserBackend.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Authentication/Backend/LdapUserBackend.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Protocol/Ldap/Connection.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Protocol/Ldap/LdapUtils.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Protocol/Ldap/Query.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Data/DatasourceInterface.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Protocol/Statusdat/IReader.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Protocol/Statusdat/Reader.php');
require_once realpath(__DIR__ . '/../../../../library/Icinga/Exception/ConfigurationError.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Web/Form/Validator/PasswordValidator.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Web/Form.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Web/Form/Element/Note.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Web/Form/Decorator/HelpText.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Web/Form/Decorator/BootstrapForm.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Util/ConfigAwareFactory.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Application/DbAdapterFactory.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Authentication/UserBackend.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Authentication/Backend/LdapUserBackend.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Protocol/Ldap/Connection.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Protocol/Ldap/LdapUtils.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Protocol/Ldap/Query.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Data/DatasourceInterface.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Protocol/Statusdat/IReader.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Protocol/Statusdat/Reader.php');
require_once realpath(__DIR__ . '/../../library/Icinga/Exception/ConfigurationError.php');

use \Exception;
use \Zend_Config;
use \Zend_Session_Namespace;
use \Icinga\Web\Form;
use \Icinga\Web\Form\Element\Note;
use \Icinga\Installer\Report;
use \Icinga\Util\Report;
use \Icinga\Application\DbAdapterFactory;
use \Icinga\Authentication\Backend\LdapUserBackend;
use \Icinga\Protocol\Statusdat\Reader as StatusdatReader;
Expand Down
2 changes: 0 additions & 2 deletions library/Icinga/Application/ApplicationBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ protected function __construct($configDir)

Icinga::setApp($this);
$this->configDir = realpath($configDir);

require_once dirname(__FILE__) . '/functions.php';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions library/Icinga/Application/Wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
// {{{ICINGA_LICENSE_HEADER}}}

namespace Icinga\Installer;
namespace Icinga\Application;

require_once 'Zend/View.php';
require_once 'Zend/Layout.php';
Expand Down Expand Up @@ -103,7 +103,7 @@ public static function getInstance()
public function getApplicationDir()
{
if (!isset($this->appDir)) {
$this->appDir = realpath(__DIR__);
$this->appDir = realpath(__DIR__ . '/../../../installer');
}
return $this->appDir;
}
Expand Down
48 changes: 48 additions & 0 deletions library/Icinga/Application/functions.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* This file is part of Icinga 2 Web.
*
* Icinga 2 Web - Head for multiple monitoring backends.
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}

if (function_exists('_')) {
function t($messageId = null)
Expand Down Expand Up @@ -29,3 +55,25 @@ function mt($domain, $messageId = null)
return $messageId;
}
}

/**
* Return whether a specific version of Zend is installed
*
* @param string $version The version of Zend to search for
* @return bool Whether the given Zend version is installed
*/
function is_zend_installed($version)
{
$phpIncludePaths = explode(PATH_SEPARATOR, get_include_path());

foreach ($phpIncludePaths as $path)
{
if (@include_once($path . '/Zend/Version.php')) {
if (substr(Zend_Version::VERSION, 0, strlen($version)) === $version) {
return true;
}
}
}

return false;
}
4 changes: 2 additions & 2 deletions library/Icinga/Util/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
*/
// {{{ICINGA_LICENSE_HEADER}}}

namespace Icinga\Installer;
namespace Icinga\Util;

use \ReflectionClass;
use \Zend_Controller_Front;
use \Icinga\Installer\Wizard;
use \Icinga\Application\Wizard;

/**
* A class that collects and presents system information
Expand Down
4 changes: 1 addition & 3 deletions library/Icinga/Web/Form/Validator/PasswordValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
*/
// {{{ICINGA_LICENSE_HEADER}}}

namespace Icinga\Installer\Validators;

require_once 'Zend/Validate/Abstract.php';
namespace Icinga\Web\Form\Validator;

use \Zend_Validate_Abstract;

Expand Down
6 changes: 3 additions & 3 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
// {{{ICINGA_LICENSE_HEADER}}}

require_once realpath(__DIR__ . '/install/functions.php');
require_once realpath(__DIR__ . '/../library/Icinga/Application/functions.php');

if (!is_zend_installed('1')) {
echo '<h3>Zend Framework not found!</h3>'
Expand All @@ -44,11 +44,11 @@
date_default_timezone_set('UTC');

require_once realpath(__DIR__ . '/../library/Icinga/Application/ApplicationBootstrap.php');
require_once realpath(__DIR__ . '/../library/Icinga/Application/Wizard.php');
require_once realpath(__DIR__ . '/../library/Icinga/Application/Web.php');
require_once realpath(__DIR__ . '/install/application/Wizard.php');

use \Icinga\Application\Web;
use \Icinga\Installer\Wizard;
use \Icinga\Application\Wizard;

$configDir = realpath(__DIR__ . '/../config/');
if (Web::isInstalled($configDir)) {
Expand Down

0 comments on commit c0cf7f3

Please sign in to comment.