Skip to content

Commit

Permalink
Remove useless warnings when checking PHP Compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxsoft committed Jan 9, 2018
1 parent 54942ac commit 7268e91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 10 additions & 3 deletions validator/Tasks/PHPCompatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,26 @@ public function run()
throw new \Exception('Parse output failed');
}


$sum = 0;
/*
if ($data->totals->errors === 0 && $data->totals->warnings === 0) {
Logger::info("Check PHP Compatibility finished, scanned {$data->summary->checkedFiles} files");
return;
}
*/

foreach ($data->files as $fileName => $file) {
foreach ($file->messages as $error) {
if (in_array($error->source, ["Internal.Tokenizer.Exception", "Internal.NoCodeFound"])) continue;
Logger::error($fileName . ': ');
Logger::error("Line {$error->line}: {$error->message}");
$sum++;
}
}
Logger::warning('You\'d better check these problems.');
if ($sum == 0) {
Logger::info("Check PHP Compatibility finished.");
} else {
Logger::warning('You\'d better check these problems.');
}

}

Expand Down
3 changes: 3 additions & 0 deletions validator/Wrappers/ZBPWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ protected function changeTheme()
$this->zbp->template->SetPath($this->zbp->usersdir . 'cache/compiled/' . $this->app->id . '/');
$this->zbp->BuildModule();
$this->zbp->SaveCache();
\InstallPlugin($this->app->id);
Logger::info('Compiling Theme..');
// @TODO Maybe a ZBP's bug
$this->zbp->template->theme = $this->app->id;
Expand All @@ -103,6 +104,7 @@ protected function enablePlugin()
{
$this->installDependencies($this->app);
\EnablePlugin($this->app->id);
\InstallPlugin($this->app->id);
Logger::info("Enabled {$this->app->id}");
}

Expand All @@ -128,6 +130,7 @@ protected function installDependency($appId)
}
$this->installDependencies($app);
\EnablePlugin($app->id);
\InstallPlugin($this->app->id);
// @TODO Maybe another ZBP Bug
$this->zbp->activeapps[] = $app->id;
Logger::info("Enabled {$app->id}");
Expand Down

0 comments on commit 7268e91

Please sign in to comment.