Platformsh\Cli\Local\Toolstack\Drupal::findDrushMakeFile PHP Method

findDrushMakeFile() protected method

Find the preferred Drush Make file in the app root.
protected findDrushMakeFile ( boolean $required = false, boolean $core = false ) : string | false
$required boolean
$core boolean
return string | false The absolute filename of the make file.
    protected function findDrushMakeFile($required = false, $core = false)
    {
        $candidates = ['project.make.yml', 'project.make', 'drupal-org.make.yml', 'drupal-org.make'];
        if (empty($this->settings['lock'])) {
            $candidates = array_merge(['project.make.lock', 'project.make.yml.lock', 'drupal-org.make.yml.lock', 'drupal-org.make.lock'], $candidates);
        }
        foreach ($candidates as &$candidate) {
            if ($core) {
                $candidate = str_replace('.make', '-core.make', $candidate);
            }
            if (file_exists($this->appRoot . '/' . $candidate)) {
                return $this->appRoot . '/' . $candidate;
            }
        }
        if ($required) {
            throw new \Exception(($core ? "Couldn't find a core make file in the directory." : "Couldn't find a make file in the directory.") . " Possible filenames: " . implode(',', $candidates));
        }
        return false;
    }