简体   繁体   English

PHPLint-一些问题

[英]PHPLint - some problems

I am using PHP 5.3. 我正在使用PHP 5.3。 For syntax check, I am using a library which make some syntax check, called phplint 对于语法检查,我正在使用一个进行语法检查的库,称为phplint

This library, for my opinion, is quite old, but it does the work. 以我的观点,这个库已经很老了,但是确实可以。 It is not quite simple compiling via phplint. 通过phplint编译不是很简单。 I did lot of work and it is quite difficult learning a new one. 我做了很多工作,学习新的工作非常困难。

  1. How can I avoid semi-compile error message (just ignore some of the errors, ie another 3rd party tool, such as PHPMAILER , which I don't want to check it's syntax). 如何避免半编译错误消息(只需忽略一些错误,即另一个第三方工具,例如PHPMAILER ,我不想检查它的语法)。

  2. How can I add some classes to other library, but can still compile them (the class cannot find the path . /stdlib because the it's library not at the usual directory, and I should refer to library differently (maybe this is namespace, but I don't know much about namespaces. Any help will be appreciated. 如何将一些类添加到其他库中,但仍可以编译它们(该类找不到路径/stdlib因为该库不在通常目录中,因此我应该以不同的方式引用库(也许这是名称空间,但我对名称空间了解不多,我们将不胜感激。

  1. PHPLint already provides its own PhpMailer class, which is PHPLint-aware, that is it passes validation. PHPLint已经提供了自己的PhpMailer类,该类可识别PHPLint,即通过了验证。 In general, you can't use external tools that were not created with PHPLint in mind, so you must either rewrite them or switch to another tool. 通常,您不能使用并非由PHPLint创建的外部工具,因此您必须重写它们或切换到其他工具。

  2. The "stdlib" directory that comes along with PHPLint is only an example of source tree. PHPLint附带的“ stdlib”目录只是源树的一个示例。 All the sources threin either use autoloading or use require_once with relative path, so it should be easy to integrate that source tree in your source tree. 所有的源代码都可以使用自动加载功能,也可以使用带有相对路径的require_once,因此将源代码树轻松集成到源代码树中应该很容易。 You may then add your own namespace "a\\b\\c", but this namespace must match the subtree "ROOT/a/b/c" of the source tree and the autoload.php be present in the root directory "ROOT/autoload.php". 然后,您可以添加自己的命名空间“ a \\ b \\ c”,但是此命名空间必须与源树的子树“ ROOT / a / b / c”匹配, 并且 autoload.php出现在根目录“ ROOT / autoload”中.php”。

Hope this may help. 希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM