1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Allow use of Psalm without composer

Fixes #935
This commit is contained in:
Matthew Brown 2018-08-09 00:03:32 -04:00
parent abc19d7136
commit a32273b2b8
2 changed files with 6 additions and 6 deletions

View File

@ -45,7 +45,7 @@ function requireAutoloaders($current_dir, $has_explicit_root, $vendor_dir)
$has_autoloader = true;
}
if (!$has_autoloader) {
if (!$has_autoloader && file_exists($autoload_root . '/composer.json')) {
$error_message = 'Could not find any composer autoloaders in ' . $autoload_root;
if (!$has_explicit_root) {

View File

@ -303,11 +303,11 @@ if (isset($options['i'])) {
$template = (string)file_get_contents($template_file_name);
$template = str_replace('<projectFiles>
<directory name="src" />
</projectFiles>', '<projectFiles>
<directory name="' . $source_dir . '" />
</projectFiles>', $template);
$template = str_replace(
'<directory name="src" />',
'<directory name="' . $source_dir . '" />',
$template
);
if (!\Phar::running(false)) {
$template = str_replace(