diff --git a/bin/mongo-proxy-darwin-arm64 b/bin/mongo-proxy-darwin-arm64 new file mode 100755 index 0000000..79e41ca Binary files /dev/null and b/bin/mongo-proxy-darwin-arm64 differ diff --git a/composer.json b/composer.json index 43d0228..648e784 100644 --- a/composer.json +++ b/composer.json @@ -37,7 +37,7 @@ "analyse": "phpstan analyse --memory-limit 300M -l 0 ./src", "cs-fix": "php-cs-fixer fix $1" }, - "bin": ["bin/mongo-proxy-darwin-amd64", "bin/mongo-proxy-linux-amd64"], + "bin": ["bin/mongo-proxy-darwin-amd64", "bin/mongo-proxy-darwin-arm64", "bin/mongo-proxy-linux-amd64"], "extra": { "hyperf": { "config": "Reasno\\Fastmongo\\ConfigProvider" diff --git a/src/DomainConfig.php b/src/DomainConfig.php index 715fc29..049bc11 100644 --- a/src/DomainConfig.php +++ b/src/DomainConfig.php @@ -29,7 +29,12 @@ public function __construct(ConfigInterface $config) public function getExecutable(): string { if ($this->isMac()) { - return BASE_PATH . '/vendor/bin/mongo-proxy-darwin-amd64'; + $cpuInfo = php_uname('m'); + if ($cpuInfo === 'arm64') { + return BASE_PATH . '/vendor/bin/mongo-proxy-darwin-arm64'; + } else { + return BASE_PATH . '/vendor/bin/mongo-proxy-darwin-amd64'; + } } return BASE_PATH . '/vendor/bin/mongo-proxy-linux-amd64'; }