改名
This commit is contained in:
@@ -11,15 +11,13 @@ declare(strict_types=1);
|
|||||||
namespace Database;
|
namespace Database;
|
||||||
|
|
||||||
|
|
||||||
use Annotation\Aspect;
|
|
||||||
use JetBrains\PhpStorm\Pure;
|
|
||||||
use ReflectionException;
|
|
||||||
use Snowflake\Abstracts\Component;
|
|
||||||
use Database\Mysql\Schema;
|
use Database\Mysql\Schema;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use JetBrains\PhpStorm\Pure;
|
||||||
use PDO;
|
use PDO;
|
||||||
|
use ReflectionException;
|
||||||
|
use Snowflake\Abstracts\Component;
|
||||||
use Snowflake\Event;
|
use Snowflake\Event;
|
||||||
use Snowflake\Exception\ComponentException;
|
|
||||||
use Snowflake\Exception\NotFindClassException;
|
use Snowflake\Exception\NotFindClassException;
|
||||||
use Snowflake\Snowflake;
|
use Snowflake\Snowflake;
|
||||||
|
|
||||||
@@ -155,10 +153,10 @@ class Connection extends Component
|
|||||||
#[Pure] public function isWrite($sql): bool
|
#[Pure] public function isWrite($sql): bool
|
||||||
{
|
{
|
||||||
if (empty($sql)) return false;
|
if (empty($sql)) return false;
|
||||||
|
if (str_starts_with(strtolower($sql), 'select')) {
|
||||||
$prefix = strtolower(mb_substr($sql, 0, 6));
|
return false;
|
||||||
|
}
|
||||||
return in_array($prefix, ['insert', 'update', 'delete']);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user