Skip to content

Commit

Permalink
Move binary to separate folder
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Nov 25, 2019
1 parent 67a0941 commit c581a78
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion laravel β†’ bin/laravel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
if (file_exists(__DIR__.'/../../autoload.php')) {
require __DIR__.'/../../autoload.php';
} else {
require __DIR__.'/vendor/autoload.php';
require __DIR__ . '/vendor/autoload.php';
}

$app = new Symfony\Component\Console\Application('Laravel Installer', '2.3.0');
Expand Down
24 changes: 17 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"email": "taylorotwell@gmail.com"
}
],
"autoload": {
"psr-4": {
"Laravel\\Installer\\Console\\": "src/"
}
},
"require": {
"ext-zip": "*",
"guzzlehttp/guzzle": "^6.0",
Expand All @@ -22,6 +17,21 @@
"symfony/process": "^3.0|^4.0"
},
"bin": [
"laravel"
]
"bin/laravel"
],
"autoload": {
"psr-4": {
"Laravel\\Installer\\Console\\": "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}

2 comments on commit c581a78

@emjayess
Copy link

@emjayess emjayess commented on c581a78 Nov 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ™ This seems to've resulted in a broken installer, for me...

laravel new thing

Here's the full output I'm seeing:

PHP Warning:  require(/Users/emjayess/.composer/vendor/laravel/installer/bin/vendor/autoload.php): failed to open stream: No such file or directory in /Users/emjayess/.composer/vendor/laravel/installer/bin/laravel on line 7

Warning: require(/Users/emjayess/.composer/vendor/laravel/installer/bin/vendor/autoload.php): failed to open stream: No such file or directory in /Users/emjayess/.composer/vendor/laravel/installer/bin/laravel on line 7
PHP Fatal error:  require(): Failed opening required '/Users/emjayess/.composer/vendor/laravel/installer/bin/vendor/autoload.php' (include_path='.:/usr/local/Cellar/php@7.2/7.2.25/share/php@7.2/pear') in /Users/emjayess/.composer/vendor/laravel/installer/bin/laravel on line 7

Fatal error: require(): Failed opening required '/Users/emjayess/.composer/vendor/laravel/installer/bin/vendor/autoload.php' (include_path='.:/usr/local/Cellar/php@7.2/7.2.25/share/php@7.2/pear') in /Users/emjayess/.composer/vendor/laravel/installer/bin/laravel on line 7

Seems it is attempting to load vendor/autoload.php within ~/.composer/vendor/laravel/installer/bin/ ...

Failed opening required '/Users/emjayess/.composer/vendor/laravel/installer/bin/vendor/autoload.php'

Edit

... And traversing one directory higher, with an extra ../ in the file_exists case, fixed it for me πŸ‘Œ

if (file_exists(__DIR__.'/../../../autoload.php')) {
    require __DIR__.'/../../../autoload.php';
} else {
    require __DIR__.'/vendor/autoload.php';
}

@driesvints
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emjayess thanks! Fixed now

Please sign in to comment.