public static function check_config($cfg){
    if ( !\is_array($cfg) ){
      self::$error = "The configuration is not a valid array";
      return false;
    }
    self::$validator->check(bbn\x::to_object($cfg), static::$schema);
    self::$error = '';
    if ( self::$validator->isValid() ){
      return 1;
    }
    foreach ( self::$validator->getErrors() as $error ){
      self::$error .= sprintf("[%s] %s",$error['property'], $error['message']);
      var_dump($cfg);
    }
    return false;
  }