Skip to content

Commit

Permalink
fix: Warning: Constant VALET_* already defined in X
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
NickSdot authored May 12, 2024
1 parent b2cddba commit 5699f34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/**
* Define the user's "~/.config/valet" path.
*/
define('VALET_HOME_PATH', posix_getpwuid(fileowner(__FILE__))['dir'].'/.config/valet');
define('VALET_STATIC_PREFIX', '41c270e4-5535-4daa-b23e-c269744c2f45');
defined('VALET_HOME_PATH') or define('VALET_HOME_PATH', posix_getpwuid(fileowner(__FILE__))['dir'].'/.config/valet');
defined('VALET_STATIC_PREFIX') or define('VALET_STATIC_PREFIX', '41c270e4-5535-4daa-b23e-c269744c2f45');

/**
* Load the Valet configuration.
Expand Down

0 comments on commit 5699f34

Please sign in to comment.