Moved redis-lua into redis.

This commit is contained in:
李铭昕 2019-11-17 16:39:19 +08:00
parent e49dc8fbd4
commit e0054311be
17 changed files with 21 additions and 140 deletions

View File

@ -169,7 +169,6 @@
"Hyperf\\Process\\": "src/process/src/",
"Hyperf\\Protocol\\": "src/protocol/src/",
"Hyperf\\RateLimit\\": "src/rate-limit/src/",
"Hyperf\\RedisLua\\": "src/redis-lua/src/",
"Hyperf\\Redis\\": "src/redis/src/",
"Hyperf\\RpcClient\\": "src/rpc-client/src/",
"Hyperf\\RpcServer\\": "src/rpc-server/src/",
@ -234,7 +233,6 @@
"HyperfTest\\Pool\\": "src/pool/tests/",
"HyperfTest\\Process\\": "src/process/tests/",
"HyperfTest\\Protocol\\": "src/protocol/tests/",
"HyperfTest\\RedisLua\\": "src/redis-lua/tests/",
"HyperfTest\\Redis\\": "src/redis/tests/",
"HyperfTest\\Rpc\\": "src/rpc/tests/",
"HyperfTest\\Server\\": "src/server/tests/",
@ -296,7 +294,6 @@
"Hyperf\\Process\\ConfigProvider",
"Hyperf\\Protocol\\ConfigProvider",
"Hyperf\\RateLimit\\ConfigProvider",
"Hyperf\\RedisLua\\ConfigProvider",
"Hyperf\\Redis\\ConfigProvider",
"Hyperf\\RpcClient\\ConfigProvider",
"Hyperf\\RpcServer\\ConfigProvider",

View File

@ -39,7 +39,6 @@
<directory suffix="Test.php">./src/pool/tests</directory>
<directory suffix="Test.php">./src/protocol/tests</directory>
<directory suffix="Test.php">./src/redis/tests</directory>
<directory suffix="Test.php">./src/redis-lua/tests</directory>
<directory suffix="Test.php">./src/rpc/tests</directory>
<directory suffix="Test.php">./src/server/tests</directory>
<directory suffix="Test.php">./src/service-governance/tests</directory>

View File

@ -1 +0,0 @@
/tests export-ignore

View File

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) Hyperf
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,55 +0,0 @@
{
"name": "hyperf/redis-lua",
"description": "A lua module for Redis.",
"license": "MIT",
"keywords": [
"php",
"swoole",
"hyperf",
"redis",
"lua"
],
"support": {
},
"require": {
"php": ">=7.2",
"hyperf/contract": "~1.1.0",
"hyperf/utils": "~1.1.0",
"psr/container": "^1.0"
},
"require-dev": {
"malukenho/docheader": "^0.1.6",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^7.0.0",
"friendsofphp/php-cs-fixer": "^2.9"
},
"suggest": {
},
"autoload": {
"psr-4": {
"Hyperf\\RedisLua\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"HyperfTest\\RedisLua\\": "tests/"
}
},
"config": {
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
},
"hyperf": {
"config": "Hyperf\\RedisLua\\ConfigProvider"
}
},
"bin": [
],
"scripts": {
"cs-fix": "php-cs-fixer fix $1",
"test": "phpunit --colors=always"
}
}

View File

@ -1,21 +0,0 @@
<?php
declare(strict_types=1);
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
* @document https://doc.hyperf.io
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace Hyperf\RedisLua;
class ConfigProvider
{
public function __invoke(): array
{
return [];
}
}

View File

@ -1,17 +0,0 @@
<?php
declare(strict_types=1);
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
* @document https://doc.hyperf.io
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace Hyperf\RedisLua\Exception;
class NoMatchingScriptException extends RuntimeException
{
}

View File

