Initialize the singleton.

@return AnsiToHtmlConverter
11137
private static function getInstance()
    {
        if (self::$converter === null) {
            self::$converter = new AnsiToHtmlConverter(null, false);
        }

        return self::$converter;
    }
770379
public static function initialize()
    {
        $manager = self::$manager = new self();
        $manager->seedHandlerStack();

        session_set_save_handler($manager);

        return $manager;
    }
840093
public function initElement()
    {
        if(is_null($this->settings)) {
            $this->settings = new InputSettings();
        }

        return $this->build($this->settings);
    }
672064
public function newInstance()
    {
        $class = $this->entityMap->getClass();

        if ($this->entityMap->useDependencyInjection()) {
            return $this->newInstanceUsingDependencyInjection($class);
        }

        return $this->newInstanceUsingInstantiator($class);
    }
1368125
protected function initInstances(): self
    {
        if (is_array($this->data) && !empty($this->data)) {
            //Iterates and instantiate records
            $iterator = new RecordIterator($this->data, $this->class, $this->orm);

            foreach ($iterator as $item) {
                if (in_array($item, $this->instances, true)) {
                    //Skip duplicates
                    continue;
                }

                $this->instances[] = $item;
            }
        }

        //Memory free
        $this->data = null;

        return $this;
    }
57240
public static function instance(): self
    {
        if (!self::$instance) {
            self::$instance = new self(
                Sequencer::sequence('mock-label'),
                MockGenerator::instance(),
                HandleFactory::instance()
            );
        }

        return self::$instance;
    }
112727
public static function &GetInstance()
    {
        static $oInstance = null;
        if (is_null($oInstance)) {
            $oInstance = new self();
            TPkgCmsEventManager::GetInstance()->RegisterObserver(TPkgCmsEvent::CONTEXT_CORE, TPkgCmsEvent::NAME_PRE_OUTPUT_CALLBACK_FUNCTION, $oInstance);
        }

        return $oInstance;
    }
239743
function initialize()
    {
        if ($this->isInitialize())
            return $this;

        // ) Load Modules ------------------------------------------------------\
        $serviceManager = $this->getServiceManager();
        /** @var ModuleManager $moduleManager */
        $moduleManager  = $serviceManager->get('ModuleManager');
        $moduleManager->loadModules();

        // ) Attach Listeners To Events ----------------------------------------\
        $events = $this->getEventManager();
        foreach ($this->listeners as $listener) {
            if (!is_object($listener)) {
                if (class_exists($listener))
                    $listener = new $listener();
                else
                    $listener = $this->getServiceManager()->get($listener);
            }

            if (!$listener instanceof ListenerAggregateInterface)
                throw new \Exception(sprintf(
                    'Listener must instance of "ListenerAggregateInterface" but "%s" given.'
                    , is_object($listener) ? get_class($listener) : gettype($listener)
                ));

            // Attach Aggregate Listener
            $events->attach($listener);
        }

        // Ci) Bootstrap Application --------------------------------------------\
        $this->bootstrap();

        $this->__isInitialize = true;

        return $this;
    }
412
public static function getInstance ()
    {
        // If this class is used for multiple singletons, we need to keep
        // track of multiple singleton objects, one for each class name
        static $instances = array();

        // Get class name to use. Use late static binding here,
        // if method is overriden by derived classes.
        $singletonClassName = static::_getInstanceClassName();

        // If already instantiated, use that
        if (isset($instances[$singletonClassName])) {
            return $instances[$singletonClassName];
        }

        // Otherwise create new instance
        $instances[$singletonClassName] = new $singletonClassName (static::_getInstanceFuseValue());

        return $instances[$singletonClassName];
    }
250673
public function newInstance()
    {
        if (!$this->instantiator instanceof InstantiatorInterface) {
            $this->instantiator = new Instantiator();
        }

        return $this->instantiator->instantiate($this->name);
    }
