_processGlobalMetadata() - this method initizes the sessions GLOBAL
metadata, mostly global data expiration calculations.

@return void
974603
private static function _processStartupMetadataGlobal()
    {
        // process global metadata
        if (isset($_SESSION['__ZF'])) {

            // expire globally expired values
            foreach ($_SESSION['__ZF'] as $namespace => $namespace_metadata) {

                // Expire Namespace by Time (ENT)
                if (isset($namespace_metadata['ENT']) && ($namespace_metadata['ENT'] > 0) && (time() > $namespace_metadata['ENT']) ) {
                    unset($_SESSION[$namespace]);
                    unset($_SESSION['__ZF'][$namespace]);
                }

                // Expire Namespace by Global Hop (ENGH) if it wasnt expired above
                if (isset($_SESSION['__ZF'][$namespace]) && isset($namespace_metadata['ENGH']) && $namespace_metadata['ENGH'] >= 1) {

                    $_SESSION['__ZF'][$namespace]['ENGH']--;

                    if ($_SESSION['__ZF'][$namespace]['ENGH'] === 0) {
                        if (isset($_SESSION[$namespace])) {
                            parent::$_expiringData[$namespace] = $_SESSION[$namespace];
                            unset($_SESSION[$namespace]);
                        }
                        unset($_SESSION['__ZF'][$namespace]);
                    }
                }

                // Expire Namespace Variables by Time (ENVT)
                if (isset($namespace_metadata['ENVT'])) {
                    foreach ($namespace_metadata['ENVT'] as $variable => $time) {
                        if (time() > $time) {
                            unset($_SESSION[$namespace][$variable]);
                            unset($_SESSION['__ZF'][$namespace]['ENVT'][$variable]);
                        }
                    }
                    if (empty($_SESSION['__ZF'][$namespace]['ENVT'])) {
                        unset($_SESSION['__ZF'][$namespace]['ENVT']);
                    }
                }

                // Expire Namespace Variables by Global Hop (ENVGH)
                if (isset($namespace_metadata['ENVGH'])) {
                    foreach ($namespace_metadata['ENVGH'] as $variable => $hops) {
                        $_SESSION['__ZF'][$namespace]['ENVGH'][$variable]--;

                        if ($_SESSION['__ZF'][$namespace]['ENVGH'][$variable] === 0) {
                            if (isset($_SESSION[$namespace][$variable])) {
                                parent::$_expiringData[$namespace][$variable] = $_SESSION[$namespace][$variable];
                                unset($_SESSION[$namespace][$variable]);
                            }
                            unset($_SESSION['__ZF'][$namespace]['ENVGH'][$variable]);
                        }
                    }
                    if (empty($_SESSION['__ZF'][$namespace]['ENVGH'])) {
                        unset($_SESSION['__ZF'][$namespace]['ENVGH']);
                    }
                }

                if (isset($namespace) && empty($_SESSION['__ZF'][$namespace])) {
                    unset($_SESSION['__ZF'][$namespace]);
                }
            }
        }

        if (isset($_SESSION['__ZF']) && empty($_SESSION['__ZF'])) {
            unset($_SESSION['__ZF']);
        }
    }
647451
protected function setGlobalVariables()
    {
        $globalVars = $this->admin->scriptVariables();

        foreach ($globalVars as $var => $value) {
            $this->meta->putGlobalVar($var, $value);
        }
    }
1358329
protected function loadMetadatas()
    {
        try {
            $this->metadatas = array();
            $em = $this->getEntityManager();
            $cmf = $em->getMetadataFactory();
            foreach ($cmf->getAllMetadata() as $metaData) {
                $this->metadatas[$metaData->getName()] = $metaData;
            }
        } catch (MappingException $e) {
            // we don't want them complaining about a src directory not being in the package.
        }
    }
633887
protected void writeMetadata() throws IOException {
    Set<GlobalMetadata> collectedMetadata = metadataCollector.getMetadataRecords();

    if (collectedMetadata.isEmpty()) {
      return;
    }

    String propName =
        ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_METADATA_KEY, numBranches, branchId);
    String metadataStr;
    if (collectedMetadata.size() == 1) {
      metadataStr = collectedMetadata.iterator().next().toJson();
    } else {
      StringBuilder sb = new StringBuilder();
      sb.append('[');
      boolean first = true;

      for (GlobalMetadata md : collectedMetadata) {
        if (!first) {
          sb.append(',');
        }
        sb.append(md.toJson());
        first = false;
      }
      sb.append(']');
      metadataStr = sb.toString();
    }

    this.properties.setProp(propName, metadataStr);
  }
