/** * Returns an associative, multi-dimensional array containing version * information about different software components in the server. * * @return array all version information */ public function execute() { $_ringside = array('version' => $this->getRingsideServerVersion(), 'build_number' => $this->getRingsideServerBuildNumber(), 'build_date' => $this->getRingsideServerBuildDate(), 'svn_revision' => $this->getRingsideServerSvnRevision(), 'install_dir' => M3_Util_Settings::getRingsideServerInstallDir()); $_php = array('version' => $this->getPhpVersionReal(), 'doctrine_version' => Doctrine::VERSION, 'php_ini_file' => M3_Util_Settings::getPhpIniFileLocation()); // get all loaded extension versions $_extensions = array(); $_loadedExtensions = get_loaded_extensions(); foreach ($_loadedExtensions as $_loadedExtension) { $_extensions[strtolower($_loadedExtension)] = $this->getPhpVersionForExtension($_loadedExtension); } // There are some extensions we know we need, so force ourselves to get // their information. This is so we can show unloaded extensions in the list // to let the caller know something is missing that we expect to be loaded. $_extensions['tidy'] = $this->getPhpVersionForExtension('tidy'); $_extensions['curl'] = $this->getPhpVersionForExtension('curl'); $_extensions['xsl'] = $this->getPhpVersionForExtension('xsl'); $_extensions['mcrypt'] = $this->getPhpVersionForExtension('mcrypt'); $_extensions['pdo'] = $this->getPhpVersionForExtension('pdo'); ksort($_extensions); $_extList = array(); foreach ($_extensions as $_name => $_version) { $_extList[] = array('name' => $_name, 'version' => $_version); } return array('ringside' => $_ringside, 'php' => $_php, 'extensions' => array('extension' => $_extList)); }
public function testSettings() { $_allowEval = M3_Util_Settings::getAllowOperationEvaluatePhpCode(); $this->assertType('boolean', $_allowEval); $_maxSizeAllowedFileContent = M3_Util_Settings::getMaxSizeAllowedOperationGetFileContent(); $this->assertGreaterThanOrEqual(0, $_maxSizeAllowedFileContent); $_dataDir = M3_Util_Settings::getDataDirectory(); $this->assertFalse(empty($_dataDir)); $_dataStoreEnum = M3_Util_Settings::getDatastore(); $this->assertFalse(empty($_dataStoreEnum)); $this->assertType(M3_Util_DatastoreEnum, $_dataStoreEnum); $_dirs = M3_Util_Settings::getDeployedApiLocations(); $this->assertEquals(3, count($_dirs)); $this->assertContains('/ringside/rest', $_dirs); $this->assertContains('/m3/rest', $_dirs); $this->assertContains('/ringside/api/facebook', $_dirs); $_php = M3_Util_Settings::getPhpIniFileLocation(); $this->assertGreaterThan(strlen("php.ini"), strlen($_php), "should be a full path to the php.ini file"); $_phpContent = M3_Util_Settings::getPhpIniSettings(); $this->assertTrue(!empty($_phpContent)); $_dbProfileEnable = M3_Util_Settings::getDbProfilerEnable(); $this->assertNotNull($_dbProfileEnable); $this->assertTrue($_dbProfileEnable === true || $_dbProfileEnable === false, "Should have been a boolean"); }
public function testPhpIniFile() { $_phpLocation = M3_Util_Settings::getPhpIniFileLocation(); $this->assertTrue(!empty($_phpLocation)); $_php = new M3_Util_IniSettings($_phpLocation, false); $_php->readIniFile($_phpSettings, true); $this->assertArrayHasKey('PHP', $_phpSettings); $this->assertArrayHasKey('engine', $_phpSettings['PHP']); $this->assertEquals('on', strtolower($_phpSettings['PHP']['engine'])); }