initSubmodules

@param {Function} cb
@api private
422304
function initSubmodules(cb) {
  console.log('Detected a git install');
  console.log('Cloning libSass into src/libsass');

  var clone = spawn('git', ['clone', 'git@github.com:sass/libsass.git', './src/libsass']);
  manageProcess(clone, function(err) {
    if (err) {
      cb(err);
      return;
    }

    console.log('Checking out libsass to ' + pkg.libsass);

    var checkout = spawn('git', ['checkout', pkg.libsass], { cwd: './src/libsass' });
    manageProcess(checkout, function(err) {
      cb(err);
    });
  });
}
904994
function init(copyObject, cb) {
		var result = 0
		isError = false
		var cbCounter = 1
		for (var to in copyObject) {
			var o = copyObjects[copyObjectsIndex++] =
				new copyobject.CopyObject(copyObject[to], to, notifyFn)
			cbCounter++
			o.doCopy(copyResult)
		}
		copyResult()

		function copyResult(err, count) {
			if (!err) {
				if (count) result += count
				if (!--cbCounter && cb) cb(null, result)
			} else if (!isError) {
				isError = true
				if (cb) cb(err)
			}
		}
	}
854846
public function initializeModuleSystem()
    {
        $activatedModules = $this->moduleObjectBackend->loadObject();
        if (!is_array($activatedModules)) {
            $activatedModules = array();
        }
        
        $this->activatedModules = $activatedModules;
        
        foreach ($this->activatedModules as $activatedModule) {
            $this->initializeModule($activatedModule['path']);
        }
    }
1016927
function (cb) {
            var self = this;

            Y.prepare([DEFAULT_THEME, themeDir], self.getProjectMeta(), function (err, opts) {
                opts.meta.title = self.data.project.name;
                opts.meta.projectRoot = './';
                opts.meta.projectAssets = './assets';
                opts.meta.projectLogo = self._resolveUrl(self.data.project.logo, opts);
                opts = self.populateClasses(opts);
                opts = self.populateModules(opts);

                var view = new Y.DocView(opts.meta);
                self.render('{{>index}}', view, opts.layouts.main, opts.partials, function (err, html) {
                    self.files++;
                    cb(html, view);
                });
            });
        }
