diff --git a/src/ZM/Framework.php b/src/ZM/Framework.php index b8f1297f..66dc6612 100644 --- a/src/ZM/Framework.php +++ b/src/ZM/Framework.php @@ -44,7 +44,7 @@ class Framework public const VERSION_ID = 615; /** @var string 版本名称 */ - public const VERSION = '3.0.0-alpha2'; + public const VERSION = '3.0.0-alpha3'; /** @var array 传入的参数 */ protected $argv; @@ -253,6 +253,10 @@ class Framework { switch ($driver = ZMConfig::get('global.driver')) { case 'swoole': + if (DIRECTORY_SEPARATOR === '\\') { + logger()->emergency('Windows does not support swoole driver!'); + exit(1); + } ZMConfig::$config['global']['swoole_options']['driver_init_policy'] = DriverInitPolicy::MULTI_PROCESS_INIT_IN_MASTER; $this->driver = new SwooleDriver(ZMConfig::get('global.swoole_options')); $this->driver->initDriverProtocols(ZMConfig::get('global.servers')); diff --git a/src/ZM/Store/FileSystem.php b/src/ZM/Store/FileSystem.php index bedf3a66..9972aa51 100644 --- a/src/ZM/Store/FileSystem.php +++ b/src/ZM/Store/FileSystem.php @@ -52,7 +52,7 @@ class FileSystem } elseif (is_file($sub_file) || is_dir($sub_file) && !$recursive && $include_dir) { # 如果是 文件 或 (是 目录 且 不递推 且 包含目录) if (is_string($relative) && mb_strpos($sub_file, $relative) === 0) { - $list[] = ltrim(mb_substr($sub_file, mb_strlen($relative)), '/'); + $list[] = ltrim(mb_substr($sub_file, mb_strlen($relative)), '/\\'); } elseif ($relative === false) { $list[] = $sub_file; } diff --git a/src/ZM/Store/MySQL/MySQLConnection.php b/src/ZM/Store/MySQL/MySQLConnection.php index b522a7ec..9c8c2134 100644 --- a/src/ZM/Store/MySQL/MySQLConnection.php +++ b/src/ZM/Store/MySQL/MySQLConnection.php @@ -10,11 +10,10 @@ use Doctrine\DBAL\Driver\Connection; use Doctrine\DBAL\ParameterType; use PDO; use PDOException; -use Swoole\Database\PDOProxy; class MySQLConnection implements Connection { - /** @var PDO|PDOProxy */ + /** @var PDO */ private $conn; private $pool_name; diff --git a/zhamao-server.bat b/zhamao-server.bat new file mode 100644 index 00000000..a209c486 --- /dev/null +++ b/zhamao-server.bat @@ -0,0 +1,2 @@ +@echo off +php .\src\entry.php server --driver=workerman diff --git a/zhamao.bat b/zhamao.bat new file mode 100644 index 00000000..ad2bcd93 --- /dev/null +++ b/zhamao.bat @@ -0,0 +1,2 @@ +@echo off +php .\src\entry.php %*