public function addTranslation(Translation $translation) { if (!in_array($translation->getLocale(), $this->translationLangs)) { $this->translationLangs[] = $translation->getLang(); $this->translations->add($translation); } else { throw new ExistingTranslationException(sprintf('Project %s already has a translation for language: %s.', $this->caption, $translation->getLang())); } }
// If config file is NOT present, redirect to installation process. if (!is_file(LIB . 'static/config.php')) { header("Location: ./install/"); } error_reporting(E_ALL & ~E_NOTICE); /* *= INCLUDES: DO NOT DELETE ANY OF THESE LINES. =* */ // Config require LIB . 'static/config.php'; define('PREFIX', $DBCRED['prefix']); // Base require LIB . 'static/definitions.php'; // Languages require LIB . 'translations/Translation.php'; define('LANG', Translation::getLang()); define('LANGS', LIB . 'translations/'); require LANGS . 'GeneralT.php'; GeneralT::init(); // Classes require LIB . 'base/InfoMessage.php'; require LIB . 'base/AdminInfoMessage.php'; require LIB . 'themes/scss/scss.inc.php'; // Auto-Loader require LIB . 'common/ClassLoader.php'; // Connect to database $db = new Database($DBCRED['host'], $DBCRED['username'], $DBCRED['password'], $DBCRED['database']); // Unset $DBCRED for security reasons unset($DBCRED); $userManager = new UserManager(); $user = $userManager->getUser();