684334
function initModule(forge) {

var ssh = forge.ssh = forge.ssh || {};

/**
 * Encodes (and optionally encrypts) a private RSA key as a Putty PPK file.
 *
 * @param privateKey the key.
 * @param passphrase a passphrase to protect the key (falsy for no encryption).
 * @param comment a comment to include in the key file.
 *
 * @return the PPK file as a string.
 */
ssh.privateKeyToPutty = function(privateKey, passphrase, comment) {
  comment = comment || '';
  passphrase = passphrase || '';
  var algorithm = 'ssh-rsa';
  var encryptionAlgorithm = (passphrase === '') ? 'none' : 'aes256-cbc';

  var ppk = 'PuTTY-User-Key-File-2: ' + algorithm + '\r\n';
  ppk += 'Encryption: ' + encryptionAlgorithm + '\r\n';
  ppk += 'Comment: ' + comment + '\r\n';

  // public key into buffer for ppk
  var pubbuffer = forge.util.createBuffer();
  _addStringToBuffer(pubbuffer, algorithm);
  _addBigIntegerToBuffer(pubbuffer, privateKey.e);
  _addBigIntegerToBuffer(pubbuffer, privateKey.n);

  // write public key
  var pub = forge.util.encode64(pubbuffer.bytes(), 64);
  var length = Math.floor(pub.length / 66) + 1; // 66 = 64 + \r\n
  ppk += 'Public-Lines: ' + length + '\r\n';
  ppk += pub;

  // private key into a buffer
  var privbuffer = forge.util.createBuffer();
  _addBigIntegerToBuffer(privbuffer, privateKey.d);
  _addBigIntegerToBuffer(privbuffer, privateKey.p);
  _addBigIntegerToBuffer(privbuffer, privateKey.q);
  _addBigIntegerToBuffer(privbuffer, privateKey.qInv);

  // optionally encrypt the private key
  var priv;
  if(!passphrase) {
    // use the unencrypted buffer
    priv = forge.util.encode64(privbuffer.bytes(), 64);
  } else {
    // encrypt RSA key using passphrase
    var encLen = privbuffer.length() + 16 - 1;
    encLen -= encLen % 16;

    // pad private key with sha1-d data -- needs to be a multiple of 16
    var padding = _sha1(privbuffer.bytes());

    padding.truncate(padding.length() - encLen + privbuffer.length());
    privbuffer.putBuffer(padding);

    var aeskey = forge.util.createBuffer();
    aeskey.putBuffer(_sha1('\x00\x00\x00\x00', passphrase));
    aeskey.putBuffer(_sha1('\x00\x00\x00\x01', passphrase));

    // encrypt some bytes using CBC mode
    // key is 40 bytes, so truncate *by* 8 bytes
    var cipher = forge.aes.createEncryptionCipher(aeskey.truncate(8), 'CBC');
    cipher.start(forge.util.createBuffer().fillWithByte(0, 16));
    cipher.update(privbuffer.copy());
    cipher.finish();
    var encrypted = cipher.output;

    // Note: this appears to differ from Putty -- is forge wrong, or putty?
    // due to padding we finish as an exact multiple of 16
    encrypted.truncate(16); // all padding

    priv = forge.util.encode64(encrypted.bytes(), 64);
  }

  // output private key
  length = Math.floor(priv.length / 66) + 1; // 64 + \r\n
  ppk += '\r\nPrivate-Lines: ' + length + '\r\n';
  ppk += priv;

  // MAC
  var mackey = _sha1('putty-private-key-file-mac-key', passphrase);

  var macbuffer = forge.util.createBuffer();
  _addStringToBuffer(macbuffer, algorithm);
  _addStringToBuffer(macbuffer, encryptionAlgorithm);
  _addStringToBuffer(macbuffer, comment);
  macbuffer.putInt32(pubbuffer.length());
  macbuffer.putBuffer(pubbuffer);
  macbuffer.putInt32(privbuffer.length());
  macbuffer.putBuffer(privbuffer);

  var hmac = forge.hmac.create();
  hmac.start('sha1', mackey);
  hmac.update(macbuffer.bytes());

  ppk += '\r\nPrivate-MAC: ' + hmac.digest().toHex() + '\r\n';

  return ppk;
};

/**
 * Encodes a public RSA key as an OpenSSH file.
 *
 * @param key the key.
 * @param comment a comment.
 *
 * @return the public key in OpenSSH format.
 */
ssh.publicKeyToOpenSSH = function(key, comment) {
  var type = 'ssh-rsa';
  comment = comment || '';

  var buffer = forge.util.createBuffer();
  _addStringToBuffer(buffer, type);
  _addBigIntegerToBuffer(buffer, key.e);
  _addBigIntegerToBuffer(buffer, key.n);

  return type + ' ' + forge.util.encode64(buffer.bytes()) + ' ' + comment;
};

/**
 * Encodes a private RSA key as an OpenSSH file.
 *
 * @param key the key.
 * @param passphrase a passphrase to protect the key (falsy for no encryption).
 *
 * @return the public key in OpenSSH format.
 */
ssh.privateKeyToOpenSSH = function(privateKey, passphrase) {
  if(!passphrase) {
    return forge.pki.privateKeyToPem(privateKey);
  }
  // OpenSSH private key is just a legacy format, it seems
  return forge.pki.encryptRsaPrivateKey(privateKey, passphrase,
    {legacy: true, algorithm: 'aes128'});
};

/**
 * Adds len(val) then val to a buffer.
 *
 * @param buffer the buffer to add to.
 * @param val a big integer.
 */
function _addBigIntegerToBuffer(buffer, val) {
  var hexVal = val.toString(16);
  // ensure 2s complement +ve
  if(hexVal[0] >= '8') {
    hexVal = '00' + hexVal;
  }
  var bytes = forge.util.hexToBytes(hexVal);
  buffer.putInt32(bytes.length);
  buffer.putBytes(bytes);
}

/**
 * Adds len(val) then val to a buffer.
 *
 * @param buffer the buffer to add to.
 * @param val a string.
 */
function _addStringToBuffer(buffer, val) {
  buffer.putInt32(val.length);
  buffer.putString(val);
}

/**
 * Hashes the arguments into one value using SHA-1.
 *
 * @return the sha1 hash of the provided arguments.
 */
function _sha1() {
  var sha = forge.md.sha1.create();
  var num = arguments.length;
  for (var i = 0; i < num; ++i) {
    sha.update(arguments[i]);
  }
  return sha.digest();
}

}
956665
function init(options) {

    var fs = require('fs');
    var path = require('path');
    var rootdir = path.dirname(require.main);
    var options = options || {
        config: require(path.join(rootdir, 'config.json')),
        root: rootdir,
        callback: function (noop) {}
    };
    var def = {};
    function ModulePaths (moduledir) {
        this.moduledir = moduledir;
    }

    ModulePaths.prototype.then = function (accept, reject) {
      var moduledir = this.moduledir;
      fs.readdir(moduledir, function (err, files) {
        if (err) reject(err);
        files.forEach(function (file) {
            var name = path.basename(file, '.js');
            def[name] = path.join(moduledir, name);
        });
        accept();
      });
    };
    var pubpath = new ModulePaths(path.join(path.dirname(module.filename), '..', 'public', 'js'));
    var prvpath = new ModulePaths(path.join(path.dirname(module.filename), '..', 'private', 'js'));

    Promise.all([pubpath, prvpath])
        .then(function () {
            var requirejs = require('requirejs');
            requirejs.config({
                baseUrl: path.join(rootdir),
                paths: def
            });

            requirejs(['loader_factory'], function (LoaderFactory) {
                var fs = require('fs');
                var config = options.config;
                config.paths.push(path.dirname(pubpath.moduledir));
                var loader = 'loader_express';
                var db = 'db_mongo';
                if (config.loader) loader = config.loader;
                if (config.db) db = config.db;

                new LoaderFactory().create(loader, db, function (loader) {
                    loader.init(config, options.callback);
                });
            });
        })
    .catch(function (err) {
        console.error('err:', err);
    });
}
150028
function initDir (config) {
    // create global dir config
    config.dir = {
        assets: [__dirname+'/assets'],
        app: [],
        components: [],
        helpers: [__dirname+'/helpers'],
        layouts: [__dirname+'/layouts'],
        partials: [__dirname+'/partials'],
        services: [],
        views: [__dirname+'/views'],
    }
    // iterate over modules getting and merging directories for each
    _.each(config.moduleNames, moduleName => {
        // get module
        var module = config.modules[moduleName]
        // iterate over dir configs
        _.each(config.dir, (dirs, dirName) => {
            // get directories for module
            var moduleDirs = getDir(module, dirName)
            // debug
            debug('initDir %s %s', moduleName, dirName, moduleDirs)
            // add module dirs to config
            _.each(moduleDirs, moduleDir => config.dir[dirName].push(moduleDir))
        })
    })
    // debug merged dirs
    debug('initDir', config.dir)
}
146487
function readDefaultModules (pkgDir) { return function (pkg, cb) {
  log.verbose(pkg._id, "readDefaultModules")
  var lib = pkg.directories && pkg.directories.lib || pkg.lib
    , libDir = path.join(pkgDir, lib).replace(/\/+$/, '')
  if (!lib) return cb(null, pkg)
  // create a modules hash from the lib folder.
  pkg.modules = {}
  var cut = pkgDir === "." ? 0 : pkgDir.length + 1
    , libCut = pkgDir === "." ? lib.length - 1 : libDir.length + 1
  find(libDir, function (er, filenames) {
    if (er) return cb(er)
    filenames.filter(function (f) {
      return !f.substr(libCut).match(/(^|\/)\./)
    }).forEach(function (filename) {
      // filename = path.basename(filename, path.extname(filename))
      var key = filename.substr(libCut)
        , val = filename.substr(cut)
      key = key.replace(/\.node$/, ".js")
      if (key.length && val.length) pkg.modules[key] = val
    })
    // require("foo/foo") is dumb, and happens a lot.
    var nameMod = pkg.modules[pkg.name] || pkg.modules[pkg.name+".js"]
    if (!pkg.main
        && !pkg.modules.index
        && !pkg.modules["index.js"]
        && nameMod) {
      pkg.modules["index.js"] = nameMod
    }
    log.silly(pkg.modules, pkg._id+".modules")
    return cb(null, pkg)
  })
}}
1063528
function(config, cb){
    // This will tell webpack to create a new chunk
    rq.ensure(['INDEX_PATH'],function(rq){
      let library = rq('INDEX_PATH');
      library = library.default || library; // To preven issues between versions
      cb(
        // Expected to export an initializing function
        library(config)
      );
    },'NAME');
  }
