More work on new installer
This commit is contained in:
parent
0b77222013
commit
8f46b4dca7
8 changed files with 279 additions and 152 deletions
|
@ -1,82 +0,0 @@
|
|||
<?php
|
||||
|
||||
// Only enable cookie secure if we are supporting https.
|
||||
// Ideally, this would always be on and we would force https,
|
||||
// but the default installation configs are likely to be installed by
|
||||
// amature users on the setup that does not have https. Forcing
|
||||
// cookie_secure on non https would result in confusing login problems.
|
||||
if(!empty($_SERVER['HTTPS'])) {
|
||||
ini_set('session.cookie_secure', '1');
|
||||
}
|
||||
ini_set('session.cookie_httponly', '1');
|
||||
|
||||
error_reporting(E_ALL|E_STRICT);
|
||||
|
||||
function exception_error_handler($errno, $errstr, $errfile, $errline) {
|
||||
//Check if the statement that threw this error wanted its errors to be
|
||||
//suppressed. If so then return without with throwing exception.
|
||||
if (0 === error_reporting()) return;
|
||||
throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
|
||||
return false;
|
||||
}
|
||||
|
||||
set_error_handler("exception_error_handler");
|
||||
|
||||
// Define application environment
|
||||
defined('APPLICATION_ENV')
|
||||
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
|
||||
|
||||
defined('VERBOSE_STACK_TRACE')
|
||||
|| define('VERBOSE_STACK_TRACE', (getenv('VERBOSE_STACK_TRACE') ? getenv('VERBOSE_STACK_TRACE') : true));
|
||||
|
||||
// Ensure library/ is on include_path
|
||||
set_include_path(implode(PATH_SEPARATOR, array(
|
||||
get_include_path(),
|
||||
realpath(APPLICATION_PATH . '/../library')
|
||||
)));
|
||||
|
||||
set_include_path(APPLICATION_PATH . '/common' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
//Propel classes.
|
||||
set_include_path(APPLICATION_PATH . '/models' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
//Controller plugins.
|
||||
set_include_path(APPLICATION_PATH . '/controllers/plugins' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
//Zend framework
|
||||
if (file_exists('/usr/share/php/libzend-framework-php')) {
|
||||
set_include_path('/usr/share/php/libzend-framework-php' . PATH_SEPARATOR . get_include_path());
|
||||
}
|
||||
|
||||
/** Zend_Application */
|
||||
require_once 'Zend/Application.php';
|
||||
$application = new Zend_Application(
|
||||
APPLICATION_ENV,
|
||||
APPLICATION_PATH . '/configs/application.ini'
|
||||
);
|
||||
|
||||
require_once(APPLICATION_PATH . "/logging/Logging.php");
|
||||
Logging::setLogPath('/var/log/airtime/zendphp.log');
|
||||
|
||||
// Create application, bootstrap, and run
|
||||
try {
|
||||
$sapi_type = php_sapi_name();
|
||||
if (substr($sapi_type, 0, 3) == 'cli') {
|
||||
set_include_path(APPLICATION_PATH . PATH_SEPARATOR . get_include_path());
|
||||
require_once("Bootstrap.php");
|
||||
} else {
|
||||
$application->bootstrap()->run();
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
echo "<pre>";
|
||||
echo $e->getTraceAsString();
|
||||
echo "</pre>";
|
||||
Logging::info($e->getMessage());
|
||||
if (VERBOSE_STACK_TRACE) {
|
||||
Logging::info($e->getTraceAsString());
|
||||
} else {
|
||||
Logging::info($e->getTrace());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* We only get here after setup, or if there's an error in the configuration.
|
||||
*
|
||||
* Display a table to the user showing the necessary dependencies
|
||||
* (both PHP and binary) and the status of any application services,
|
||||
* along with steps to fix them if they're not found or misconfigured.
|
||||
*/
|
||||
|
||||
$phpDependencies = airtimeCheckDependencies();
|
||||
$zend = $phpDependencies["zend"];
|
||||
$database = airtimeCheckDatabase();
|
||||
|
||||
$result = $database;
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.3.3.1.min.css">
|
||||
</head>
|
||||
|
||||
<body style="padding: 2em 0; min-width: 500px; width: 50%; text-align: center; margin: 0 auto;">
|
||||
|
||||
<h1>
|
||||
Airtime Configuration Checklist
|
||||
</h1>
|
||||
<table class="table table-striped" style="text-align: center">
|
||||
<caption>
|
||||
Airtime Configuration
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
Component
|
||||
</td>
|
||||
<td>
|
||||
Description
|
||||
</td>
|
||||
<td>
|
||||
Solution
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="<?=$zend ? 'success' : 'danger';?>">
|
||||
<td>
|
||||
<strong>Zend</strong>
|
||||
</td>
|
||||
<td>
|
||||
PHP MVC Framework
|
||||
</td>
|
||||
<td <?php if ($zend) {echo 'style="background: #dff0d8 url(css/images/accept.png) no-repeat center"';?>>
|
||||
<?php
|
||||
} else {
|
||||
?>>
|
||||
<b>Ubuntu</b>: try running <code>sudo apt-get install libzend-framework-php</code>
|
||||
<br/><b>Debian</b>: try running <code>sudo apt-get install zendframework</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?=$database ? 'success' : 'danger';?>">
|
||||
<td>
|
||||
<strong>Database</strong>
|
||||
</td>
|
||||
<td>
|
||||
PostgreSQL data store for Airtime
|
||||
</td>
|
||||
<td <?php if ($database) {echo 'style="background: #dff0d8 url(css/images/accept.png) no-repeat center"';?>>
|
||||
<?php
|
||||
} else {
|
||||
?>>
|
||||
Try running <code>sudo apt-get install php5-pgsql php5-mysql</code>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
if (!$result) {
|
||||
?>
|
||||
<p>
|
||||
Looks like something went wrong! If you've tried everything we've recommended in the table above, come
|
||||
<a href="https://forum.sourcefabric.org/">visit our forums</a>
|
||||
or <a href="http://www.sourcefabric.org/en/airtime/manuals/">check out the manual</a>.
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<br/>
|
||||
<h3>
|
||||
PHP Extension List
|
||||
</h3>
|
||||
<p>
|
||||
<?php
|
||||
|
||||
foreach (get_loaded_extensions() as $ext) {
|
||||
echo $ext . " | ";
|
||||
}
|
||||
|
||||
?>
|
||||
</p>
|
||||
<?php
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
global $configRun;
|
||||
global $extensions;
|
||||
|
||||
function showConfigCheckPage() {
|
||||
if (!isset($configRun) || !$configRun) {
|
||||
|
@ -9,24 +10,25 @@ function showConfigCheckPage() {
|
|||
airtimeCheckConfiguration();
|
||||
}
|
||||
|
||||
require_once(WEB_ROOT_PATH . 'config-check.php');
|
||||
require_once(CONFIG_PATH . 'config-check.php');
|
||||
die();
|
||||
}
|
||||
|
||||
// Define application path constants
|
||||
define('ROOT_PATH', dirname( __DIR__) . '/');
|
||||
define('WEB_ROOT_PATH', __DIR__ . '/');
|
||||
define('LIB_PATH', ROOT_PATH . 'library/');
|
||||
define('BUILD_PATH', ROOT_PATH . 'build/');
|
||||
define('SETUP_DIR', 'airtime-setup/');
|
||||
|
||||
// Define path to application directory
|
||||
define('APPLICATION_PATH', ROOT_PATH . 'application');
|
||||
define('SETUP_PATH', BUILD_PATH . 'airtime-setup/');
|
||||
define('APPLICATION_PATH', ROOT_PATH . 'application/');
|
||||
define('CONFIG_PATH', APPLICATION_PATH . 'configs/');
|
||||
|
||||
define('AIRTIME_CONFIG', 'airtime.conf');
|
||||
|
||||
require_once(APPLICATION_PATH . "/configs/conf.php");
|
||||
require_once(BUILD_PATH . SETUP_DIR . 'load.php');
|
||||
require_once(CONFIG_PATH . 'conf.php');
|
||||
require_once(SETUP_PATH . 'load.php');
|
||||
|
||||
// This allows us to pass ?config as a parameter to any page
|
||||
// and get to the config checklist.
|
||||
if (array_key_exists('config', $_GET)) {
|
||||
showConfigCheckPage();
|
||||
}
|
||||
|
@ -47,10 +49,10 @@ if (file_exists(BUILD_PATH . AIRTIME_CONFIG)) {
|
|||
showConfigCheckPage();
|
||||
}
|
||||
|
||||
require_once(WEB_ROOT_PATH . 'airtime-boot.php');
|
||||
require_once(APPLICATION_PATH . 'airtime-boot.php');
|
||||
}
|
||||
// Otherwise, we'll need to run our configuration setup
|
||||
else {
|
||||
require_once(BUILD_PATH . SETUP_DIR . 'setup-config.php');
|
||||
require_once(SETUP_PATH . 'setup-config.php');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue