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"); }
/** * Creates a new listener that can listen for events when API invocations occur. * The returned listener object also provides methods that can be used to retrieve * aggregated information about the API invocations that have occurred. * * @return M3_Metric_IApiInvocationListener the listener created */ public static function createApiInvocationListener() { $_ds = M3_Util_Settings::getDatastore(); if ($_ds->isDB()) { $_listener = new M3_Db_ApiInvocationListener(); } return $_listener; }