Exemple #1
0
// Define constant to quickly check if we're on Windows, since sending emails on Windows requires different settings.
define('ON_WINDOWS', strtoupper(substr(PHP_OS, 0, 3) == 'WIN'));
// For the installation process (and possibly later somewhere else, too).
$aRequired = array('PHP' => '5.3.0', 'PHP_functions' => array('mb_detect_encoding', 'xml_parser_create', 'openssl_seal'), 'PHP_classes' => array('SoapClient'), 'MySQL' => '4.1.2');
// Initiate $_SETT array.
$_SETT = array('system' => array('version' => '3.0-17'), 'user_levels' => array(LEVEL_ADMIN => 'Database administrator', LEVEL_MANAGER => 'Manager', LEVEL_CURATOR => 'Curator', LEVEL_OWNER => 'Submitter (data owner)', LEVEL_COLLABORATOR => 'Collaborator', LEVEL_SUBMITTER => 'Submitter'), 'gene_imprinting' => array('unknown' => 'Unknown', 'no' => 'Not imprinted', 'maternal' => 'Imprinted, maternal', 'paternal' => 'Imprinted, paternal'), 'var_effect' => array(0 => 'Not classified', 5 => 'Effect unknown', 9 => 'Affects function', 7 => 'Probably affects function', 3 => 'Probably does not affect function', 1 => 'Does not affect function'), 'var_effect_default' => '00', 'data_status' => array(STATUS_IN_PROGRESS => 'In progress', STATUS_PENDING => 'Pending', STATUS_HIDDEN => 'Non public', STATUS_MARKED => 'Marked', STATUS_OK => 'Public'), 'update_levels' => array(1 => 'Optional', 4 => 'Common', 5 => 'Suggested', 7 => 'Recommended', 8 => '<SPAN style="color:red;">Important</SPAN>', 9 => '<SPAN style="color:red;"><B>Critical</B></SPAN>'), 'upstream_URL' => 'http://www.LOVD.nl/', 'upstream_BTS_URL' => 'https://github.com/LOVDnl/LOVD3/issues/', 'upstream_BTS_URL_new_ticket' => 'https://github.com/LOVDnl/LOVD3/issues/new', 'wikiprofessional_iprange' => '131.174.88.0-255', 'list_sizes' => array(10, 25, 50, 100, 250, 500, 1000), 'lists' => array('max_sortable_rows' => 250000), 'notes_align' => array(-1 => 'left', 0 => 'center', 1 => 'right'), 'unique_view_max_string_length' => 100, 'objectid_length' => array('diseases' => 5, 'individuals' => 8, 'links' => 3, 'phenotypes' => 10, 'screenings' => 10, 'transcripts' => 8, 'users' => 5, 'variants' => 10), 'human_builds' => array('----' => array('ncbi_name' => 'non-Human'), 'hg18' => array('ncbi_name' => 'Build 36.1', 'ncbi_sequences' => array('1' => 'NC_000001.9', '2' => 'NC_000002.10', '3' => 'NC_000003.10', '4' => 'NC_000004.10', '5' => 'NC_000005.8', '6' => 'NC_000006.10', '7' => 'NC_000007.12', '8' => 'NC_000008.9', '9' => 'NC_000009.10', '10' => 'NC_000010.9', '11' => 'NC_000011.8', '12' => 'NC_000012.10', '13' => 'NC_000013.9', '14' => 'NC_000014.7', '15' => 'NC_000015.8', '16' => 'NC_000016.8', '17' => 'NC_000017.9', '18' => 'NC_000018.8', '19' => 'NC_000019.8', '20' => 'NC_000020.9', '21' => 'NC_000021.7', '22' => 'NC_000022.9', 'X' => 'NC_000023.9', 'Y' => 'NC_000024.8', 'M' => 'NC_001807.4')), 'hg19' => array('ncbi_name' => 'GRCh37', 'ncbi_sequences' => array('1' => 'NC_000001.10', '2' => 'NC_000002.11', '3' => 'NC_000003.11', '4' => 'NC_000004.11', '5' => 'NC_000005.9', '6' => 'NC_000006.11', '7' => 'NC_000007.13', '8' => 'NC_000008.10', '9' => 'NC_000009.11', '10' => 'NC_000010.10', '11' => 'NC_000011.9', '12' => 'NC_000012.11', '13' => 'NC_000013.10', '14' => 'NC_000014.8', '15' => 'NC_000015.9', '16' => 'NC_000016.9', '17' => 'NC_000017.10', '18' => 'NC_000018.9', '19' => 'NC_000019.9', '20' => 'NC_000020.10', '21' => 'NC_000021.8', '22' => 'NC_000022.10', 'X' => 'NC_000023.10', 'Y' => 'NC_000024.9', 'M' => 'NC_012920.1')), 'hg38' => array('ncbi_name' => 'GRCh38', 'ncbi_sequences' => array('1' => 'NC_000001.11', '2' => 'NC_000002.12', '3' => 'NC_000003.12', '4' => 'NC_000004.12', '5' => 'NC_000005.10', '6' => 'NC_000006.12', '7' => 'NC_000007.14', '8' => 'NC_000008.11', '9' => 'NC_000009.12', '10' => 'NC_000010.11', '11' => 'NC_000011.10', '12' => 'NC_000012.12', '13' => 'NC_000013.11', '14' => 'NC_000014.9', '15' => 'NC_000015.10', '16' => 'NC_000016.10', '17' => 'NC_000017.11', '18' => 'NC_000018.10', '19' => 'NC_000019.10', '20' => 'NC_000020.11', '21' => 'NC_000021.9', '22' => 'NC_000022.11', 'X' => 'NC_000023.11', 'Y' => 'NC_000024.10', 'M' => 'NC_012920.1'))), 'mito_genes_aliases' => array('MT-TF' => 'TRNF', 'MT-RNR1' => 'RNR1', 'MT-TV' => 'TRNV', 'MT-RNR2' => 'RNR2', 'MT-TL1' => 'TRNL1', 'MT-ND1' => 'ND1', 'MT-TI' => 'TRNI', 'MT-TM' => 'TRNM', 'MT-ND2' => 'ND2', 'MT-TW' => 'TRNW', 'MT-CO1' => 'COX1', 'MT-TD' => 'TRND', 'MT-CO2' => 'COX2', 'MT-TK' => 'TRNK', 'MT-ATP8' => 'ATP8', 'MT-ATP6' => 'ATP6', 'MT-CO3' => 'COX3', 'MT-TG' => 'TRNG', 'MT-ND3' => 'ND3', 'MT-TR' => 'TRNR', 'MT-ND4L' => 'ND4L', 'MT-ND4' => 'ND4', 'MT-TH' => 'TRNH', 'MT-TS2' => 'TRNS2', 'MT-TL2' => 'TRNL2', 'MT-ND5' => 'ND5', 'MT-CYB' => 'CYTB', 'MT-TT' => 'TRNT'));
// Complete version info.
list($_SETT['system']['tree'], $_SETT['system']['build']) = explode('-', $_SETT['system']['version'], 2);
$_SETT['update_URL'] = $_SETT['upstream_URL'] . $_SETT['system']['tree'] . '/package_update.php';
$_SETT['check_location_URL'] = $_SETT['upstream_URL'] . $_SETT['system']['tree'] . '/check_location.php';
// Before we have any output, initiate the template class which takes care of headers and such.
require ROOT_PATH . 'class/template.php';
$_T = new LOVD_Template();
// We define CONFIG_URI as the location of the config file.
define('CONFIG_URI', ROOT_PATH . 'config.ini.php');
$_INI = lovd_parseConfigFile(CONFIG_URI);
// Define table names (system-wide).
// FIXME: TABLE_SCR2GENE => TABLE_SCRS2GENES etc. etc.?
define('TABLEPREFIX', $_INI['database']['table_prefix']);
$_TABLES = array('TABLE_COUNTRIES' => TABLEPREFIX . '_countries', 'TABLE_USERS' => TABLEPREFIX . '_users', 'TABLE_COLLEAGUES' => TABLEPREFIX . '_colleagues', 'TABLE_CHROMOSOMES' => TABLEPREFIX . '_chromosomes', 'TABLE_GENES' => TABLEPREFIX . '_genes', 'TABLE_CURATES' => TABLEPREFIX . '_users2genes', 'TABLE_TRANSCRIPTS' => TABLEPREFIX . '_transcripts', 'TABLE_DISEASES' => TABLEPREFIX . '_diseases', 'TABLE_GEN2DIS' => TABLEPREFIX . '_genes2diseases', 'TABLE_DATA_STATUS' => TABLEPREFIX . '_data_status', 'TABLE_ALLELES' => TABLEPREFIX . '_alleles', 'TABLE_EFFECT' => TABLEPREFIX . '_variant_effect', 'TABLE_INDIVIDUALS' => TABLEPREFIX . '_individuals', 'TABLE_IND2DIS' => TABLEPREFIX . '_individuals2diseases', 'TABLE_VARIANTS' => TABLEPREFIX . '_variants', 'TABLE_VARIANTS_ON_TRANSCRIPTS' => TABLEPREFIX . '_variants_on_transcripts', 'TABLE_PHENOTYPES' => TABLEPREFIX . '_phenotypes', 'TABLE_SCREENINGS' => TABLEPREFIX . '_screenings', 'TABLE_SCR2GENE' => TABLEPREFIX . '_screenings2genes', 'TABLE_SCR2VAR' => TABLEPREFIX . '_screenings2variants', 'TABLE_COLS' => TABLEPREFIX . '_columns', 'TABLE_ACTIVE_COLS' => TABLEPREFIX . '_active_columns', 'TABLE_SHARED_COLS' => TABLEPREFIX . '_shared_columns', 'TABLE_LINKS' => TABLEPREFIX . '_links', 'TABLE_COLS2LINKS' => TABLEPREFIX . '_columns2links', 'TABLE_CONFIG' => TABLEPREFIX . '_config', 'TABLE_STATUS' => TABLEPREFIX . '_status', 'TABLE_ANNOUNCEMENTS' => TABLEPREFIX . '_announcements', 'TABLE_SOURCES' => TABLEPREFIX . '_external_sources', 'TABLE_LOGS' => TABLEPREFIX . '_logs', 'TABLE_MODULES' => TABLEPREFIX . '_modules', 'TABLE_PATHOGENIC' => TABLEPREFIX . '_variant_pathogenicity', 'TABLE_HITS' => TABLEPREFIX . '_hits');
foreach ($_TABLES as $sConst => $sTable) {
    define($sConst, $sTable);
}
// Check PDO existence.
if (!class_exists('PDO')) {
    $sError = 'This PHP installation does not have PDO support installed, available from PHP 5. Without it, LOVD will not function.';
    if (substr(phpversion(), 0, 1) < 5) {
        $sError .= ' Please upgrade your PHP version to at least PHP 5.0.0 and install PDO support (built in from 5.1.0).';
    } else {
        $sError .= ' Please install PDO support (built in from 5.1.0).';
    }
Exemple #2
0
 * (at your option) any later version.
 *
 * LOVD 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 LOVD.  If not, see <http://www.gnu.org/licenses/>.
 *
 *************/
// Set up global constants and include path for running tests.
define('ROOT_PATH', realpath(__DIR__ . '/../../src') . '/');
require_once ROOT_PATH . 'inc-lib-init.php';
// Get configuration settings.
$_INI = lovd_parseConfigFile(ROOT_PATH . 'config.ini.php');
// Get root URL from config file.
if (!isset($_INI['test']['root_url'])) {
    throw new Exception('Failed to initialize ROOT_URL from ' . ROOT_PATH . 'config.ini.php');
}
define('ROOT_URL', $_INI['test']['root_url']);
// Check if XDebug session should be started.
$bConfigXDebug = isset($_INI['test']['xdebug_enabled']) && $_INI['test']['xdebug_enabled'] == 'true';
define('XDEBUG_ENABLED', $bConfigXDebug);
$bXDebugStatus = false;
set_include_path(get_include_path() . PATH_SEPARATOR . ROOT_PATH . '../tests/selenium_tests');
// Max time for webdriver to wait for a condition by default (in seconds)
define('WEBDRIVER_MAX_WAIT_DEFAULT', 120);
// Interval between webdriver tests for condition during wait (in miliseconds)
define('WEBDRIVER_POLL_INTERVAL_DEFAULT', 1000);
// Time webdriver waits on DOM elements with every call (in seconds)