Skip to content
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

fix: Warning: Constant VALET_* already defined in X #1485

Merged
merged 1 commit into from
May 31, 2024

Conversation

NickSdot
Copy link
Contributor

Similar issue as in laravel/prompts#146. To make packages like symfony/var-dumper available globally you prepend the global Composer autoload.php like so:

// php.ini

auto_prepend_file = ${HOME}/.composer/vendor/autoload.php

image
From: https://symfony.com/doc/current/components/var_dumper.html

In Valet this can result in

( ! ) Warning: Constant VALET_HOME_PATH already defined in ~/.composer/vendor/laravel/valet/server.php on line 12
Call Stack
#	Time	Memory	Function	Location
1	0.0354	571296	{main}( )	.../server.php:0
2	0.0380	571488	define( $constant_name = 'VALET_HOME_PATH', $value = '~/.config/valet' )	.../server.php:12

( ! ) Warning: Constant VALET_STATIC_PREFIX already defined in ~/.composer/vendor/laravel/valet/server.php on line 13
Call Stack
#	Time	Memory	Function	Location
1	0.0354	571296	{main}( )	.../server.php:0

Similar issue as in laravel/prompts#146. To make packages like `symfony/var-dumper` available globally you prepend the global Composer autoload.php like so:

```
// php.ini

auto_prepend_file = ${HOME}/.composer/vendor/autoload.php
```

In Valet this can result in

```
( ! ) Warning: Constant VALET_HOME_PATH already defined in ~/.composer/vendor/laravel/valet/server.php on line 12
Call Stack
#	Time	Memory	Function	Location
1	0.0354	571296	{main}( )	.../server.php:0
2	0.0380	571488	define( $constant_name = 'VALET_HOME_PATH', $value = '~/.config/valet' )	.../server.php:12

( ! ) Warning: Constant VALET_STATIC_PREFIX already defined in ~/.composer/vendor/laravel/valet/server.php on line 13
Call Stack
#	Time	Memory	Function	Location
1	0.0354	571296	{main}( )	.../server.php:0
```
@mattstauffer mattstauffer merged commit 964ec7a into laravel:master May 31, 2024
6 checks passed
@NickSdot NickSdot deleted the patch-1 branch June 5, 2024 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants