Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added bin/mongo-proxy-darwin-arm64
Binary file not shown.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 6 additions & 1 deletion src/DomainConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down