Init metadata

@param  boolean $reload
@return void
500513
public function init($reload = false)
    {
        if (!$this->useCache) {
            $reload = true;
        }

        if (file_exists($this->cacheFile) && !$reload) {
            $this->data = $this->getFileManager()->getPhpContents($this->cacheFile);
        } else {
            $this->clearVars();
            $objData = $this->getAllObjects(false, $reload);
            $this->data = Util::objectToArray($objData);

            if ($this->useCache) {
                $isSaved = $this->getFileManager()->putPhpContents($this->cacheFile, $this->data);
                if ($isSaved === false) {
                    $GLOBALS['log']->emergency('Metadata:init() - metadata has not been saved to a cache file');
                }
            }
        }
    }
533155
private function _ensureFieldData($reload = false)
    {
        if ($this->_respTrackData && (null === $this->_fieldData) || $reload) {
            $this->_fieldData = $this->getTrackEngine()->getFieldsData($this->_respTrackId);
            $this->_fixFieldData();
        }
    }
752040
public function autoload_init()
	{
		$this->init();
		// Addons
		for ( $i = count( $this->addons ) - 1; $i >= 0; --$i ) {
			$this->addons[$i]->init();
		}
	}
1291331
protected function finalizeStructure($reload = false)
    {
        if ($reload || !$this->isStructureFinalized) {
            $this->isStructureFinalized = true;

            $property = $this->storageProperty();

            $struct = $property->structureMetadata();
            $formGroup = null;
            if (isset($struct['admin']['default_form_group'])) {
                $groupName = $struct['admin']['default_form_group'];
                if (isset($struct['admin']['form_groups'][$groupName])) {
                    $formGroup = $struct['admin']['form_groups'][$groupName];
                }
            } elseif (isset($struct['admin']['form_group'])) {
                if (is_string($struct['admin']['form_group'])) {
                    $groupName = $struct['admin']['form_group'];
                    if (isset($struct['admin']['form_groups'][$groupName])) {
                        $formGroup = $struct['admin']['form_groups'][$groupName];
                    }
                } else {
                    $formGroup = $struct['admin']['form_group'];
                }
            }

            if ($formGroup) {
                if (is_array($this->rawData)) {
                    $widgetData = array_replace($formGroup, $this->rawData);
                    $this->setData($widgetData);
                } else {
                    $this->setData($formGroup);
                }
            }
        }
    }
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;
        }
    }
586513
private function initialize()
    {
        $this->extension = 'module';
        $this->extensions = [
            'module' => [],
            'theme' => [],
            'profile' => [],
        ];
        $this->filters = [
            'showInstalled' => false,
            'showUninstalled' => false,
            'showCore' => false,
            'showNoCore' => false
        ];
    }
1223112
public function attachUser($user, $reload = true)
    {
        if ($this->hasUser($user)) return;

        event(new AttachingUserToRole($this, $user));
        $this->users()->attach($user);
        event(new AttachedUserToRole($this, $user));

        $this->loadUsers($reload);
    }
1135905
private static function init(): void
    {
        if (!static::$initialized) {
            $baseClass = Base::getInstance();
            static::$initialized = true;
            static::$revalidationTime = (int)$baseClass->Session->RevalidationTimeout;
        }
    }
826780
public static void initializeMetadata()
    {
        // TODO: merge inside meta API.
        DbConn cnx = null;
        try
        {
            cnx = Helpers.getNewDbSession();
            Helpers.updateConfiguration(cnx);
            cnx.commit();
        }
        catch (Exception e)
        {
            throw new JqmRuntimeException("Could not set metadata", e);
        }
        finally
        {
            Helpers.closeQuietly(cnx);
        }
    }