389813
public function reactivateModules()
    {
        foreach ($this->modules as $module) {
            $moduleProperties = $this->parseModuleJson($module->getDirectory());
            $version = $moduleProperties->module->version;

            $this->activateModule($moduleProperties->module->namespace, true);
            $module->activate($version, $version);
        }
    }
32863
function () {
            this.unloadCommonModules();
            var pageModRefpaths = this._modulesPaths.page;
            for (var pageId in pageModRefpaths) {
                if (pageModRefpaths.hasOwnProperty(pageId)) {
                    this.unloadPageModules(pageId);
                }
            }
        }
1148249
function initModule(forge) {

forge.mgf = forge.mgf || {};
forge.mgf.mgf1 = forge.mgf1;

}
683982
function (cb) {
    this.reset();
    var bundle = this.bundle;
    var self = this;
    async.waterfall([
      function (wfCb) {
        if (self.noclean) {
          wfCb();
        } else {
          // Remove the output directory if it exists
          existsCompat(self.outputTo, function (exists) {
            if (exists) {
              if (self.verbose) {
                console.log('compileAssets: removing output directory: ' + self.outputTo);
              }
              rimraf(self.outputTo, wfCb);
            } else {
              wfCb();
            }
          });
        }
      },
      function (wfCb) {
        if (self.verbose) {
          console.log('compileAssets: starting asset discovery phase.');
        }
        executePhase(self.phases.discovery, bundle, wfCb);
      },
      function (b, wfCb) {
        if (self.verbose) {
          console.log('compileAssets: starting compilation phase.');
        }
        try {
          // Get the correct order of asset dependencies
          var orderedAssets = bundle.getProcessingOrder().map(function (assetFilePath) {
            return bundle.getAsset(assetFilePath);
          });
          async.eachSeries(orderedAssets, function (asset, eachCb) {
            setImmediateCompat(function() {
              executePhase(self.phases.compilation, asset, eachCb);
            });
          }, wfCb);
        }
        catch (e) {
          wfCb(e);
        }
      }, function (wfCb) {
        if (self.verbose) {
          console.log('compileAssets: starting post-compilation phase.');
        }
        async.eachLimit(bundle.getAllAssets(), 50, function (asset, eachCb) {
          executePhase(self.phases.postCompilation, asset, eachCb);
        }, wfCb);
      }, function (wfCb) {
        if (self.verbose) {
          console.log('compileAssets: starting output phase.');
        }
        async.eachLimit(bundle.getAllAssets(), 50, function (asset, eachCb) {
          executePhase(self.phases.output, asset, eachCb);
        }, wfCb);
      }
    ], cb);
  }