652660
private function initContentWrapper()
    {
        if ($this->getAutoloader()->isRestored()) {
            return $this;
        }

        if (null === $contentwrapperConfig = $this->getConfig()->getContentwrapperConfig()) {
            throw new BBException('None class content wrapper found');
        }

        $namespace = isset($contentwrapperConfig['namespace']) ? $contentwrapperConfig['namespace'] : '';
        $protocol = isset($contentwrapperConfig['protocol']) ? $contentwrapperConfig['protocol'] : '';
        $adapter = isset($contentwrapperConfig['adapter']) ? $contentwrapperConfig['adapter'] : '';

        $this->getAutoloader()->registerStreamWrapper($namespace, $protocol, $adapter);

        return $this;
    }
10376
static function initialize()
    {
        if ( !isset( $GLOBALS['eZ1337Translator'] ) ||
             !( $GLOBALS['eZ1337Translator'] instanceof eZ1337Translator ) )
        {
            $GLOBALS['eZ1337Translator'] = new eZ1337Translator();
        }

        $man = eZTranslatorManager::instance();
        $man->registerHandler( $GLOBALS['eZ1337Translator'] );
        return $GLOBALS['eZ1337Translator'];
    }
11244
public function initialize()
    {
        $this->_connection->table(self::TABLE)
            ->createIfNotExists(array(
                'name' => new \Pheasant\Types\StringType(255, 'notnull primary'),
                'id' => new \Pheasant\Types\IntegerType(null, 'notnull unsigned'),
                ));

        return $this;
    }
753083
public function initConsumer ()
		{
			try
			{
				$records[ 'name' ] = $this->source;
				$records[ 'format' ] = 'json';
				$ch = curl_init();
				curl_setopt($ch, CURLOPT_URL, $this->host . ':' . $this->port . '/consumers/' . $this->source);
				curl_setopt($ch, CURLOPT_POST, 1);
				curl_setopt($ch, CURLOPT_POSTFIELDS, Json::encode($records));
				curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

				$headers = [
					'Content-Type:application/vnd.kafka.v2+json'
				];
				curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

				$server_output = curl_exec($ch);

				Console::printColor('Create consumer: ' . $server_output);
				curl_close($ch);

				$data[ 'topics' ] = $this->topic;
				$ch = curl_init();
				curl_setopt($ch, CURLOPT_URL, $this->host . ':' . $this->port . '/consumers/' . $this->source . '/instances/' . $this->source . '/subscription');
				curl_setopt($ch, CURLOPT_POST, 1);
				curl_setopt($ch, CURLOPT_POSTFIELDS, Json::encode($data));
				curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

				$headers = [
					'Content-Type:application/vnd.kafka.v2+json'
				];

				curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

				$server_output = curl_exec($ch);

				Console::printColor('Create instances: ' . $server_output);
				curl_close($ch);
			}
			catch (\Exception $e)
			{
				if (YII_DEBUG)
					throw new UnprocessableEntityHttpException($e->getMessage());

				Yii::error($e->getMessage());
				if (Yii::$app->has('logging'))
					Yii::$app->logging->info(Yii::tr('Kafka init consumers {error}.', [ 'error' => $e->getMessage() ]));

				return [];
			}
		}
949862
public void init(Converter converter, Converter convAlternate, Converter convCheckmark)
    {
        super.init(converter, convAlternate);
        m_convCheckmark = convCheckmark;
    }
933225
protected function _initReader()
    {
        $this->_reader = new Mage_Archive_Helper_File($this->_getCurrentFile());
        $this->_reader->open('r');

        return $this;
    }
1225072
protected function _initSettings()
    {
        try {

            $this->setAttributes($this->settings);
            $this->_oldAttributes = $this->toArray($this->safeAttributes());
        } catch (\Exception $e) {
            \Yii::error(\Yii::t('skeeks/cms', '{cms} component error load defaul settings',
                    ['cms' => 'Cms']).': '.$e->getMessage());
        }

        return $this;
    }