Merge branch '2.2' into 3.0-merge

This commit is contained in:
李铭昕 2022-08-27 15:36:15 +08:00
commit ff979a63c1
3 changed files with 23 additions and 2 deletions

View File

@ -1,4 +1,15 @@
# v2.2.35 - TBD
# v2.2.36 - TBD
# v2.2.35 - 2022-08-27
## Fixed
- [#5062](https://github.com/hyperf/hyperf/pull/5062) Fixed bug that cannot stop server by `Ctrl C`.
## Optimized
- [#5002](https://github.com/hyperf/hyperf/pull/5002) Optimized the generation rules of rpc proxy class suffix, which can be customized more easily.
- [#5005](https://github.com/hyperf/hyperf/pull/5005) Don't generate rpc proxy again when open `scan cacheable`.
# v2.2.34 - 2022-07-21

View File

@ -28,4 +28,9 @@ class CodeLoader
{
return Composer::getLoader()->findFile($className);
}
public function getMd5ByClassName(string $className): string
{
return md5($this->getCodeByClassName($className));
}
}

View File

@ -11,6 +11,7 @@ declare(strict_types=1);
*/
namespace Hyperf\RpcClient;
use Hyperf\Di\Annotation\ScanConfig;
use Hyperf\RpcClient\Proxy\Ast;
use Hyperf\RpcClient\Proxy\CodeLoader;
use Hyperf\Utils\Coroutine\Locker;
@ -45,7 +46,7 @@ class ProxyFactory
}
$proxyFileName = str_replace('\\', '_', $serviceClass);
$proxyClassName = $serviceClass . '_' . md5($this->codeLoader->getCodeByClassName($serviceClass));
$proxyClassName = $serviceClass . '_' . $this->codeLoader->getMd5ByClassName($serviceClass);
$path = $dir . $proxyFileName . '.rpc-client.proxy.php';
$key = md5($path);
@ -68,6 +69,10 @@ class ProxyFactory
return true;
}
if (ScanConfig::instance('')->isCacheable()) {
return false;
}
$time = $this->filesystem->lastModified(
$this->codeLoader->getPathByClassName($interface)
);