
解决方案:
谷歌了一通,发现Yii2的核心开发人员之一,亚历山大,已经给出了解决方案,GITHub链接原理就是重新定义一个Yii类,然后利用PhpDoc,如:
/**
* Class BaseApplication
* Used for properties that are identical for both WebApplication and ConsoleApplication*
* @property \app\components\MyComponent $myComponent* @property \app\components\Mailer $mailer The mailer component. This property is read-only. Extended component.
*/
abstract class BaseApplication extends yii\base\Application{
}
有了@property定义后,PHPStorm就可以去对应的类里找到相应的方法,然后提示代码了。
开启步骤如下:1. 打开php.ini文件。
以ubuntu为例,这个文件在: /etc/php5/apache2 目录下为例。
2. 搜索并修改下行,把Off值改成On
display_errors = Off
3. 搜索下行
error_reporting = E_ALL &~E_NOTICE
或者搜索:
error_reporting = E_ALL &~E_DEPRECATED
修改为
error_reporting = E_ALL | E_STRICT
4. 修改Apache的 httpd.conf,
以Ubuntu 为例, 这个文件在:/etc/apache2/ 目录下,这是一个空白文件。
添加以下两行:
php_flag display_errors on
php_value error_reporting 2039
5. 重启Apache,就OK了。
重启命令: :sudo /etc/init.d/apache2 restart.
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)