Данные через loadConfig, а не как глобальные переменные

This commit is contained in:
Фёдор Подлеснов 2016-07-18 16:23:55 +03:00
parent 486ba9f662
commit c13777d7e3
8 changed files with 21 additions and 26 deletions

View file

@ -1,8 +1,7 @@
<?php <?php
function loadConfig($filename) { function loadConfig($filename) {
if (file_exists($filename)) { if (@include($filename)) {
include($filename);
return $settings; return $settings;
} }
throw new Exception("config $filename not found"); throw new Exception("config $filename not found");

View file

@ -1,6 +1,6 @@
<?php <?php
$Areas = array $settings = array
( (
0 => '', 0 => '',
1 => 'Город Ярославль', 1 => 'Город Ярославль',

14
core/data/city-short.php Normal file
View file

@ -0,0 +1,14 @@
<?php
$settings = array(
0 => '',
1 => 'г.',
2 => 'с.',
3 => 'п.',
4 => 'д.',
5 => 'пгт.',
6 => 'р.п.',
7 => 'ст.',
8 => 'а.'
);

View file

@ -1,8 +1,7 @@
<?php <?php
global $TypeCity, $TypeCityShort;
// Массив типов поселений // Массив типов поселений
$TypeCity = array( $settings = array(
// 0 => '', // 0 => '',
1 => 'город', 1 => 'город',
2 => 'село', 2 => 'село',
@ -13,16 +12,3 @@ $TypeCity = array(
7 => 'станица', 7 => 'станица',
8 => 'аул' 8 => 'аул'
); );
$TypeCityShort = array(
0 => '',
1 => 'г.',
2 => 'с.',
3 => 'п.',
4 => 'д.',
5 => 'пгт.',
6 => 'р.п.',
7 => 'ст.',
8 => 'а.'
);

View file

@ -3,7 +3,7 @@
* http://www.w3schools.com/media/media_mimeref.asp * http://www.w3schools.com/media/media_mimeref.asp
*/ */
$_mime_type = array ( $settings = array (
"" => "application/octet-stream", "" => "application/octet-stream",
"323" => "text/h323", "323" => "text/h323",
"acx" => "application/internet-property-stream", "acx" => "application/internet-property-stream",

View file

@ -2,7 +2,7 @@
// В ОКАТО приняты следующие сокращения: // В ОКАТО приняты следующие сокращения:
// http://www.consultant.ru/online/base/?req=doc;base=LAW;n=62484 // http://www.consultant.ru/online/base/?req=doc;base=LAW;n=62484
$_okato = array ( $settings = array (
"р" => "район", "р" => "район",
"г" => "город", "г" => "город",
"пгт" => "поселок городского типа", "пгт" => "поселок городского типа",

View file

@ -1,7 +1,6 @@
<?php <?php
global $Regions; $settings = array (
$Regions = array (
0 => '', 0 => '',
2 => 'Алтайский край', 2 => 'Алтайский край',
3 => 'Амурская область', 3 => 'Амурская область',

View file

@ -1,6 +1,6 @@
<?php <?php
$_states = array ( $settings = array (
0 => array('title' => ''), 0 => array('title' => ''),
1 => array( 1 => array(
'title' => 'Центральный федеральный округ', 'title' => 'Центральный федеральный округ',
@ -30,6 +30,3 @@ $_states = array (
'title' => 'Приволжский федеральный округ', 'title' => 'Приволжский федеральный округ',
'short' => 'ПФО', 'short' => 'ПФО',
'regions' => array(23, 39, 43, 45, 46, 51, 56, 57, 60, 65, 66, 77, 78, 85))); 'regions' => array(23, 39, 43, 45, 46, 51, 56, 57, 60, 65, 66, 77, 78, 85)));
$States = &$_states;