500947
function(name, cb){
		if(shuttingDown == true)
			return;
		if(!package.dependencies[name] && name != "isnode-mod-logger"){
			var error = { message: "Failed to load "+name+" Module - Module not referenced in node package file" };
			if(cb) { cb(error, null); }
			modules.logger.log("startup","ISNode System > " + error.message + ".");
			return; 
		}
		var modPresent = isModuleAvailable(name);
		if(modPresent){
			var nameSplit = name.split("-");
			if(nameSplit[0] != "isnode" && nameSplit[1] != "mod"){
				var error = { message: "Attempted to load a non 'ismod' or 'isnode' module with the isnode module loader" };
				modules.logger.log("warning","ISNode System > " + error.message + ".");
				if(cb) { cb(error, null); }
				return;
			} else if (nameSplit[2] == "interface" && nameSplit[3]){
				try {
					modules.interfaces[nameSplit[3]] = require(name)(isnode);
					var output = {
						success: true,
						message: "Interface module ("+nameSplit[3]+") successfully loaded"
					}
					modules.logger.log("debug", "ISNode System > " + output.message);
					if(cb) { cb(null,output); }
					return;
				} catch (err) {
					var error = { message: "System Error. Attempted to load module that does not exist - " + name };
					modules.logger.log("error","ISNode System > " + error.message, err);
					if(cb) { cb(error, null); }
					return;					
				}
			} else if (nameSplit[2] != "interface" && !nameSplit[3]) {
				try {
					modules[nameSplit[2]] = require(name)(isnode);
					var output = {
						success: true,
						message: "Standard module ("+nameSplit[2]+") successfully loaded"
					}
					modules.logger.log("debug", output.message + ".");
					if(cb) { cb(null, output); }
					return;
				} catch (err) {
					var error = { message: "System Error. Attempted to load module that does not exist - " + name, error: err };
					modules.logger.log("error","ISNode System > " + error.message+".", err);
					if(cb) { cb(error, null); }
					return;					
				}
			} else {
				var error = { message: "Attempted to load an unsupported ismod module with the ismod module loader" };
				modules.logger.log("warning","ISNode System > " + error.message + ".");
				if(cb) { cb(error, null); }
				return;
			}
		} else {
			if(name == "isnode-mod-logger"){
				modules.logger = {
					log: function(level,logMsg,attrObj){
						console.log("("+level+") "+logMsg);
					}
				}
				var error = { message: "Logger module not available. Polyfill method loaded in its place" };
				modules.logger.log("warning","ISNode System > " + error.message + ".");
				if(cb) { cb(error, null); }
			} else {
				var error = { message: "Attempted to load an ismod module ("+name+") that does not exist. Try running 'npm install'." };
				modules.logger.log("warning","ISNode System > " + error.message + ".");
				if(cb) { cb(error, null); }
			}
			return;
		}
	}
183574
public void setSubModules(java.util.Collection<SubModule> subModules) {
        if (subModules == null) {
            this.subModules = null;
            return;
        }

        this.subModules = new java.util.ArrayList<SubModule>(subModules);
    }
814031
function(parentModule, kbox, id, app, callback) {

  if (typeof callback === 'undefined' && typeof app === 'function') {
    callback = app;
    app = undefined;
  }

  // Try to load module from node_module directories.
  return requireFromNodeModules(parentModule, id)
  // If module was not found in node_module directories, try to load
  // from other directories.
  .then(function(mod) {
    if (mod) {
      return mod;
    } else {
      return requireFromOtherDirs(kbox, id, app);
    }
  })
  // Return.
  .nodeify(callback);

}
1146600
function (session) {
            this._session = session;
            if (this._smList) {
                var sz = this._smList.length;
                for (var i = 0; i < sz; i++) {
                    var subModule = this._smList[i];
                    if (subModule) {
                        subModule.setSession(session);
                    }
                }
            }
        }