/* CONSTRUCTOR
***********************************************************************
420253
public function initBySetting($model, $setting)
    {
        parent::initBySetting($model, $setting);
        $this->model = $model;
        if (is_array($setting)) {
            if (!isset($setting['remote_class_type'])) {
                throw new \Stack\Exception\MissingSetting('"remote_class_type" missing for the OneToMany relation.');
            }
            if (!isset($setting['fetch_method'])) {
                throw new \Stack\Exception\MissingSetting('"fetch_method" missing for the FetchAlias relation.');
            }
            $this->remoteModelType = $setting['remote_class_type'];
            $this->fetchMethod = $setting['fetch_method'];
        }
    }
576131
function constructor(attributes, options) {
      var hooks = []
        , local = {};

      options = options || {};

      //
      // Set the database name and/or urlRoot if provided in the options.
      //
      if (options.database) this.database = options.database;
      if (options.urlRoot) this.urlRoot = options.urlRoot;

      //
      // Copy attributes to a new object and provide a MongoDB OfbjectID.
      //
      attributes = attributes || {};
      for (var key in attributes) local[key] = attributes[key];

      //
      // If the provided `_id` is an ObjectID assume the model is stored.
      // If it is not an ObjectID, remove it from the provided data.
      // MongoDB will provide an ObjectID by default.
      //
      if ('_id' in local) try {
        local._id = new ObjectID(local._id);
      } catch (error) { delete local._id; }

      //
      // Define restricted non-enumerated properties.
      //
      predefine(this, fossa);

      //
      // Check for presence of before/after hooks and setup.
      //
      if (this.before) hooks.push('before');
      if (this.after) hooks.push('after');
      this.setup(hooks);

      //
      // Call original Backbone Model constructor.
      //
      backbone.Model.call(this, local, options);
    }
575141
function init() {
    if (tokens) {
      return;
    }
    if (fromString) {
      tokens = cbml.parse(contentString);
    }
    else {
      tokens = cbml.parse(fs.readFileSync(filename));
    }
    /*<debug>
    console.log(JSON.stringify(tokens, null, '  '));
    //</debug>*/
  }
1346807
function (out) {
            out.writeln("$constructor: function() { ");
            out.increaseIndent();
            var parentClassName = out.parentClassName;
            if (parentClassName) {
                out.writeln("this.$", parentClassName, ".constructor.call(this);");
            }
            var scriptClassName = out.scriptClassName;
            if (scriptClassName) {
                out.writeln("this.$", scriptClassName, ".constructor.call(this);");
            }
            out.decreaseIndent();
            out.writeln("},");
        }
460333
function(httpAdapter, options) {
  if (!this.constructor.name) {
    throw new Error('The Constructor must be named');
  }

  this.name = formatGeocoderName(this.constructor.name);

  if (!httpAdapter || httpAdapter == 'undefined') {
    throw new Error(this.constructor.name + ' need an httpAdapter');
  }
  this.httpAdapter = httpAdapter;

  if (!options || options == 'undefined') {
    options = {};
  }

  if (this.options) {
    this.options.forEach(function(option) {
      if (!options[option] || options[option] == 'undefined') {
        options[option] = null;
      }
    });
  }

  this.options = options;
}
1111075
public function init ()
		{
			$class = $this->_modelClass;

			$this->_root = $class::find()->roots()->one();
			if ($this->_root == null)
			{
				$root = new $class([ 'guid' => 'root', 'title' => 'ROOT' ]);
				$root->makeRoot();

				$this->_root = $class::find()->roots()->one();
				$this->_data = [];
			}
			else
				$this->_data = $this->_root->children()->all();

			$this->buildPaths();
		}
371209
private static function init(): void
    {
        if (static::$initialized === false) {
            $baseClass = Base::getInstance();

            static::$initialized = true;
            static::$logDir = $baseClass->parsePath((string)$baseClass->Log->logDirectory);
            static::$classConfig = $baseClass->Log->classConfig->toArray();

            if (static::$logDir != '') {
                Directory::create(static::$logDir);
            }
        }
    }
