protected static function loadStaticData( string $url, callable $processing = null ): array
	{
		$urlHash = md5($url);

		$data = self::loadCachedStaticData($url);
		if ($data) return $data;

		//  Lastly try loading from web
		$data = @file_get_contents($url);
		if ($data == false)
			throw new ArgumentException("Failed to load static-data for URL: '$url'.");

		$data = json_decode($data, true);
		//  Save to memory
		self::$staticData[$urlHash] = $data;

		self::saveSataicData($urlHash, $data);
		if ($processing) $processing($url, $data);
		return $data;
	}
protected static function loadStaticData( string $url, callable $processing = null ): array
	{
		$urlHash = md5($url);

		$data = self::loadCachedStaticData($url);
		if ($data) return $data;

		//  Lastly try loading from web
		$data = @file_get_contents($url);
		if ($data == false)
			throw new ArgumentException("Failed to load static-data for URL: '$url'.");

		$data = json_decode($data, true);
		//  Save to memory
		self::$staticData[$urlHash] = $data;

		self::saveSataicData($urlHash, $data);
		if ($processing) $processing($url, $data);
		return $data;
	}
protected static function loadStaticData ( string $ url , callable $ processing = null ) : array { $ urlHash = md5 ( $ url ) ; $ data = self :: loadCachedStaticData ( $ url ) ; if ( $ data ) return $ data ; //  Lastly try loading from web $ data = @ file_get_contents ( $ url ) ; if ( $ data == false ) throw new ArgumentException ( "Failed to load static-data for URL: '$url'." ) ; $ data = json_decode ( $ data , true ) ; //  Save to memory self :: $ staticData [ $ urlHash ] = $ data ; self :: saveSataicData ( $ urlHash , $ data ) ; if ( $ processing ) $ processing ( $ url , $ data ) ; return $ data ; }
Loads static-data for given URL. First from cache, if it doesnt exist,
try to fetch up-to date from web.

@param string        $url
@param callable|null $processing  (string $url, array $data)

@return array
@throws ArgumentException
Loads static - data for given URL . First from cache if it doesnt exist try to fetch up - to date from web .