Answer the question
In order to leave comments, you need to log in
Why, when enabled, in OpenServer, PHP version higher than 5.4 stops loading the add-on repository in Modx Revo?
Actually this is the question. I turned on version 5.5 and the add-on repository stopped loading.
Answer the question
In order to leave comments, you need to log in
\core\xpdo\xpdo.xpdo.class.php :2378 in the toJSON
method
replace this function with the code
public function toJSON($array) {
$encoded= '';
if ( is_array($array) ) {
if (!function_exists('json_encode')) {
if (@ include_once (XPDO_CORE_PATH . 'json/JSON.php')) {
$json = new Services_JSON();
$encoded= $json->encode($array);
}
} else {
$encoded= json_encode($array);
if (json_last_error() == JSON_ERROR_UTF8)
{ $array = self::arrayEncodeUTF8($array);
$encoded= json_encode($array); }
}
}
return $encoded;
}
public static function arrayEncodeUTF8($array)
{ foreach($array as $key => $value)
{ if (!is_array($value))
{ if (is_string($value))
{ json_encode($value);
if (json_last_error() == JSON_ERROR_UTF8)
{ $array[$key] = iconv('CP1251', 'UTF-8', $value); }
}
} else { $array[$key] = self::arrayEncodeUTF8($value); }
}
return $array;
}
A known problem when the repository does not work when working with Windows.
All cURL modules function at the same time, the firewall is not blocked.
I solved it by switching to Linux.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question