Subversion Repositories oidplus

Rev

Rev 261 | Rev 557 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 261 Rev 511
1
#!/usr/bin/php
1
#!/usr/bin/php
2
-- This file (wellknown_other_pgsql.sql) contains ASN.1 and IRI names of OIDs which are either
2
-- This file (wellknown_other_pgsql.sql) contains ASN.1 and IRI names of OIDs which are either
3
-- a) Root OIDs
3
-- a) Root OIDs
4
-- b) Unicode labels which are long arcs
4
-- b) Unicode labels which are long arcs
5
-- c) Standardized ASN.1 identifiers
5
-- c) Standardized ASN.1 identifiers
6
-- d) OIDs where potential users of this software can register OIDs in these arcs (e.g. an "identified organization" arc)
6
-- d) OIDs where potential users of this software can register OIDs in these arcs (e.g. an "identified organization" arc)
7
-- Use the tool dev/generate_wellknown_other_pgsql to generate this file
7
-- Use the tool dev/generate_wellknown_other_pgsql to generate this file
8
 
8
 
9
<?php
9
<?php
10
 
10
 
-
 
11
/*
-
 
12
 * OIDplus 2.0
-
 
13
 * Copyright 2019 - 2021 Daniel Marschall, ViaThinkSoft
-
 
14
 *
-
 
15
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
16
 * you may not use this file except in compliance with the License.
-
 
17
 * You may obtain a copy of the License at
-
 
18
 *
-
 
19
 *     http://www.apache.org/licenses/LICENSE-2.0
-
 
20
 *
-
 
21
 * Unless required by applicable law or agreed to in writing, software
-
 
22
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
23
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
24
 * See the License for the specific language governing permissions and
-
 
25
 * limitations under the License.
-
 
26
 */
-
 
27
 
11
require_once __DIR__ . '/../includes/oidplus.inc.php';
28
require_once __DIR__ . '/../includes/oidplus.inc.php';
12
 
29
 
13
OIDplus::init(false);
30
OIDplus::init(false);
14
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
31
if (!OIDplus::baseConfig()->exists('OIDINFO_API_URL')) {
15
	die("OIDINFO_API_URL not available (API is currently not public)\n");
32
	die("OIDINFO_API_URL not available (API is currently not public)\n");
16
}
33
}
17
 
34
 
18
$output = array();
35
$output = array();
19
 
36
 
20
function _is_standardized($oid, $asn1id) {
37
function _is_standardized($oid, $asn1id) {
21
	$std = asn1_get_standardized_array();
38
	$std = asn1_get_standardized_array();
22
	$x = oid_up($oid) == $oid ? '' : oid_up($oid).".";
39
	$x = oid_up($oid) == $oid ? '' : oid_up($oid).".";
23
	return isset( $std[$x.$asn1id]) && ($std[$x.$asn1id] == $oid);
40
	return isset( $std[$x.$asn1id]) && ($std[$x.$asn1id] == $oid);
24
}
41
}
25
 
42
 
26
function _is_long($oid) {
43
function _is_long($oid) {
27
	$oid = '/'.str_replace('.', '/', $oid);
44
	$oid = '/'.str_replace('.', '/', $oid);
28
	return in_array($oid, iri_get_long_arcs());
45
	return in_array($oid, iri_get_long_arcs());
29
}
46
}
30
 
47
 
31
function _process_oid($oid) {
48
function _process_oid($oid) {
32
	global $output;
49
	global $output;
33
 
50
 
34
	if (!isset($output[$oid])) {
51
	if (!isset($output[$oid])) {
35
		if ($oid == '0.0.23') {
52
		if ($oid == '0.0.23') {
36
			// Rec. ITU-T X.660 | ISO/IEC 9834-3, clause A.3.3.1 allows "0.0.w", although it is illegal, since no W-series exist
53
			// Rec. ITU-T X.660 | ISO/IEC 9834-3, clause A.3.3.1 allows "0.0.w", although it is illegal, since no W-series exist
37
			$data = array();
54
			$data = array();
38
			$data['oid'] = array();
55
			$data['oid'] = array();
39
			$data['oid']['identifier'] = array('w');
56
			$data['oid']['identifier'] = array('w');
40
			$data['oid']['unicode-label'] = array('W');
57
			$data['oid']['unicode-label'] = array('W');
41
		} else {
58
		} else {
42
			$data = ft_get_oid_data($oid);
59
			$data = ft_get_oid_data($oid);
43
		}
60
		}
44
 
61
 
45
                $output[$oid] = array();
62
                $output[$oid] = array();
46
		$output[$oid]['asn1id'] = array();
63
		$output[$oid]['asn1id'] = array();
47
		$output[$oid]['iri'] = array();
64
		$output[$oid]['iri'] = array();
48
		$output[$oid]['checksum'] = array();
65
		$output[$oid]['checksum'] = array();
49
 
66
 
50
		if (isset($data['oid']['identifier'])) {
67
		if (isset($data['oid']['identifier'])) {
51
			foreach ($data['oid']['identifier'] as $asn1id) {
68
			foreach ($data['oid']['identifier'] as $asn1id) {
52
				$output[$oid]['checksum'][] = $oid.'|ASN1|'.$asn1id.'|'.(_is_standardized($oid, $asn1id) ? '1' : '0').'|1||';
69
				$output[$oid]['checksum'][] = $oid.'|ASN1|'.$asn1id.'|'.(_is_standardized($oid, $asn1id) ? '1' : '0').'|1||';
53
				$std = _is_standardized($oid, $asn1id) ? "true" : "false";
70
				$std = _is_standardized($oid, $asn1id) ? "true" : "false";
54
				$output[$oid]['asn1id'][] = "INSERT INTO \"asn1id\" (oid, name, standardized, well_known) VALUES ('oid:$oid', '$asn1id', $std, true);";
71
				$output[$oid]['asn1id'][] = "INSERT INTO \"asn1id\" (oid, name, standardized, well_known) VALUES ('oid:$oid', '$asn1id', $std, true);";
55
			}
72
			}
56
		} else {
73
		} else {
57
			//echo "-- Warning: Has no ASN.1 identifier: $oid\n";
74
			//echo "-- Warning: Has no ASN.1 identifier: $oid\n";
58
		}
75
		}
59
		if (isset($data['oid']['unicode-label'])) {
76
		if (isset($data['oid']['unicode-label'])) {
60
			foreach ($data['oid']['unicode-label'] as $iri) {
77
			foreach ($data['oid']['unicode-label'] as $iri) {
61
				$output[$oid]['checksum'][] = $oid.'|IRI|'.$iri.'|'.(_is_long($oid) ? '1' : '0').'|1||';
78
				$output[$oid]['checksum'][] = $oid.'|IRI|'.$iri.'|'.(_is_long($oid) ? '1' : '0').'|1||';
62
 
79
 
63
				$std = _is_long($oid) ? "true" : "false";
80
				$std = _is_long($oid) ? "true" : "false";
64
 
81
 
65
				if (strpos($iri, '&#') !== false) {
82
				if (strpos($iri, '&#') !== false) {
66
					$iri = "convert_from(decode('".base64_encode(html_entity_decode($iri, ENT_COMPAT | ENT_HTML401, "UTF-8"))."', 'base64'), 'utf-8')";
83
					$iri = "convert_from(decode('".base64_encode(html_entity_decode($iri, ENT_COMPAT | ENT_HTML401, "UTF-8"))."', 'base64'), 'utf-8')";
67
				} else {
84
				} else {
68
					$iri = "'$iri'";
85
					$iri = "'$iri'";
69
				}
86
				}
70
 
87
 
71
				$output[$oid]['iri'][] = "INSERT INTO \"iri\" (oid, name, longarc, well_known) VALUES ('oid:$oid', $iri, $std, true);";
88
				$output[$oid]['iri'][] = "INSERT INTO \"iri\" (oid, name, longarc, well_known) VALUES ('oid:$oid', $iri, $std, true);";
72
			}
89
			}
73
		}
90
		}
74
	}
91
	}
75
 
92
 
76
	return $output[$oid];
93
	return $output[$oid];
77
}
94
}
78
 
95
 
79
// ---
96
// ---
80
 
97
 
81
$interesting_oids = array();
98
$interesting_oids = array();
82
 
99
 
83
foreach (asn1_get_standardized_array() as $tmp => $oid) {
100
foreach (asn1_get_standardized_array() as $tmp => $oid) {
84
	$interesting_oids[] = $oid;
101
	$interesting_oids[] = $oid;
85
}
102
}
86
 
