Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ComposerJsonFinder.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
18  private $directoryList;
19 
25  public function __construct(DirectoryList $directoryList)
26  {
27  $this->directoryList = $directoryList;
28  }
29 
36  public function findComposerJson()
37  {
38  $composerJson = $this->directoryList->getPath(DirectoryList::ROOT) . '/composer.json';
39 
40  $composerJson = realpath($composerJson);
41 
42  if ($composerJson === false) {
43  throw new \Exception('Composer file not found');
44  }
45 
46  return $composerJson;
47  }
48 }