804168
public function onMetaParsing()
    {
        // make sure to trigger the onMetaHeaders event
        $this->getMetaHeaders();

        if ($this->triggersApiEvents(self::API_VERSION_0_9, self::API_VERSION_1_0)) {
            $headersFlipped = array_flip($this->metaHeaders);

            $this->triggerEvent(self::API_VERSION_0_9, 'before_read_file_meta', array(&$headersFlipped));
            $this->triggerEvent(self::API_VERSION_1_0, 'onMetaParsing', array(&$this->rawContent, &$headersFlipped));

            $this->updateFlippedMetaHeaders($headersFlipped);
        }
    }
1069343
public function setMetadataValues($values)
    {
        foreach ($values as $name => $value) {
            $this->metadata[$name] = $value;
        }
    }
162242
def _init_metadata(self, **kwargs):
        """"""
        osid_objects.OsidRelationshipForm._init_metadata(self, **kwargs)
        self._completion_default = self._mdata['completion']['default_decimal_values'][0]
        self._level_default = self._mdata['level']['default_id_values'][0]
600859
def _init_metadata(self):
        """"""

        # pylint: disable=attribute-defined-outside-init
        # this method is called from descendent __init__
        self._mdata.update(default_mdata.get_osid_form_mdata())
        update_display_text_defaults(self._mdata['journal_comment'], self._locale_map)
        for element_name in self._mdata:
            self._mdata[element_name].update(
                {'element_id': Id(self._authority,
                                  self._namespace,
                                  element_name)})
        self._journal_comment_default = self._mdata['journal_comment']['default_string_values'][0]
        self._validation_messages = {}
134715
protected function backupGlobals() {
		$this->globalsBackup = array();
		foreach($GLOBALS as $key => $value) {
			if($key != 'GLOBALS') {
				$this->globalsBackup[$key] = $value;
			}
		}
	}
1007035
private function handleDeletedModelMetas()
	{
		if ($this->metableTableSoftDeletes()) {
			foreach ($this->metas as $meta) {
				$this->syncMetableTableAttributes();
				$meta->decrement('num_items');
			}
			
			return;
		}
		
		$this->unsetMeta();
	}
1200006
def _init_metadata(self, **kwargs):
        """"""
        osid_objects.OsidObjectForm._init_metadata(self, **kwargs)
        self._courses_default = self._mdata['courses']['default_id_values']
        self._assessments_default = self._mdata['assessments']['default_id_values']
        self._assets_default = self._mdata['assets']['default_id_values']
874485
def _init_metadata(self, **kwargs):
        """"""
        osid_objects.OsidObjectForm._init_metadata(self, **kwargs)
        self._output_score_default = self._mdata['output_score']['default_decimal_values'][0]
        self._input_score_end_range_default = self._mdata['input_score_end_range']['default_decimal_values'][0]
        self._input_score_start_range_default = self._mdata['input_score_start_range']['default_decimal_values'][0]
146949
public function setMetadata(string $metadata): void
    {
        $this->isValidString($metadata, 1000);

        $this->metadata = $metadata;
    }
1141839
public void usage(GlobalMetadata global, StringBuilder out)
    {
        usage(global, new UsagePrinter(out, columnSize));
    }
1232141
function setMetaData( $key, $value )
    {
        $this->MetaData[$key] = $value;
        eZDebug::writeNotice( 'Set MetaData : [' . $key . '] = ' . $value, __METHOD__ );
        $this->savePersistentData();
    }
701331
protected function setup_metadata() {
		if ( ! $this->meta_type ) {
			return;
		}

		$metadata = $this->get_metadata();
		foreach ( $this->get_mapping() as $attribute => $meta ) {
			if ( isset( $metadata[ $meta ] ) ) {
				$this->set_attribute( $attribute, $metadata[ $meta ] );
			}
		}
	}
257766
def _init_metadata(self, **kwargs):
        """"""
        osid_objects.OsidRelationshipForm._init_metadata(self, **kwargs)
        update_display_text_defaults(self._mdata['text'], self._locale_map)
        self._text_default = dict(self._mdata['text']['default_string_values'][0])
        self._rating_default = self._mdata['rating']['default_id_values'][0]