lithium\data\source\http\adapter\CouchDb::enabled PHP Method

enabled() public static method

With no parameter, always returns true, since CouchDB only depends on HTTP. With a parameter, queries for a specific supported feature.
public static enabled ( string $feature = null ) : boolean
$feature string Test for support for a specific feature, i.e. `"transactions"` or `"arrays"`.
return boolean Returns `true` if the particular feature support is enabled, otherwise `false`.
    public static function enabled($feature = null)
    {
        if (!$feature) {
            return true;
        }
        $features = array('arrays' => true, 'transactions' => false, 'booleans' => true, 'relationships' => false, 'schema' => false, 'sources' => false);
        return isset($features[$feature]) ? $features[$feature] : null;
    }

Usage Example

示例#1
0
 public function skip()
 {
     $this->skipIf(!MongoDb::enabled(), 'MongoDb is not enabled');
     $this->skipIf(!CouchDb::enabled(), 'CouchDb is not enabled');
 }
All Usage Examples Of lithium\data\source\http\adapter\CouchDb::enabled