Смотрим сюда:
public function getGeoZones($data = array()) {
if ($data) {
$sql = "SELECT * FROM " . DB_PREFIX . "geo_zone";
$sort_data = array(
'name',
'description'
);
if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
$sql .= " ORDER BY " . $data['sort'];
} else {
$sql .= " ORDER BY name";
}
if (isset($data['order']) && ($data['order'] == 'DESC')) {
$sql .= " DESC";
} else {
$sql .= " ASC";
}
if (isset($data['start']) || isset($data['limit'])) {
if ($data['start'] < 0) {
$data['start'] = 0;
}
if ($data['limit'] < 1) {
$data['limit'] = 20;
}
$sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];
}
$query = $this->db->query($sql);
return $query->rows;
} else {
$geo_zone_data = $this->cache->get('geo_zone');
if (!$geo_zone_data) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "geo_zone ORDER BY name ASC");
$geo_zone_data = $query->rows;
$this->cache->set('geo_zone', $geo_zone_data);
}
return $geo_zone_data;
}
}
потом сюда :
<?php
namespace Cache;
class File {
private $expire;
public function __construct($expire = 3600) {
$this->expire = $expire;
$files = glob(DIR_CACHE . 'cache.*');
if ($files) {
foreach ($files as $file) {
$time = substr(strrchr($file, '.'), 1);
if ($time < time()) {
if (file_exists($file)) {
unlink($file);
}
}
}
}
}
public function get($key) {
$files = glob(DIR_CACHE . 'cache.' . preg_replace('/[^A-Z0-9\._-]/i', '', $key) . '.*');
if ($files) {
$handle = fopen($files[0], 'r');
flock($handle, LOCK_SH);
$data = fread($handle, filesize($files[0]));
flock($handle, LOCK_UN);
fclose($handle);
return json_decode($data, true);
}
return false;
}
Ой, кто нас *** л в ракете.. Откуда JSON...
А теперь пробуем через это
https://github.com/opencart/opencart/blob/master/upload/system/helper/json.php
Пропустить массив с кирилицей.
Удивляемся.