Commit 5d7f10d5 authored by chentianyu's avatar chentianyu
Browse files

Merge remote-tracking branch 'origin/v2.2.33-branch' into 2.2

parents 5a6750fe b1eb5c08
Loading
Loading
Loading
Loading
+12 −12
Original line number Original line Diff line number Diff line
@@ -15,21 +15,21 @@
    "ext-gd": "*",
    "ext-gd": "*",
    "ext-curl": "*",
    "ext-curl": "*",
    "ext-mbstring": "*",
    "ext-mbstring": "*",
    "hyperf/cache": "~2.1.0",
    "hyperf/cache": "~2.1.0|~2.2.0",
    "hyperf/framework": "~2.1.0",
    "hyperf/framework": "~2.1.0|~2.2.0",
    "hyperf/db-connection": "~2.1.0",
    "hyperf/db-connection": "~2.1.0|~2.2.0",
    "hyperf/validation": "~2.1.0",
    "hyperf/validation": "~2.1.0|~2.2.0",
    "hyperf/command": "~2.1.0",
    "hyperf/command": "~2.1.0|~2.2.0",
    "hyperf/redis": "~2.1.0",
    "hyperf/redis": "~2.1.0|~2.2.0",
    "hyperf/guzzle": "~2.1.0",
    "hyperf/guzzle": "~2.1.0|~2.2.0",
    "hyperf/config": "~2.1.0",
    "hyperf/config": "~2.1.0|~2.2.0",
    "hyperf/logger": "~2.1.0",
    "hyperf/logger": "~2.1.0|~2.2.0",
    "hyperf/service-governance": "~2.1.0",
    "hyperf/service-governance": "~2.1.0|~2.2.0",
    "fzaninotto/faker": "^1.9",
    "fzaninotto/faker": "^1.9",
    "phpoffice/phpspreadsheet": "^1.18",
    "phpoffice/phpspreadsheet": "^1.18",
    "dimsav/unix-zipper": "1.*",
    "dimsav/unix-zipper": "1.*",
    "hyperf/amqp": "~2.1.0",
    "hyperf/amqp": "~2.1.0|~2.2.0",
    "hyperf/paginator": "~2.1.0"
    "hyperf/paginator": "~2.1.0|~2.2.0"
  },
  },
  "autoload": {
  "autoload": {
    "psr-4": {
    "psr-4": {
+19 −1
Original line number Original line Diff line number Diff line
@@ -30,7 +30,7 @@ class RegisterServiceListener extends BaseRegisterServiceListener
             */
             */
            $host = isset($server['local_ip']) ? $server['local_ip'] : $server['host'];
            $host = isset($server['local_ip']) ? $server['local_ip'] : $server['host'];
            if (in_array($host, ['0.0.0.0', 'localhost'])) {
            if (in_array($host, ['0.0.0.0', 'localhost'])) {
                $host = $this->getInternalIp();
                $host = $this->getRealInternalIp();
            }
            }
            if (!filter_var($host, FILTER_VALIDATE_IP)) {
            if (!filter_var($host, FILTER_VALIDATE_IP)) {
                throw new \InvalidArgumentException(sprintf('Invalid host %s', $host));
                throw new \InvalidArgumentException(sprintf('Invalid host %s', $host));
@@ -45,4 +45,22 @@ class RegisterServiceListener extends BaseRegisterServiceListener
        return $result;
        return $result;
    }
    }



    protected function getRealInternalIp()
    {
        if (method_exists(self::class, 'getInternalIp')) {
            return $this->getInternalIp();
        }

        $ips = swoole_get_local_ip();
        if (is_array($ips) && ! empty($ips)) {
            return current($ips);
        }
        /** @var mixed|string $ip */
        $ip = gethostbyname(gethostname());
        if (is_string($ip)) {
            return $ip;
        }
        throw new \RuntimeException('Can not get the internal IP.');
    }
}
}
 No newline at end of file
+2 −1
Original line number Original line Diff line number Diff line
@@ -132,8 +132,9 @@ class Drawer
    {
    {
        $originUrl = $url;
        $originUrl = $url;
        //如果shopify 去掉版本号
        //如果shopify 去掉版本号
        if (strpos($url, 'shopify') !== false) {
        if (strpos($url, 'shopify') !== false && strpos($url, '?v=') !== false) {
            $url = substr($url, 0, strpos($url, '?v='));
            $url = substr($url, 0, strpos($url, '?v='));
            var_dump($url);
        }
        }
        $savePath = $this->rootPath . '/download/images/' . ($path ? $path . '/' : $this->savePath);
        $savePath = $this->rootPath . '/download/images/' . ($path ? $path . '/' : $this->savePath);
        create_file_dir($savePath);
        create_file_dir($savePath);