V
V
Vladislav Bondarenko2017-03-09 12:37:49
PHP
Vladislav Bondarenko, 2017-03-09 12:37:49

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

3 answer(s)
S
Sergey, 2017-03-10
@bvlad5

\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;
    }

Z
zooks, 2017-03-09
@zooks

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.

S
Sanes, 2017-03-09
@Sanes

Check for curl for php 5.5

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question