-
Notifications
You must be signed in to change notification settings - Fork 250
realpath not work in phar #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -26,7 +26,8 @@ class AwsServiceProvider extends ServiceProvider | |||
*/ | |||
public function boot() | |||
{ | |||
$source = realpath(__DIR__ . '/../config/aws.php'); | |||
$source = __DIR__.'/../config/aws.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead of realpath
you could use dirname
to walk up the directory tree a level? Something like:
$source = implode(DIRECTORY_SEPARATOR, [dirname(__DIR__), 'config', 'aws.php']);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to mess about with DIRECTORY_SEPARATOR
tbh. PHP internally normalizes it when it's used in php's internal functions.
Thanks! Could you squash the commits and remove the commented-out code? |
👎 |
Lumen itself already relies on the |
@GrahamCampbell You can call |
i removed the commented-out code. |
@nickfan Can you use |
i replace ../ with dirname , i'm not so familiar about squash commits,is that ok? |
GitHub has a guide on squashing commits that you can take a look at. |
ok all done. |
Thanks! |
i have pack some lumen project into phar executable toolkit.
realpath will not work in phar
btw:
you can detect current code is work in phar mode: