swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 786 forks source link

运行文件生成命令报错 #294

Closed yunxi177 closed 6 years ago

yunxi177 commented 6 years ago
Q A
Bug report? yes
Swoft version 1.0
PHP version 7.1.13 (by php -v)
Runtime environment Win10

Details

运行文件生成命令 php .\bin\swoft gen rpcService demo 报错,调试代码发现config/define.php并没有返回数组而代码运行到/swoft/framework/src/Core/Config.php


$loadedConfig = require $file;//当引用define.php的时候返回值为1
        if (!\is_array($loadedConfig)) {
            throw new \InvalidArgumentException('Syntax error find in config file: ' . $file);
        }

```php
PHP Fatal error:  Uncaught InvalidArgumentException: Syntax error find in config file: D:\docker\demo/config/define.php in D:\docker\demo\vendor\swoft\framework\src\Core\Config.php:238
huangzhhui commented 6 years ago

错误显示语法错误,请确认你修改后的 config/define.php 是否是正确的语法格式