103
 
87
foreach (iri_get_long_arcs() as $tmp => $oid) {
104
foreach (iri_get_long_arcs() as $tmp => $oid) {
88
	$oid = substr(str_replace('/', '.', $oid),1);
105
	$oid = substr(str_replace('/', '.', $oid),1);
89
	$interesting_oids[] = $oid;
106
	$interesting_oids[] = $oid;
90
}
107
}
91
 
108
 
92
// ----------------------------------------------------------------
109
// ----------------------------------------------------------------
93
 
110
 
94
$interesting_oids[] = '0'; // itu-t
111
$interesting_oids[] = '0'; // itu-t
95
	$interesting_oids[] = '0.2'; // telecom operators
112
	$interesting_oids[] = '0.2'; // telecom operators
96
	$interesting_oids[] = '0.3'; // network-operator
113
	$interesting_oids[] = '0.3'; // network-operator
97
	$interesting_oids[] = '0.4'; // identified-organization
114
	$interesting_oids[] = '0.4'; // identified-organization
98
		$interesting_oids[] = '0.4.0'; // etsi
115
		$interesting_oids[] = '0.4.0'; // etsi
99
			$interesting_oids[] = '0.4.0.127'; // reserved
116
			$interesting_oids[] = '0.4.0.127'; // reserved
100
				$interesting_oids[] = '0.4.0.127.0'; // etsi-identified-organization
117
				$interesting_oids[] = '0.4.0.127.0'; // etsi-identified-organization
101
$interesting_oids[] = '1'; // iso
118
$interesting_oids[] = '1'; // iso
102
	$interesting_oids[] = '1.1'; // registration-authority
119
	$interesting_oids[] = '1.1'; // registration-authority
103
		$interesting_oids[] = '1.1.19785'; // cbeff
120
		$interesting_oids[] = '1.1.19785'; // cbeff
104
			$interesting_oids[] = '1.1.19785.0'; // organization
121
			$interesting_oids[] = '1.1.19785.0'; // organization
105
	$interesting_oids[] = '1.2'; // member-body
122
	$interesting_oids[] = '1.2'; // member-body
106
		// country_getter defines the country OIDs
123
		// country_getter defines the country OIDs
107
		//$interesting_oids[] = '1.2.158'; // tw
124
		//$interesting_oids[] = '1.2.158'; // tw
108
			$interesting_oids[] = '1.2.158.1'; // organization
125
			$interesting_oids[] = '1.2.158.1'; // organization
109
		//$interesting_oids[] = '1.2.276'; // de
126
		//$interesting_oids[] = '1.2.276'; // de
110
			$interesting_oids[] = '1.2.276.0'; // din-certco
127
			$interesting_oids[] = '1.2.276.0'; // din-certco
111
		//$interesting_oids[] = '1.2.344'; // hk
128
		//$interesting_oids[] = '1.2.344'; // hk
112
			$interesting_oids[] = '1.2.344.1'; // organization
129
			$interesting_oids[] = '1.2.344.1'; // organization
113
		//$interesting_oids[] = '1.2.616'; // pl
130
		//$interesting_oids[] = '1.2.616'; // pl
114
			$interesting_oids[] = '1.2.616.1'; // organization
131
			$interesting_oids[] = '1.2.616.1'; // organization
115
		//$interesting_oids[] = '1.2.826'; // gb
132
		//$interesting_oids[] = '1.2.826'; // gb
116
			$interesting_oids[] = '1.2.826.0'; // national
133
			$interesting_oids[] = '1.2.826.0'; // national
117
				$interesting_oids[] = '1.2.826.0.1'; // eng-ltd
134
				$interesting_oids[] = '1.2.826.0.1'; // eng-ltd
118
					$interesting_oids[] = '1.2.826.0.1.3680043'; // Medical Connections ( https://www.medicalconnections.co.uk/FreeUID/ )
135
					$interesting_oids[] = '1.2.826.0.1.3680043'; // Medical Connections ( https://www.medicalconnections.co.uk/FreeUID/ )
119
		//$interesting_oids[] = '1.2.840'; // us
136
		//$interesting_oids[] = '1.2.840'; // us
120
			$interesting_oids[] = '1.2.840.1'; // organization
