Get source id.

@param \simplehtmldom_1_5\simple_html_dom $source_area

@return string
513894
private function getSourceId($source_area)
    {
        $id = $source_area->find('strong a', 0)->href;
        $id = explode('/', $id);

        return $id[4];
    }
1198177
private static function getNodeId()
    {
        if (self::$hostIp !== null) {
            return ip2long(self::$hostIp);
        }

        self::$hostIp = '127.0.0.1';

        if (self::$hostName !== null) {
            self::$hostIp = crc32(self::$hostName);
        }

        if (true === function_exists('php_uname')) {
            self::$hostName = php_uname('n');
            self::$hostIp = gethostbyname(self::$hostName);
        }

        if (true === function_exists('gethostname')) {
            self::$hostName = gethostname();
            self::$hostIp = gethostbyname(self::$hostName);
        }

        return ip2long(self::$hostIp);
    }
923254
private function getJapaneseName($name_area)
    {
        $name = $name_area->find('.information', 0)->find('span', 0);
        if ($name) {
            $name = $name->plaintext;

            return substr($name, 1, strlen($name) - 3);
        }

        return '';
    }
1199700
public static function getResourceIdFromUrl($url)
    {
        $url = rtrim($url, '/');
        $parts = explode('/', $url);
        return (int)array_pop($parts);
    }
331874
public function getSourceList()
    {
        $url = 'http://www.oekobaudat.de/OEKOBAU.DAT/resource/sources/?pageSize=20000';
        $xmlString = file_get_contents($url);
        $xmlString = str_replace(array('s:', 'sapi:', 'mm:', 'xlink:'), '', $xmlString);
        $sources = \simplexml_load_string($xmlString);

        $result = array();
        foreach ($sources as $source) {
            $result[(string) $source->uuid] = (string) $source->name;
        }

        return $result;
    }
296099
def id_source(source, full=False):
    
    if source not in source_ids:
        return ''

    if full:
        return source_ids[source][1]
    else:
        return source_ids[source][0]
1285079
private function getAmountFields(Source $source, array $entry)
    {
        $fields = array();
        if (!empty($entry['totalvalue']) && !empty($entry['totalvalueexclvat'])) {
            // Get Acumulus amounts.
            $amountExAcumulus = $entry['totalvalueexclvat'];
            $amountIncAcumulus = $entry['totalvalue'];
            $amountVatAcumulus = $amountIncAcumulus - $amountExAcumulus;

            // Get local amounts.
            $localTotals = $source->getTotals();

            // Compare.
            $amountExStatus = $this->getAmountStatus($amountExAcumulus, $localTotals[Meta::InvoiceAmount]);
            $amountIncStatus = $this->getAmountStatus($amountIncAcumulus, $localTotals[Meta::InvoiceAmountInc]);
            $amountVatStatus = $this->getAmountStatus($amountVatAcumulus, $localTotals[Meta::InvoiceVatAmount]);

            $amountEx = $this->getFormattedAmount($amountExAcumulus, $amountExStatus);
            $amountInc = $this->getFormattedAmount($amountIncAcumulus, $amountIncStatus);
            $amountVat = $this->getFormattedAmount($amountVatAcumulus, $amountVatStatus);

            $fields['invoice_amount'] = array(
                'type' => 'markup',
                'label' => $this->t('invoice_amount'),
                'value' => sprintf('<div class="acumulus-amount">%1$s%2$s %4$s%3$s</div>', $amountEx, $amountVat, $amountInc, $this->t('vat')),
            );
        }
        return $fields;
    }
1019061
public int getNode(Source source)
  {

//    if (source instanceof DOMSource)
//      return ((DOMSource) source).getNode();

    // TODO: Not sure if the BaseID is really the same thing as the ID.
    String url = source.getSystemId();

    if (null == url)
      return DTM.NULL;

    int n = m_sourceTree.size();

    // System.out.println("getNode: "+n);
    for (int i = 0; i < n; i++)
    {
      SourceTree sTree = (SourceTree) m_sourceTree.elementAt(i);

      // System.out.println("getNode -         url: "+url);
      // System.out.println("getNode - sTree.m_url: "+sTree.m_url);
      if (url.equals(sTree.m_url))
        return sTree.m_root;
    }

    // System.out.println("getNode - returning: "+node);
    return DTM.NULL;
  }
1352634
private function getAnimeId($anime_area)
    {
        $anime_id = $anime_area->find('a', 0)->href;
        $parsed_anime_id = explode('/', $anime_id);

        return $parsed_anime_id[4];
    }
524231
private function determineSourceFolder()
	{
		$this->sourceFolder = JPATH_BASE . "/" . $this->getJConfig()->source;

		if (!is_dir($this->sourceFolder))
		{
			$this->say('Warning - Directory: ' . $this->sourceFolder . ' is not available');
		}
	}
355814
public function getSourceBaseCurrency($source) {

        if ($this->_source === FALSE) {
            $this->_loadSources();
        }

        return $this->_source[$source]['fcsr_base_fcrn_id'];
    }
369897
public static function getClientIP($getSource = false)
    {
        if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
            $ip     = $_SERVER['HTTP_CLIENT_IP'];
            $source = 'HTTP_CLIENT_IP';

        } elseif (!empty($_SERVER['HTTP_X_REAL_IP'])) {
            $ip     = $_SERVER['HTTP_X_REAL_IP'];
            $source = 'HTTP_X_REAL_IP';

        } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $ip     = $_SERVER['HTTP_X_FORWARDED_FOR'];
            $source = 'HTTP_X_FORWARDED_FOR';

        } elseif (!empty($_SERVER['REMOTE_ADDR'])) {
            $ip     = $_SERVER['REMOTE_ADDR'];
            $source = 'REMOTE_ADDR';

        } else {
            $ip     = '0.0.0.0';
            $source = 'undefined';
        }

        if ($getSource) {
            return $source;
        } else {
            return $ip;
        }
    }
830278
public function getID(): ?string
    {
        $sessionKey = $this->getSessionKey();
        if (strlen($sessionKey) === 0) {
            return null;
        }
        $cacheKey = 'id-' . $sessionKey;
        if (!isset(self::$cache[$cacheKey])) {
            self::$cache[$cacheKey] = null;
            $data = Internal\Data::getValue('.temp/bearcms/userkeys/' . md5($sessionKey));
            if ($data !== null) {
                self::$cache[$cacheKey] = $data;
            }
        }
        return self::$cache[$cacheKey];
    }
199427
public function getPublicAccessUrl()
    {
        if (is_null($this->accessProvider)) {
            common_Logger::e('accessss');
            throw new common_Exception('Tried obtaining access to private directory with ID ' . $this->getId());
        }
        return $this->accessProvider->getAccessUrl($this->prefix . DIRECTORY_SEPARATOR);
    }
1301782
public function source($start = null, $end = null)
    {
        $source = '';
        $start = (int) $start;
        $end = $end === null ? ($this->count() - 1) : (int) $end;
        for ($i = $start; $i <= $end; $i++) {
            $source .= $this->_data[$i][1];
        }
        return $source;
    }
1045079
public String getSourceKey() {
        if (sourceKey == null) {
            // Value is idempotent, so it's okay to do this without synchronizing ...
            sourceKey = key.substring(SOURCE_START_INDEX, SOURCE_END_INDEX);
        }
        return sourceKey;
    }
1326181
private function getEpisode($result_area)
    {
        $episode = $result_area->find('td', 3)->plaintext;
        $episode = trim($episode);

        return $episode == '-' ? '' : $episode;
    }