/** * Returns an associative array of all php.ini configuration settings. * The list returned is an array of name/value pair arrays. * * @return array php.ini configuration settings, or false on error */ public function execute() { $_settings = M3_Util_Settings::getPhpIniSettings(); if ($_settings) { $_nameValues = array(); foreach ($_settings as $_name => $_value) { $_nameValues[] = array('name' => $_name, 'value' => $_value); } return array('php_ini_setting' => $_nameValues); } else { return false; } }
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"); }