mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-21 08:12:26 +02:00
👌 peer review
mostly coding convention, thanks @molkobain
This commit is contained in:
@@ -43,11 +43,11 @@ function TestConfig($sContents, $oP)
|
||||
{
|
||||
/// 1- first check if there is no malicious code
|
||||
$oiTopConfigValidator = new iTopConfigAstValidator();
|
||||
$oiTopConfigValidator->validate($sContents);
|
||||
$oiTopConfigValidator->Validate($sContents);
|
||||
|
||||
/// 2 - only after we are sure that there is no malicious cade, we can perform a syntax check!
|
||||
$oiTopConfigValidator = new iTopConfigSyntaxValidator();
|
||||
$oiTopConfigValidator->validate($sContents, true);
|
||||
$oiTopConfigValidator->Validate($sContents, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ class iTopConfigAstValidator
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function validate($sConfig)
|
||||
public function Validate($sConfig)
|
||||
{
|
||||
$oParser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7);
|
||||
|
||||
|
||||
@@ -7,12 +7,6 @@
|
||||
|
||||
namespace Combodo\iTop\Config\Validator;
|
||||
|
||||
|
||||
use PhpParser\NodeTraverser;
|
||||
use PhpParser\NodeVisitor;
|
||||
use PhpParser\Parser;
|
||||
use PhpParser\ParserFactory;
|
||||
|
||||
class iTopConfigSyntaxValidator
|
||||
{
|
||||
/**
|
||||
@@ -21,7 +15,7 @@ class iTopConfigSyntaxValidator
|
||||
* @param $sConfig
|
||||
* @param $bAllowUnsecure
|
||||
*/
|
||||
public function validate($sConfig, $bAllowUnsecure)
|
||||
public function Validate($sConfig, $bAllowUnsecure)
|
||||
{
|
||||
exec('php -v', $aOutput, $iReturnVar);
|
||||
$bCanRunCli = ($iReturnVar == 0);
|
||||
|
||||
Reference in New Issue
Block a user