Сбой CodeIgniter DataMapper

Я наследую старую сборку cms на CodeIgniter 2.0.2 с DataMapper ORM 1.8.0, а сайт с рекламой. Когда реклама была меньше нескольких тысяч, она работала нормально. Сейчас реклама приближается к 20 тысячам, и она просто вылетает. И там нет журнала ошибок. Проблема на главной странице, а иногда и на странице объявлений. Я не могу понять, почему. Мне пришлось отредактировать эту функцию, расположенную в «./application/libraries/datamapper.php», чтобы она не вылетала.

    /**
* Process Query
*
* Converts a query result into an array of objects.
* Also updates this object
*
* @ignore
* @param   CI_DB_result $query
*/
protected function _process_query($query)
{if ($query->num_rows() > 0)
{
// Populate all with records as objects
$this->all = array();

$this->_to_object($this, $query->row());

// don't bother recreating the first item.
$index = ($this->all_array_uses_ids && isset($this->id)) ? $this->id : 0;
$this->all[$index] = $this->get_clone();if($query->num_rows() > 1)
{
$model = get_class($this);

$first = TRUE;

foreach ($query->result() as $key =>$row)
{
if($first)
{
$first = FALSE;
continue;
}$item = new $model();

$this->_to_object($item, $row);

if($this->all_array_uses_ids && isset($item->id))
{
$this->all[$item->id] = $item;
}  //HERE IS THE EDIT
else  if($key < 12)
{
$this->all[] = $item;
}
}
}

// remove instantiations
$this->_instantiations = NULL;
// free large queries
if($query->num_rows() > $this->free_result_threshold)
{
$query->free_result();
}

}
else
{
// Refresh stored values is called by _to_object normally
$this->_refresh_stored_values();
}
}

В строке «ЗДЕСЬ РЕДАКТИРОВАТЬ» я добавляю, если ключ меньше 12, чтобы добавить его к $ this-> all. Если я поставлю больше 12, он вылетает.

Мой вопрос, как я могу преодолеть это? Кто-нибудь сталкивался с этим? На сервере я использую php 7 и т. Д. Это как современный сервер.

Я установил:
public $ free_result_threshold = 50;
public $ production_cache = FALSE; // Я включаю, но это не помогло

Любая идея будет полезна.

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …