Пример #1
0
 private function __construct()
 {
     // Read general config from INI file
     global $_INI_FILE;
     $root = realpath(dirname(__FILE__) . '/../');
     self::$ROOT = $root;
     // Accesible by Apache/PHP
     self::$BASE_URL = $_INI_FILE['ui']['baseurl'];
     // Accesible by the browser
     set_include_path(get_include_path() . PATH_SEPARATOR . $root);
     self::$TIME_TO_EDIT_ENABLED = self::getConfigBool('timetoedit', 'ui');
     self::$DEFAULT_NUM_RESULTS_FROM_TM = $_INI_FILE['mymemory']['numresults'];
     self::$THRESHOLD_MATCH_TM_NOT_TO_SHOW = $_INI_FILE['mymemory']['matchthreshold'];
     self::$DB_SERVER = $_INI_FILE['db']['hostname'];
     self::$DB_DATABASE = $_INI_FILE['db']['database'];
     self::$DB_USER = $_INI_FILE['db']['username'];
     self::$DB_PASS = $_INI_FILE['db']['password'];
     self::$LOG_ENABLED = self::getConfigBool('logenabled', 'ui');
     self::$LOG_MAXCHUNKSIZE = isset($_INI_FILE['ui']['logmaxchunksize']) ? $_INI_FILE['ui']['logmaxchunksize'] : 3000;
     self::$LOG_REPOSITORY = self::$ROOT . "/" . $_INI_FILE['log']['directory'];
     self::$LOG_FILENAME = $_INI_FILE['log']['filename'];
     //log download
     self::$LOG_DOWNLOAD = self::$ROOT . "/" . $_INI_FILE['download_temp']['directory'];
     self::$TEMPLATE_ROOT = self::$ROOT . "/lib/view";
     self::$MODEL_ROOT = self::$ROOT . '/lib/model';
     self::$CONTROLLER_ROOT = self::$ROOT . '/lib/controller';
     self::$UTILS_ROOT = self::$ROOT . '/lib/utils';
     self::$UPLOAD_ROOT = self::$ROOT . "/" . $_INI_FILE['ui']['uploads'];
     self::$ENABLED_BROWSERS = array('chrome', 'firefox', 'safari');
     self::$BUILD_NUMBER = '0.3.0';
     // Casmacat customizations
     self::$ITP_SERVER = self::getConfig('itpserver');
     self::$HTR_SERVER = self::getConfig('htrserver');
     self::$BICONCOR_SERVER = self::getConfig('biconcorserver');
     self::$SOURCE_LANGUAGE = self::getConfig('sourcelanguage');
     self::$TARGET_LANGUAGE = self::getConfig('targetlanguage');
     self::$ITP_ENABLED = self::getConfigBool('itpenabled');
     self::$PEN_ENABLED = self::getConfigBool('penenabled');
     self::$ET_ENABLED = self::getConfigBool('etenabled');
     self::$SR_ENABLED = self::getConfigBool('srenabled');
     self::$BICONCOR_ENABLED = self::getConfigBool('biconcorenabled');
     self::$HIDE_CONTRIBUTIONS = self::getConfigBool('hidecontributions');
     self::$FLOAT_PREDICTIONS = self::getConfigBool('floatpredictions');
     self::$TRANSLATION_OPTIONS = self::getConfigBool('translationoptions');
     self::$ALLOW_CHANGE_VISUALIZATION_OPTIONS = self::getConfigBool('allowchangevisualizationoptions');
     self::$ITP_DRAFT_ONLY = self::getConfigBool('itpdraftonly');
     self::$ET_TYPE = self::getConfig('ettype', "casmacat", 0);
     self::$DEBUG = self::getConfigBool('debug', "debug");
 }