Skip to content

Commit

Permalink
Throws exception if dependency is not installed correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
siad007 authored Nov 15, 2016
1 parent 3fc2648 commit 580fd3c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions classes/phing/system/io/YamlFileParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ public function parseFile(PhingFile $file)
}

try {

if (!class_exists('\Symfony\Component\Yaml\Parser')) {
throw new BuildException(
get_class($this)
. ' depends on \Symfony\Component\Yaml\Parser '
. 'being installed and on include_path.'
);
}
// We load the Yaml class without the use of namespaces to prevent
// parse errors in PHP 5.2.
$parserClass = '\Symfony\Component\Yaml\Parser';
Expand Down

0 comments on commit 580fd3c

Please sign in to comment.