137
			$interesting_oids[] = '1.2.840.1'; // organization
121
				$interesting_oids[] = '1.2.840.113556'; // microsoft
138
				$interesting_oids[] = '1.2.840.113556'; // microsoft
122
					$interesting_oids[] = '1.2.840.113556.1'; // Microsoft Active Directory
139
					$interesting_oids[] = '1.2.840.113556.1'; // Microsoft Active Directory
123
						$interesting_oids[] = '1.2.840.113556.1.8000'; // companies
140
						$interesting_oids[] = '1.2.840.113556.1.8000'; // companies
124
							$interesting_oids[] = '1.2.840.113556.1.8000.2554'; // customer usage
141
							$interesting_oids[] = '1.2.840.113556.1.8000.2554'; // customer usage
125
					$interesting_oids[] = '1.2.840.113556.2'; // DICOM
142
					$interesting_oids[] = '1.2.840.113556.2'; // DICOM
126
	$interesting_oids[] = '1.3'; // identified-organization
143
	$interesting_oids[] = '1.3'; // identified-organization
127
		$interesting_oids[] = '1.3.6'; // dod
144
		$interesting_oids[] = '1.3.6'; // dod
128
			$interesting_oids[] = '1.3.6.1'; // internet
145
			$interesting_oids[] = '1.3.6.1'; // internet
129
				$interesting_oids[] = '1.3.6.1.2'; // mgmt
146
				$interesting_oids[] = '1.3.6.1.2'; // mgmt
130
					$interesting_oids[] = '1.3.6.1.2.1'; // mib-2
147
					$interesting_oids[] = '1.3.6.1.2.1'; // mib-2
131
						$interesting_oids[] = '1.3.6.1.4'; // private
148
						$interesting_oids[] = '1.3.6.1.4'; // private
132
							$interesting_oids[] = '1.3.6.1.4.1'; // enterprise
149
							$interesting_oids[] = '1.3.6.1.4.1'; // enterprise
133
								$interesting_oids[] = '1.3.6.1.4.1.19376'; // Integrating the Healthcare Enterprise International
150
								$interesting_oids[] = '1.3.6.1.4.1.19376'; // Integrating the Healthcare Enterprise International
134
									$interesting_oids[] = '1.3.6.1.4.1.19376.3'; // Organizations (not in Repo!)
151
									$interesting_oids[] = '1.3.6.1.4.1.19376.3'; // Organizations (not in Repo!)
135
									$interesting_oids[] = '1.3.6.1.4.1.19376.3.276'; // IHE Deutschland
152
									$interesting_oids[] = '1.3.6.1.4.1.19376.3.276'; // IHE Deutschland
136
										$interesting_oids[] = '1.3.6.1.4.1.19376.3.276.1'; // OID für das OID Konzept Version 1
153
										$interesting_oids[] = '1.3.6.1.4.1.19376.3.276.1'; // OID für das OID Konzept Version 1
137
											$interesting_oids[] = '1.3.6.1.4.1.19376.3.276.1.4'; // Identifikation des ID-Pools für Institutionen (Organisationen, Einheiten, etc.)
154
											$interesting_oids[] = '1.3.6.1.4.1.19376.3.276.1.4'; // Identifikation des ID-Pools für Institutionen (Organisationen, Einheiten, etc.)
138
													$interesting_oids[] = '1.3.6.1.4.1.19376.3.276.1.4.1'; // Krankenhäuser
155
													$interesting_oids[] = '1.3.6.1.4.1.19376.3.276.1.4.1'; // Krankenhäuser
139
													$interesting_oids[] = '1.3.6.1.4.1.19376.3.276.1.4.2'; // Praxen niedergelassener Ärzte
156
													$interesting_oids[] = '1.3.6.1.4.1.19376.3.276.1.4.2'; // Praxen niedergelassener Ärzte
140
													$interesting_oids[] = '1.3.6.1.4.1.19376.3.276.1.4.3'; // Systeme
157
													$interesting_oids[] = '1.3.6.1.4.1.19376.3.276.1.4.3'; // Systeme
141
								$interesting_oids[] = '1.3.6.1.4.1.12798'; // Members of Internet-Käyttäjät Ikuisesti (IKI)
158
								$interesting_oids[] = '1.3.6.1.4.1.12798'; // Members of Internet-Käyttäjät Ikuisesti (IKI)
