Static method init

@param array $options # other options

@return void
966948
public static function init($options = array())
    {
        $defaults = array(
            'mode'=>'default',
            'dict'=>'normal'
        );

        $options = array_merge($defaults, $options);

        if ($options['mode']=='test') {
            echo "Building Trie...\n";
        }

        if ($options['dict']=='small') {
            $f_name = "dict.small.txt";
            self::$dictname="dict.small.txt";
        } elseif ($options['dict']=='big') {
            $f_name = "dict.big.txt";
            self::$dictname="dict.big.txt";
        } else {
            $f_name = "dict.txt";
            self::$dictname="dict.txt";
        }

        $t1 = microtime(true);
        self::$trie = Jieba::genTrie(dirname(dirname(__FILE__))."/dict/".$f_name);
        if ($options['mode']=='test') {
            echo "loading model cost ".(microtime(true) - $t1)." seconds.\n";
            echo "Trie has been built succesfully.\n";
        }
    }
1283897
final public function init(&$args, &$options, &$called)
    {
        $this->args = &$args;
        $this->options = &$options;
        $this->called = &$called;

        /*
         * Execute Module generated Hook if Wordpress is available.
         */
        if (class_exists('\WP')) {
            call_user_func_array('do_action', array('Xiphe\HTML\ModuleCreated', &$this, Config::getHTMLInstance()));
        }
    }
828780
protected function childInitialize(array $options = array())
    {
        $this->prepared = false;
        $this->removeAllListeners();
        $this->master = false;
        $pid = posix_getpid();
        $this->ppid = $this->pid;
        $this->pid = $pid;
        $this->queue = null;
        $this->process = new Process($this, $this->pid, $this->ppid);
        $this->children = array();
        $this->prepared = true;

        $options = $options + self::$child_options;

        $this->childProcessOptions($options);
    }
443062
public function setOptions(array $options)
    {
        $limit = array_get($options, static::OPT_LIMIT);

        if (!empty($limit)) {
            $this->setHeaders(['x-ms-max-item-count' => $limit]);
        }
    }
1167543
protected function initialize($options)
    {
        if (is_array($options) === false && ($options instanceof Traversable) === false) {
            throw new Exception('The $options argument must be either an array or Traversable');
        }

        foreach ($options as $key => $value) {
            if (in_array($key, $this->configurable, true) === false) {
                continue;
            }

            $method = 'set'.ucfirst($key);

            if (method_exists($this, $method) === true) {
                $this->$method($value);
            }
        }
    }
244252
public function init(array $options = [])
    {
        if ($this->wasInitialized) {
            return;
        }

        $this->options = $this->normalizeOptions($options);
        define('AOP_ROOT_DIR', $this->options['appDir']);
        define('AOP_CACHE_DIR', $this->options['cacheDir']);

        /** @var $container AspectContainer */
        $container = $this->container = new $this->options['containerClass'];
        $container->set('kernel', $this);
        $container->set('kernel.interceptFunctions', $this->hasFeature(Features::INTERCEPT_FUNCTIONS));
        $container->set('kernel.options', $this->options);

        SourceTransformingLoader::register();

        foreach ($this->registerTransformers() as $sourceTransformer) {
            SourceTransformingLoader::addTransformer($sourceTransformer);
        }

        // Register kernel resources in the container for debug mode
        if ($this->options['debug']) {
            $this->addKernelResourcesToContainer($container);
        }

        AopComposerLoader::init($this->options, $container);

        // Register all AOP configuration in the container
        $this->configureAop($container);

        $this->wasInitialized = true;
    }
279055
public function setOptions($options)
    {
        $this->package->setParsedOptions($options);
        $this->inputCollector->setOptions($options);
    }
931619
protected function applyOptions(array $options): void
    {
        $this->logger->info('Applying options...', ['options' => $options]);

        $this->options = array_merge($this->options, $options);

        $this->logger->debug('Options applied and merged with defaults', ['options' => $this->options]);
    }
984123
protected function setDefaultOptions(array $options = [])
    {
        $this->options = $this->formHelper->mergeOptions($this->allDefaults(), $this->getDefaults());
        $this->options = $this->prepareOptions($options);
    }
1167192
protected function init(array $options = [])
    {
        if (array_key_exists(static::PERSISTENCE, $options)) {
            $this->persistence = $options[static::PERSISTENCE];
        }
        if (array_key_exists(static::PERSISTENCE_ARGS, $options)) {
            $this->persistenceArgs = $options[static::PERSISTENCE_ARGS];
        }

        if (array_key_exists(static::VARIABLE_RESOLVER, $options)) {
            $variableResolver = $options[static::VARIABLE_RESOLVER];
            if (null === $variableResolver) {
                $variableResolver = new DefaultVariableResolver();
            }
        } else {
            $variableResolver = new DefaultVariableResolver();
        }
        if (!$variableResolver instanceof VariableResolverInterface) {
            $errMsg = sprintf('Variable resolver not implements %s', VariableResolverInterface::class);
            throw new Exception\InvalidVariableResolverException($errMsg);
        }
        $this->variableResolver = $variableResolver;


        if (array_key_exists(static::WORKFLOW_FACTORY, $options)) {
            $workflowFactory = $options[static::WORKFLOW_FACTORY];
            if (null === $workflowFactory) {
                $workflowFactory = new UrlWorkflowFactory();
            }

            if (!$workflowFactory instanceof WorkflowFactoryInterface) {
                $errMsg = sprintf('Workflow factory not implements %s', WorkflowFactoryInterface::class);
                throw new Exception\InvalidWorkflowFactoryException($errMsg);
            }
            $workflowFactory->initDone();
            $this->factory = $workflowFactory;
        }
    }
712954
public static function init($options = array())
    {

        $defaults = array(
            'mode'=>'default'
        );

        $options = array_merge($defaults, $options);

        self::$prob_start = self::loadModel(dirname(dirname(__FILE__)).'/model/prob_start.json');
        self::$prob_trans = self::loadModel(dirname(dirname(__FILE__)).'/model/prob_trans.json');
        self::$prob_emit = self::loadModel(dirname(dirname(__FILE__)).'/model/prob_emit.json');

    }
1111498
public function setOptions(array $options)
    {
        foreach ($options as $option => $value) {
            $this->setOption($option, $value);
        }

        return $this;
    }
710716
public function setOptions(array $options)
    {
        foreach ($options as $name => $value) {
            $this->setOption($name, $value);
        }
    }
825939
public function setUp($options = array())
    {
        if (array_key_exists('atomic', $options)) {
            $this->atomic = (boolean) $options['atomic'];
        }
        return parent::setUp($options);
    }
212924
public function setOptions(array $options) : void
    {
        self::$options = array_unique(array_merge(self::$options, $options));
    }
885650
public function fromArray(array $options)
    {
        if (isset($options['Name'])) {
            Validate::isString($options['Name'], 'options[Name]');
            $this->_name = $options['Name'];
        }

        if (isset($options['IsDefault'])) {
            Validate::isBoolean($options['IsDefault'], 'options[IsDefault]');
            $this->_isDefault = $options['IsDefault'];
        }
    }
106026
public function setOptions($options) 
	{
		foreach ($this->options as $key => $option) {
			if (isset($options[$key])) {
				$this->options[$key] = $options[$key];
			}
		}
	}