public function validateRequest() { if (!M3_Util_Settings::getAllowOperationEvaluatePhpCode()) { throw new OpenFBAPIException("Evaluation of PHP code is disallowed"); } $this->phpCode = $this->getRequiredApiParam("phpCode"); }
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"); }