142
									$interesting_oids[] = '1.3.6.1.4.1.12798.1'; // member
159
									$interesting_oids[] = '1.3.6.1.4.1.12798.1'; // member
143
								$interesting_oids[] = '1.3.6.1.4.1.37476'; // ViaThinkSoft
160
								$interesting_oids[] = '1.3.6.1.4.1.37476'; // ViaThinkSoft
144
									$interesting_oids[] = '1.3.6.1.4.1.37476.9000'; // freeoid
161
									$interesting_oids[] = '1.3.6.1.4.1.37476.9000'; // freeoid
145
								$interesting_oids[] = '1.3.6.1.4.1.37553'; // frdlweb
162
								$interesting_oids[] = '1.3.6.1.4.1.37553'; // frdlweb
146
									$interesting_oids[] = '1.3.6.1.4.1.37553.8'; // WEID
163
									$interesting_oids[] = '1.3.6.1.4.1.37553.8'; // WEID
147
										$interesting_oids[] = '1.3.6.1.4.1.37553.8.8'; // private
164
										$interesting_oids[] = '1.3.6.1.4.1.37553.8.8'; // private
148
										$interesting_oids[] = '1.3.6.1.4.1.37553.8.9'; // ns
165
										$interesting_oids[] = '1.3.6.1.4.1.37553.8.9'; // ns
149
											$interesting_oids[] = '1.3.6.1.4.1.37553.8.9.17704'; // dns
166
											$interesting_oids[] = '1.3.6.1.4.1.37553.8.9.17704'; // dns
150
											$interesting_oids[] = '1.3.6.1.4.1.37553.8.9.1439221'; // uuid
167
											$interesting_oids[] = '1.3.6.1.4.1.37553.8.9.1439221'; // uuid
151
$interesting_oids[] = '2'; // joint-iso-itu-t
168
$interesting_oids[] = '2'; // joint-iso-itu-t
152
	$interesting_oids[] = '2.16'; // country
169
	$interesting_oids[] = '2.16'; // country
153
		// country_getter defines the country OIDs
170
		// country_getter defines the country OIDs
154
		//$interesting_oids[] = '2.16.158'; // tw
171
		//$interesting_oids[] = '2.16.158'; // tw
155
			$interesting_oids[] = '2.16.158.1'; // organization
172
			$interesting_oids[] = '2.16.158.1'; // organization
156
		//$interesting_oids[] = '2.16.344'; // hk
173
		//$interesting_oids[] = '2.16.344'; // hk
157
			$interesting_oids[] = '2.16.344.1'; // organization
174
			$interesting_oids[] = '2.16.344.1'; // organization
158
		//$interesting_oids[] = '2.16.616'; // pl
175
		//$interesting_oids[] = '2.16.616'; // pl
159
			$interesting_oids[] = '2.16.616.1'; // organization
176
			$interesting_oids[] = '2.16.616.1'; // organization
160
		//$interesting_oids[] = '2.16.840'; // us
177
		//$interesting_oids[] = '2.16.840'; // us
161
			$interesting_oids[] = '2.16.840.1'; // organization
178
			$interesting_oids[] = '2.16.840.1'; // organization
162
				$interesting_oids[] = '2.16.840.1.113883'; // hl7
179
				$interesting_oids[] = '2.16.840.1.113883'; // hl7
163
					$interesting_oids[] = '2.16.840.1.113883.3'; // externalUseRoots
180
					$interesting_oids[] = '2.16.840.1.113883.3'; // externalUseRoots
164
					$interesting_oids[] = '2.16.840.1.113883.6'; // externalCodeSystems
181
					$interesting_oids[] = '2.16.840.1.113883.6'; // externalCodeSystems
165
					$interesting_oids[] = '2.16.840.1.113883.13'; // externalValueSets
182
					$interesting_oids[] = '2.16.840.1.113883.13'; // externalValueSets
166
	$interesting_oids[] = '2.23'; // international-organizations
183
	$interesting_oids[] = '2.23'; // international-organizations
167
	$interesting_oids[] = '2.25'; // uuid
184
	$interesting_oids[] = '2.25'; // uuid
168
	$interesting_oids[] = '2.40'; // upu
185
	$interesting_oids[] = '2.40'; // upu
