<commit_before>/*
 * @package jsDAV
 * @subpackage DAV
 * @copyright Copyright(c) 2011 Ajax.org B.V. <info AT ajax DOT org>
 * @author <NAME> <info AT mikedeboer DOT nl>
 * @license http://github.com/mikedeboer/jsDAV/blob/master/LICENSE MIT License
 */
"use strict";

var Http = require("http");
var Url = require("url");
var Fs = require("fs");
var Exc = require("./../shared/exceptions");
var Util = require("./../shared/util");

// DAV classes used directly by the Server object
var jsDAV_Handler = require("./handler");
var jsDAV_SimpleCollection = require("./simpleCollection");
var jsDAV_ObjectTree = require("./objectTree");
var jsDAV_FS_Tree = require("./backends/fs/tree");
// interfaces to check for:
var jsDAV_Tree = require("./tree");
var jsDAV_iNode = require("./interfaces/iNode");

exports.DEFAULT_PORT = 41197;
exports.DEFAULT_HOST = "127.0.0.1";
exports.DEFAULT_TMPDIR = (function() {
    var value;
    var def     = "/tmp";
    var envVars = ["TMPDIR", "TMP", "TEMP"];
    var i       = 0;
    var l       = envVars.length;
    for (; i < l; ++i) {
        value = process.env[envVars[i]];
        if (value)
            return Fs.realpathSync(value).replace(/\/+$/, "");
    }
    return Fs.realpathSync(def).replace(/\/+$/, "");
})();

/**
 * Auto-load bundled plugins.
 */
exports.DEFAULT_PLUGINS = {};
Fs.readdirSync(__dirname + "/plugins").forEach(function(filename){
    if (/\.js$/.test(filename)) {
        var name = filename.substr(0, filename.lastIndexOf("."));
        var pluginCls = require("./plugins/" + name);
        exports.DEFAULT_PLUGINS[pluginCls.name || name] = pluginCls;
    }
});

/**
 * jsDAV version number
 */
exports.VERSION = JSON.parse(Fs.readFileSync(__dirname + "/../../package.json")).version;

function Server(options) {
    /**
     * This is a flag that allow or not showing file, line and code
     * of the exception in the returned XML
     *
     * @var bool
     */
    this.debugExceptions = exports.debugMode;

    options = options || {};
    this.options = options;

    this.chunkedUploads = {};

    if (typeof options.standalone == "undefined")
        options.standalone = true;
<commit_msg>Add only working plugins to Server.DEFAULT_PLUGINS<commit_after>/*
 * @package jsDAV
 * @subpackage DAV
 * @copyright Copyright(c) 2011 Ajax.org B.V. <info AT ajax DOT org>
 * @author <NAME> <info AT mikedeboer DOT nl>
 * @license http://github.com/mikedeboer/jsDAV/blob/master/LICENSE MIT License
 */
"use strict";

var Http = require("http");
var Url = require("url");
var Fs = require("fs");
var Exc = require("./../shared/exceptions");
var Util = require("./../shared/util");

// DAV classes used directly by the Server object
var jsDAV_Handler = require("./handler");
var jsDAV_SimpleCollection = require("./simpleCollection");
var jsDAV_ObjectTree = require("./objectTree");
var jsDAV_FS_Tree = require("./backends/fs/tree");
// interfaces to check for:
var jsDAV_Tree = require("./tree");
var jsDAV_iNode = require("./interfaces/iNode");

exports.DEFAULT_PORT = 41197;
exports.DEFAULT_HOST = "127.0.0.1";
exports.DEFAULT_TMPDIR = (function() {
    var value;
    var def     = "/tmp";
    var envVars = ["TMPDIR", "TMP", "TEMP"];
    var i       = 0;
    var l       = envVars.length;
    for (; i < l; ++i) {
        value = process.env[envVars[i]];
        if (value)
            return Fs.realpathSync(value).replace(/\/+$/, "");
    }
    return Fs.realpathSync(def).replace(/\/+$/, "");
})();

/**
 * Auto-load bundled plugins.
 */
exports.DEFAULT_PLUGINS = {};
Fs.readdirSync(__dirname + "/plugins").forEach(function(filename){
    if (/\.js$/.test(filename)) {
        var name = filename.substr(0, filename.lastIndexOf("."));
        try {
            var pluginCls = require("./plugins/" + name);
            exports.DEFAULT_PLUGINS[pluginCls.name || name] = pluginCls;
        } catch (e) {
            Util.log("jsDAV cannot load plugin '" + name + "': " + e.message);
        }
    }
});

/**
 * jsDAV version number
 */
exports.VERSION = JSON.parse(Fs.readFileSync(__dirname + "/../../package.json")).version;

function Server(options) {
    /**
     * This is a flag that allow or not showing file, line and code
     * of the exception in the returned XML
     *
     * @var bool
     */
    this.debugExceptions = exports.debugMode;

    options = options || {};
    this.options = options;

    this.chunkedUploads = {};

    if (typeof options.standalone == "undefined")
        options.standalone = true;

{'fraction_non_alphanumeric': 0.1705253784505788, 'fraction_numerical': 0.007569011576135352, 'mean_word_length': 2.9620811287477955, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1154184', 'n_tokens_mistral': 1493, 'n_tokens_neox': 1452, 'n_words': 353}