lithium\data\source\MongoDb::enabled()

public static method

With no parameter, checks to see if the mongo extension is installed. With a parameter, queries for a specific supported feature.

Parameters

  • string $feature

    Test for support for a specific feature, i.e. "transactions" or "arrays".

Returns

boolean

Returns true if the particular feature (or if MongoDB) support is enabled, otherwise false.

Source

	public static function enabled($feature = null) {
		if (!$feature) {
			return extension_loaded('mongo');
		}
		$features = array(
			'arrays' => true,
			'transactions' => false,
			'booleans' => true,
			'relationships' => true,
			'schema' => false,
			'sources' => true
		);
		return isset($features[$feature]) ? $features[$feature] : null;
	}