@ -10,7 +10,7 @@ declare(strict_types=1);
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace Hyperf\RedisLua\Exception;
namespace Hyperf\Redis\Exception;
class RedisNotFoundException extends \RuntimeException
{

View File

@ -10,9 +10,9 @@ declare(strict_types=1);
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace Hyperf\RedisLua\Hash;
namespace Hyperf\Redis\Lua\Hash;
use Hyperf\RedisLua\Script;
use Hyperf\Redis\Lua\Script;
class HGetAllMultiple extends Script
{

View File

@ -10,9 +10,9 @@ declare(strict_types=1);
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace Hyperf\RedisLua\Hash;
namespace Hyperf\Redis\Lua\Hash;
use Hyperf\RedisLua\Script;
use Hyperf\Redis\Lua\Script;
class HIncrByFloatIfExists extends Script
{

View File

@ -10,10 +10,10 @@ declare(strict_types=1);
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace Hyperf\RedisLua;
namespace Hyperf\Redis\Lua;
use Hyperf\Contract\StdoutLoggerInterface;
use Hyperf\RedisLua\Exception\RedisNotFoundException;
use Hyperf\Redis\Exception\RedisNotFoundException;
use Psr\Container\ContainerInterface;
abstract class Script implements ScriptInterface

View File

@ -10,7 +10,7 @@ declare(strict_types=1);
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace Hyperf\RedisLua;
namespace Hyperf\Redis\Lua;
interface ScriptInterface
{

View File

@ -10,12 +10,12 @@ declare(strict_types=1);
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace HyperfTest\RedisLua;
namespace HyperfTest\Redis\Lua;
use Hyperf\Contract\StdoutLoggerInterface;
use Hyperf\Utils\Str;
use HyperfTest\RedisLua\Stub\ContainerStub;
use HyperfTest\RedisLua\Stub\HGetAllMultipleStub;
use HyperfTest\Redis\Stub\ContainerStub;
use HyperfTest\Redis\Stub\HGetAllMultipleStub;
use Mockery;
use PHPUnit\Framework\TestCase;
@ -39,7 +39,7 @@ class EvalTest extends TestCase
$container = ContainerStub::mockContainer();
$logger = $container->get(StdoutLoggerInterface::class);
$logger->shouldReceive('warning')->once()->andReturnUsing(function ($message) {
$this->assertSame('NOSCRIPT No matching script[HyperfTest\\RedisLua\\Stub\\HGetAllMultipleStub]. Use EVAL instead.', $message);
$this->assertSame('NOSCRIPT No matching script[HyperfTest\\Redis\\Stub\\HGetAllMultipleStub]. Use EVAL instead.', $message);
});
$redis = $container->get(\Redis::class);

View File

@ -10,12 +10,12 @@ declare(strict_types=1);
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace HyperfTest\RedisLua;
namespace HyperfTest\Redis\Lua;
use Hyperf\RedisLua\Hash\HGetAllMultiple;
use Hyperf\RedisLua\Hash\HIncrByFloatIfExists;
use Hyperf\Redis\Lua\Hash\HGetAllMultiple;
use Hyperf\Redis\Lua\Hash\HIncrByFloatIfExists;
use Hyperf\Utils\Str;
use HyperfTest\RedisLua\Stub\ContainerStub;
use HyperfTest\Redis\Stub\ContainerStub;
use Mockery;
use PHPUnit\Framework\TestCase;

View File

@ -10,7 +10,7 @@ declare(strict_types=1);
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace HyperfTest\RedisLua\Stub;
namespace HyperfTest\Redis\Stub;
use Hyperf\Config\Config;
use Hyperf\Contract\ConfigInterface;

View File

@ -10,9 +10,9 @@ declare(strict_types=1);
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace HyperfTest\RedisLua\Stub;
namespace HyperfTest\Redis\Stub;
use Hyperf\RedisLua\Hash\HGetAllMultiple;
use Hyperf\Redis\Lua\Hash\HGetAllMultiple;
class HGetAllMultipleStub extends HGetAllMultiple
{

View File

@ -10,9 +10,9 @@ declare(strict_types=1);
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace HyperfTest\RedisLua\Stub;
namespace HyperfTest\Redis\Stub;
use Hyperf\RedisLua\Hash\HIncrByFloatIfExists;
use Hyperf\Redis\Lua\Hash\HIncrByFloatIfExists;
class HIncrByFloatIfExistsStub extends HIncrByFloatIfExists
{