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

Question: how can I use composers vendor/autoload.php from multiple projects using safe? #422

Open
mfn opened this issue Apr 17, 2023 · 0 comments

Comments

@mfn
Copy link

mfn commented Apr 17, 2023

Hi 👋🏼 ,

it might be related to #53 or #253

The problem:

  • I've two projects projectA/ and projectB/
  • completely separate projects, distinct namespacs, both using composer autoloading
  • both using thecodingmachine/safe:^2

I've a "glue" code which works a bit like:

require_once 'projectA/vendor/autoload.php';
require_once 'projectB/vendor/autoload.php';

// Do sommething with `ProjectA\Foo` and `ProjectB\Bar`

This used to work until both projects, which very well run and work on their own, got safe added and now it doesn't pass the second autoloader

PHP Fatal error: Cannot redeclare Safe\mysqli_get_client_stats() (previously declared in /projectA/vendor/thecodingmachine/safe/deprecated/mysqli.php:16) in /projectB/vendor/thecodingmachine/safe/generated/mysqli.php on line 34

Is there a way to get this working? I don't see anything like function_exists() in safe, so I guess not.

thx

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

No branches or pull requests

1 participant