843430
protected function _init() {
        /* ############## APP ############## */

        /* ## LANG ## */
        if ($handle = opendir(APP_RESOURCE_LANG_PATH)) {
            while (false !== ($entry = readdir($handle))) {
                if (preg_match('#(' . preg_quote('.xml') . ')$#isU', $entry)) {
                    $this->_parseLang(null, str_replace('.xml', '', $entry));
                }
            }

            closedir($handle);
        }

        /* ## TEMPLATE ## */
        $this->config['template']['app'] = APP_RESOURCE_TEMPLATE_PATH;
        /* ## CSS ## */
        $this->config['css']['app'] = WEB_PATH . 'app/' . WEB_CSS_PATH;
        /* ## IMAGE ## */
        $this->config['img']['app'] = WEB_PATH . 'app/' . WEB_IMAGE_PATH;
        /* ## FILE ## */
        $this->config['file']['app'] = WEB_PATH . 'app/' . WEB_FILE_PATH;
        /* ## JS ## */
        $this->config['js']['app'] = WEB_PATH . 'app/' . WEB_JS_PATH;

        /* ############## SRC ############## */

        if ($handleSrc = opendir(SRC_PATH)) {
            while (false !== ($entrySrc = readdir($handleSrc))) {
                if (is_dir(SRC_PATH . $entrySrc) && $entrySrc != '.' && $entrySrc != '..') {
                    /* ## ROUTE ## */
                    $this->_parseRoute($entrySrc);

                    /* ## LANG ## */
                    if ($handle = opendir(SRC_PATH . $entrySrc . '/' . SRC_RESOURCE_LANG_PATH)) {
                        while (false !== ($entry = readdir($handle))) {
                            if (preg_match('#(' . preg_quote('.xml') . ')$#isU', $entry)) {
                                $lang = str_replace('.xml', '', $entry);
                                $this->_parseLang($entrySrc, $lang);
                            }
                        }

                        closedir($handle);
                    }

                    /* ## TEMPLATE ## */
                    $this->config['template']['' . $entrySrc . ''] = SRC_PATH . $entrySrc . '/' . SRC_RESOURCE_TEMPLATE_PATH;
                    /* ## CSS ## */
                    $this->config['css']['' . $entrySrc . ''] = WEB_PATH . $entrySrc . '/' . WEB_CSS_PATH;
                    /* ## IMAGE ## */
                    $this->config['img']['' . $entrySrc . ''] = WEB_PATH . $entrySrc . '/' . WEB_IMAGE_PATH;
                    /* ## FILE ## */
                    $this->config['file']['' . $entrySrc . ''] = WEB_PATH . $entrySrc . '/' . WEB_FILE_PATH;
                    /* ## JS ## */
                    $this->config['js']['' . $entrySrc . ''] = WEB_PATH . $entrySrc . '/' . WEB_JS_PATH;
                    /* ## FIREWALL ## */
                    $this->_parseFirewall($entrySrc);

                    //copy app lang in each other module lang
                    foreach ($this->config['lang'] as $key => $value) {
                        if ($key != 'app') {
                            foreach ($value as $key2 => $value2) {
                                $this->config['lang']['' . $key . '']['' . $key2 . ''] = array_merge($this->config['lang']['app']['' . $key2 . ''], $value2);
                            }
                        }
                    }

                    /* ## ANNOTATIONS ## */
                    $controllers = scandir(SRC_PATH . $entrySrc . '/' . SRC_CONTROLLER_PATH);

                    foreach ($controllers as $controller) {
                        if (strlen($controller) > 2) {
                            $annotation = Annotation::getClass('Src\\' . $entrySrc . '\\Controller\\' . basename($controller, '.php'));
                            $this->_parseAnnotationRoute($entrySrc, $controller, $annotation);
                            $this->_parseAnnotationCron($entrySrc, $controller, $annotation);
                        }
                    }

                    /* ## ENTITIES ## */
                    $entities = scandir(APP_RESOURCE_ENTITY_PATH);

                    foreach ($entities as $entity) {
                        if (strlen($entity) > 2 && strstr($entity, '.')) {
                            Annotation::getClass('\\Gcs\\App\Resource\\Entity\\' . basename($entity, '.php'));
                        }
                    }
                }
            }

            closedir($handleSrc);
        }
        else {
            throw new Exception('The directory ' . SRC_PATH . 'doesn\'t exist');
        }

        if ($this->config['user']['output']['cache']['config']) {
            $this->_cache->setContent($this->config);
            $this->_cache->setCache();
        }
    }