169
		$interesting_oids[] = '2.40.2'; // member-body
186
		$interesting_oids[] = '2.40.2'; // member-body
170
		$interesting_oids[] = '2.40.3'; // identified-organization
187
		$interesting_oids[] = '2.40.3'; // identified-organization
171
	$interesting_oids[] = '2.49'; // alerting
188
	$interesting_oids[] = '2.49'; // alerting
172
		$interesting_oids[] = '2.49.0'; // wmo
189
		$interesting_oids[] = '2.49.0'; // wmo
173
			$interesting_oids[] = '2.49.0.0'; // authority (Countries)
190
			$interesting_oids[] = '2.49.0.0'; // authority (Countries)
174
				// country_getter defines the country OIDs beneath 2.49.0.0
191
				// country_getter defines the country OIDs beneath 2.49.0.0
175
			$interesting_oids[] = '2.49.0.1'; // country-msg
192
			$interesting_oids[] = '2.49.0.1'; // country-msg
176
				// country_getter defines the country OIDs beneath 2.49.0.1
193
				// country_getter defines the country OIDs beneath 2.49.0.1
177
			$interesting_oids[] = '2.49.0.2'; // org
194
			$interesting_oids[] = '2.49.0.2'; // org
178
			$interesting_oids[] = '2.49.0.3'; // org-msg
195
			$interesting_oids[] = '2.49.0.3'; // org-msg
179
 
196
 
180
// ----------------------------------------------------------------
197
// ----------------------------------------------------------------
181
 
198
 
182
$interesting_oids = array_unique($interesting_oids);
199
$interesting_oids = array_unique($interesting_oids);
183
natsort($interesting_oids);
200
natsort($interesting_oids);
184
 
201
 
185
$output = array();
202
$output = array();
186
foreach ($interesting_oids as $oid) {
203
foreach ($interesting_oids as $oid) {
187
	_process_oid($oid);
204
	_process_oid($oid);
188
}
205
}
189
 
206
 
190
$check_sum = '';
207
$check_sum = '';
191
foreach ($output as $oid => $data) {
208
foreach ($output as $oid => $data) {
192
	if (count($data['asn1id']) + count($data['iri']) == 0) continue;
209
	if (count($data['asn1id']) + count($data['iri']) == 0) continue;
193
 
210
 
194
	echo "-- $oid\n";
211
	echo "-- $oid\n";
195
	foreach ($data['asn1id'] as $line_asn1) {
212
	foreach ($data['asn1id'] as $line_asn1) {
196
		echo "$line_asn1\n";
213
		echo "$line_asn1\n";
197
	}
214
	}
198
	foreach ($data['iri'] as $line_iri) {
215
	foreach ($data['iri'] as $line_iri) {
199
		echo "$line_iri\n";
216
		echo "$line_iri\n";
200
	}
217
	}
201
	foreach ($data['checksum'] as $chunk) {
218
	foreach ($data['checksum'] as $chunk) {
202
		$check_sum .= $chunk;
219
		$check_sum .= $chunk;
203
	}
220
	}
204
	echo "\n";
221
	echo "\n";
205
}
222
}
206
echo '-- Generator "generate_wellknown_other_pgsql" checksum '.dechex(crc32($check_sum))."\n";
223
echo '-- Generator "generate_wellknown_other_pgsql" checksum '.dechex(crc32($check_sum))."\n";
207
 
224
 
208
# ---
225
# ---
209
 
226
 
210
function ft_get_oid_data($oid) {
227
function ft_get_oid_data($oid) {
211
	$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
228
	$url = OIDplus::baseConfig()->getValue('OIDINFO_API_URL') . '&oid='.urlencode($oid);
212
	$cont_json = @file_get_contents($url);
229
	$cont_json = @file_get_contents($url);
213
	if (!$cont_json) {
230
	if (!$cont_json) {
214
		sleep(5);
231
		sleep(5);
215
                $cont_json = @file_get_contents($url);
232
                $cont_json = @file_get_contents($url);
216
                if (!$cont_json) return false;
233
                if (!$cont_json) return false;
217
	}
234
	}
218
	$data = json_decode($cont_json,true);
235
	$data = json_decode($cont_json,true);
219
 
236
 
220
	return $data;
237
	return $data;
221
}
238
}