feat(legacy): consolidate constants (#1558)
* remove unused file * fix paths leading slash * remove useless imports * refactor(legacy): use constants everywhere * fix path leading slash * remove useless import * consolidate legacy contants * format code * reuse LIBRETIME_CONFIG_DIR * fix test config path * remove ci legacy log dir creation * some logs improvements
This commit is contained in:
parent
e106858fd8
commit
729a7b99e0
34 changed files with 133 additions and 257 deletions
|
@ -2,19 +2,7 @@
|
|||
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
// load composer autoloader
|
||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
// Define path to application directory
|
||||
defined('APPLICATION_PATH')
|
||||
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application/'));
|
||||
|
||||
// Define path to configs directory
|
||||
define('CONFIG_PATH', APPLICATION_PATH . '/configs/');
|
||||
|
||||
// Define application environment
|
||||
defined('APPLICATION_ENV')
|
||||
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'testing'));
|
||||
require_once dirname(__DIR__, 2) . '/application/preload.php';
|
||||
|
||||
// Ensure library/ is on include_path
|
||||
set_include_path(implode(PATH_SEPARATOR, [
|
||||
|
@ -46,9 +34,7 @@ set_include_path(implode(PATH_SEPARATOR, [
|
|||
realpath(APPLICATION_PATH . '/../../install_minimal/include'),
|
||||
]));
|
||||
|
||||
require_once CONFIG_PATH . '/constants.php';
|
||||
|
||||
Logging::setLogPath(LIBRETIME_LOG_DIR . '/legacy.log');
|
||||
Logging::setLogPath(LIBRETIME_LOG_FILEPATH);
|
||||
|
||||
set_include_path(APPLICATION_PATH . '/common' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
|
@ -76,8 +62,6 @@ set_include_path(APPLICATION_PATH . '/../tests/application/helpers' . PATH_SEPAR
|
|||
//cloud storage files
|
||||
set_include_path(APPLICATION_PATH . '/cloud_storage' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
require_once APPLICATION_PATH . '/configs/conf.php';
|
||||
|
||||
require_once 'jooola/propel1/runtime/lib/Propel.php';
|
||||
Propel::init('../application/configs/airtime-conf-production.php');
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
require_once '../application/configs/conf.php';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
|
|
|
@ -130,7 +130,7 @@ class TestHelper
|
|||
|
||||
public static function setupZendBootstrap()
|
||||
{
|
||||
$application = new Zend_Application(APPLICATION_ENV, CONFIG_PATH . 'application.ini');
|
||||
$application = new Zend_Application(APPLICATION_ENV, CONFIG_PATH . '/application.ini');
|
||||
$application->bootstrap();
|
||||
|
||||
return $application;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
//require_once "../application/configs/conf.php";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
require_once '../application/configs/conf.php';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
|
||||
//require_once "../application/configs/conf.php";
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
[database]
|
||||
|
||||
host = localhost
|
||||
dbname = libretime_test
|
||||
dbuser = libretime
|
||||
dbpass = libretime
|
||||
|
||||
[rabbitmq]
|
||||
host = 127.0.0.1
|
||||
port = 5672
|
||||
user = airtime_tests
|
||||
password = airtime_tests
|
||||
vhost = /airtime_tests
|
||||
|
||||
[general]
|
||||
dev_env = testing
|
||||
api_key = H2NRICX6CM8F50CU123C
|
||||
web_server_user = www-data
|
||||
airtime_dir = /usr/share/airtime
|
||||
base_url = localhost
|
||||
base_port = 80
|
||||
base_dir = /
|
||||
cache_ahead_hours = 1
|
||||
station_id = teststation
|
||||
|
||||
[monit]
|
||||
monit_user = guest
|
||||
monit_password = airtime
|
|
@ -16,8 +16,9 @@
|
|||
|
||||
<php>
|
||||
<env name="ENVIRONMENT" value="testing" />
|
||||
<env name="AIRTIME_UNIT_TEST" value="1" />
|
||||
<env name="LIBRETIME_CONF_DIR" value="./conf" />
|
||||
<env name="APPLICATION_ENV" value="testing" />
|
||||
<env name="LIBRETIME_UNIT_TEST" value="1" />
|
||||
<env name="LIBRETIME_CONFIG_DIR" value="./config" />
|
||||
<env name="LIBRETIME_LOG_DIR" value="./log" />
|
||||
</php>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ export RABBITMQ_USER
|
|||
export RABBITMQ_PASSWORD
|
||||
export RABBITMQ_VHOST
|
||||
|
||||
export AIRTIME_UNIT_TEST="1"
|
||||
export LIBRETIME_UNIT_TEST="1"
|
||||
|
||||
#Change the working directory to this script's directory
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue