/** * \brief test for ConfigInit() * after ConfigInit() is executed, we can get some sysconfig information, * include: SupportEmailLabel, SupportEmailAddr, SupportEmailSubject, * BannerMsg, LogoImage, LogoLink, FOSSologyURL */ function testConfigInit() { $this->setUpDb(); global $sys_conf; ConfigInit($sys_conf, $SysConf); $this->assertEquals("FOSSology Support", $SysConf['SYSCONFIG']['SupportEmailSubject']); $hostname = exec("hostname -f"); if (empty($hostname)) { $hostname = "localhost"; } $FOSSologyURL = $hostname . "/repo/"; $this->assertEquals($FOSSologyURL, $SysConf['SYSCONFIG']['FOSSologyURL']); $this->tearDownDb(); }
/** * \brief test for ConfigInit() * after ConfigInit() is executed, we can get some sysconfig information, * include: SupportEmailLabel, SupportEmailAddr, SupportEmailSubject, * BannerMsg, LogoImage, LogoLink, FOSSologyURL */ function testConfigInit() { global $sys_conf; print "\nStart unit test for common-sysconfig.php\n"; print "test function ConfigInit()\n"; #$sysconfig = './sysconfigDirTest'; ConfigInit($sys_conf, &$SysConf); $this->assertEquals("FOSSology Support", $SysConf['SYSCONFIG']['SupportEmailSubject']); $hostname = exec("hostname -f"); if (empty($hostname)) { $hostname = "localhost"; } $FOSSologyURL = $hostname . "/repo/"; $this->assertEquals($FOSSologyURL, $SysConf['SYSCONFIG']['FOSSologyURL']); print "unit test for common-sysconfig.php end\n"; }
$SysConf = array(); // fo system configuration variables $PG_CONN = 0; // Database connection $Plugins = array(); /* defaults */ $Verbose = false; $DatabaseName = "fossology"; $UpdateLiceneseRef = false; $sysconfdir = '/usr/local/etc/fossology'; /* Set SYSCONFDIR and set global (for backward compatibility) */ $SysConf = bootstrap($sysconfdir); // don't think we want all the other common libs require_once "{$MODDIR}/lib/php/common.php"; /* Initialize global system configuration variables $SysConfig[] */ ConfigInit($SYSCONFDIR, $SysConf); /* migration */ require_once "./dbmigrate_2.1-2.2.php"; print "Migrate data from 2.1 to 2.2 \n"; Migrate_21_22($Verbose); exit(0); /************************************************/ /****** From src/lib/php/bootstrap.php ********/ /** Included here so that fossinit can run from any directory **/ /** * \brief Bootstrap the fossology php library. * - Determine SYSCONFDIR * - parse fossology.conf * - source template (require_once template-plugin.php) * - source common files (require_once common.php) *