1182604
protected function listActiveEvent($reload = false)
    {
        if (!isset($this->dispatcher) || (isset($this->activeEvents) && !$reload)) {
            return $this;
        }

        $this->activeEvents = [];
        $eventList          = FlowEvent::getEventList();
        $sortedListeners    = $this->dispatcher->getListeners();
        foreach ($sortedListeners as $eventName => $listeners) {
            if (isset($eventList[$eventName]) && !empty($listeners)) {
                $this->activeEvents[$eventName] = 1;
            }
        }

        return $this;
    }
1162647
function initialize( $currentVersion = null, $originalContentObjectAttribute = null )
    {
        if ( $originalContentObjectAttribute === null )
            $originalContentObjectAttribute = $this;
        $classAttribute = $this->contentClassAttribute();
        $dataType = $classAttribute->dataType();
        if ( $dataType )
            $dataType->initializeObjectAttribute( $this, $currentVersion, $originalContentObjectAttribute );
    }
1345296
public static function instance($reload = false) {

        if (HttpRequest::$instance == null || $reload) {
            HttpRequest::$instance = new HttpRequest ();
        }


        return HttpRequest::$instance;
    }
1326235
private static function init(): void
    {
        if (!static::$initialized) {
            $baseClass = Base::getInstance();
            static::$initialized = true;
            static::$serverName = (string)$baseClass->getServerName();
            static::$refererIntegrityEnabled = (bool)$baseClass->Session->RefererIntegrity->enabled;
            static::$tokenIntegrityEnabled = (bool)$baseClass->Session->TokenIntegrity->enabled;
            static::$tokenUseLooseIP = (bool)$baseClass->Session->TokenIntegrity->useLooseIP;
            static::$tokenUseHttpUserAgent = (bool)$baseClass->Session->TokenIntegrity->useHttpUserAgent;
            static::$tokenUseHttpAccept = (bool)$baseClass->Session->TokenIntegrity->useHttpAccept;
            static::$tokenUseHttpAcceptCharset = (bool)$baseClass->Session->TokenIntegrity->useHttpAcceptCharset;
            static::$tokenUseHttpAcceptEncoding = (bool)$baseClass->Session->TokenIntegrity->useHttpAcceptEncoding;
            static::$tokenUseHttpAcceptLanguage = (bool)$baseClass->Session->TokenIntegrity->useHttpAcceptLanguage;
        }
    }
781971
public function initialize()
    {
        parent::initialize();

        $this->setHtmlAttributes($this->getHtmlAttributes() + [
            'type'  => 'submit',
            'name'  => 'next_action',
            'class' => 'btn btn-warning',
            'data-url'=> $this->getModelConfiguration()->getRestoreUrl($this->getModel()->getKey()),
            'data-redirect'=> $this->getModelConfiguration()->getEditUrl($this->getModel()->getKey()),
        ]);
    }
541631
private function init() {
		$this->home();
		$this->applyRules();
		IfTTT::runArray([
			'is_404'               => [ $this, 'notFound'],
			'is_search'            => [ $this, 'search'],
			'is_tax'               => [ $this, 'tax'],
			'is_attachment'        => [ $this, 'attachment'],
			'is_singular'          => [ $this, 'singular'],
			'is_category'          => [ $this, 'category'],
			'is_tag'               => [ $this, 'tag'],
			'is_author'            => [ $this, 'author'],
			'is_day'               => [ $this, 'day'],
			'is_month'             => [ $this, 'month'],
			'is_year'              => [ $this, 'year'],
			'is_post_type_archive' => [ $this, 'postTypeArchive']
		]);
	}
1143819
public function init()
	{
		$this->_server = CMap::mergeArray($this->_serverDefaults, $this->_server);
		parent::init();
        $this->getRedis();
	}
747808
public function init(): void
    {
        parent::init();

        if ($this->default !== '' && $this->default !== null && !is_array($this->default)) {
            try {
                $default = Json::decode($this->default);

                if (is_array($default)) {
                    $this->default = $default;
                }
            } catch (InvalidArgumentException $exception) {}
        }
    }