sintonia/legacy/tests/application/bootstrap.php
Jonas L 5e8d8db6e9
Feature: Support php7.4 (#1354)
* Run CI tests against php 7.4

* Sort composer dependencies

* Remove unused Aws S3 php library

* Pin simplepie dependency to ^1.5

* Pin getid3 dependency to ^1.9

* Pin composer semver to ^3.2

* Pin php-amqplib to ^2.12

* Drop sentry logging support

* Update composer dependencies

* Move propel regenerate to Makefile

* Regenerate propel files with v1.7.0

* Pin propel orm to ^1.7

* Regenerate propel files with v1.7.2

* fix: generator_version in airtime-conf-production.php

* Replace propel/propel1 with jooola/propel1

* Regenerate propel files with v1.7.3-dev

* Fix php7.4 compatibility

Using php-cs-fixer:

    '@PhpCsFixer' => true,
    'concat_space' => ['spacing' => 'one'],
    'ordered_class_elements' => false,
    'yoda_style' => false,
    '@PHP74Migration' => true,
    'assign_null_coalescing_to_coalesce_equal' => false,
    'ternary_to_null_coalescing' => false,
    'heredoc_indentation' => false,
    '@PHP74Migration:risky' => true,
    'declare_strict_types' => false,
    'void_return' => false,
    'use_arrow_functions' => false,

* Fix pre-commit
2021-10-17 17:19:53 +02:00

84 lines
2.6 KiB
PHP

<?php
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'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, [
realpath('./library'),
get_include_path(),
]));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, [
get_include_path(),
realpath(APPLICATION_PATH . '/../library'),
]));
// Ensure vendor/ is on the include path
set_include_path(implode(PATH_SEPARATOR, [
get_include_path(),
realpath(APPLICATION_PATH . '/../vendor'),
realpath(APPLICATION_PATH . '/../vendor/zf1s/zend-loader/library'),
]));
set_include_path(implode(PATH_SEPARATOR, [
get_include_path(),
realpath(APPLICATION_PATH . '/../vendor/jooola/propel1/runtime/lib'),
]));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, [
get_include_path(),
realpath(APPLICATION_PATH . '/../../install_minimal/include'),
]));
require_once CONFIG_PATH . '/constants.php';
Logging::setLogPath(LIBRETIME_LOG_DIR . '/zendphp.log');
set_include_path(APPLICATION_PATH . '/common' . PATH_SEPARATOR . get_include_path());
//Propel classes.
set_include_path(APPLICATION_PATH . '/models' . PATH_SEPARATOR . get_include_path());
//Services
set_include_path(APPLICATION_PATH . '/services' . PATH_SEPARATOR . get_include_path());
//models
set_include_path(APPLICATION_PATH . '/models' . PATH_SEPARATOR . get_include_path());
//Controllers.
set_include_path(APPLICATION_PATH . '/controllers' . PATH_SEPARATOR . get_include_path());
//Controller plugins.
set_include_path(APPLICATION_PATH . '/controllers/plugins' . PATH_SEPARATOR . get_include_path());
//test data
set_include_path(APPLICATION_PATH . '/../tests/application/testdata' . PATH_SEPARATOR . get_include_path());
//helper functions
set_include_path(APPLICATION_PATH . '/../tests/application/helpers' . PATH_SEPARATOR . get_include_path());
//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');
Zend_Session::start();