784551
function(constructor, desc){
        var name = constructor.name;
        this.assert(
            this.obj instanceof constructor
            , function(){ return 'expected ' + this.inspect + ' to be an instance of ' + name + (desc ? " | " + desc : "") }
            , function(){ return 'expected ' + this.inspect + ' not to be an instance of ' + name + (desc ? " | " + desc : "") });
        return this;
    }
209200
function Constructor() {
                // All construction is actually done in the init method.
                if (!initializing) {
                    return this.constructor !== Constructor && arguments.length ?
                    // We are being called without `new` or we are extending.
                    arguments.callee.extend.apply(arguments.callee, arguments) :
                    // We are being called with `new`.
                    this.constructor.newInstance.apply(this.constructor, arguments);
                }
            }
1186406
protected static function init(): void
    {
        if (!static::$initialized) {
            $baseClass = Base::getInstance();
            static::$initialized = true;
            static::$newDirectoryMode = \octdec((string)$baseClass->Filesystem->newDirectoryMode);
            static::$newFileMode = \octdec((string)$baseClass->Filesystem->newFileMode);
            static::$writeLocks = (boolean)$baseClass->Filesystem->writeLocks;
            static::$hashFileDir = $baseClass->parsePath((string)$baseClass->Filesystem->hashFileDirectory);
            static::$hashFileDirDepth = (int)$baseClass->Filesystem->hashFileDirectoryDepth;
            static::$documentRoot = $baseClass->parsePath('%DOCUMENT_ROOT%').DIRECTORY_SEPARATOR;
        }
    }
265458
public function constructor()
    {
        $this->key = md5('SystemCartData');

        if( $sessionCart = $this->driver->select($this->key) )
        {
            Properties::$items = $sessionCart;
        }
    }
1153834
function(constructorFn, args) {

		    var newConstructorFn = function () {
			    constructorFn.apply(this, args);
		    };
		    newConstructorFn.prototype = constructorFn.prototype;
		    return new newConstructorFn();
	    }
41580
function init$1(params){
	var p = params || {};
	TRACE = p.TRACE || false;
	if (p.crossOrigin) { crossOrigin = p.crossOrigin; }
	if (p.baseUrl) { baseUrl = p.baseUrl; }
	if (baseUrl.slice(-1) !== '/') { baseUrl += '/'; }

	loader = new altspace.utilities.shims.OBJMTLLoader();
	loader.crossOrigin = crossOrigin;
	if (TRACE) { console.log('MultiLoader initialized with params', params); }
}
687993
function constructor(options) {
    Pagelet.prototype.constructor.call(this, options = options || {});

    //
    // Store the provided global dependencies.
    //
    this.dependencies = this._bigpipe._compiler.page(this).concat(
      options.dependencies
    );

    var req = options.req || {}
      , uri = req.uri || {}
      , query = req.query || {};

    //
    // Set a number of properties on the response as it is available to all pagelets.
    // This will ensure the correct amount of pagelets are processed and that the
    // entire queue is written to the client.
    //
    this._queue = [];

    //
    // Prepare several properties that are used to render the HTML fragment.
    //
    this.length = options.length || 0;
    this.child = options.child || 'root';
    this.once('contentType', this.contentTypeHeader, this);

    //
    // Set the default fallback script, see explanation above.
    //
    this.debug('Initialized in %s mode', options.mode);
    this.fallback = 'sync' === options.mode ? script : noscript.replace(
      '{path}',
      uri.pathname || 'http://localhost/'
    ).replace(
      '{query}',
      qs.stringify(this.merge({ no_pagelet_js: 1 }, query))
    );
  }
34269
public function _construct()
    {
        $this->_init(
            \Dotdigitalgroup\Email\Model\Review::class,
            \Dotdigitalgroup\Email\Model\ResourceModel\Review::class
        );
    }
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);
    });
}