laravel / octane

Supercharge your Laravel application's performance.
https://laravel.com/docs/octane
MIT License
3.77k stars 295 forks source link

Vendor path is coupled to app base path #681

Closed ItsReddi closed 1 year ago

ItsReddi commented 1 year ago

Octane Version

1.53

Laravel Version

10.8.0

PHP Version

8.2

What server type are you using?

Roadrunner

Server Version

2.12.3

Database Driver & Version

No response

Description

When using octane in a Mono repository. The vendor path is not equivalent to the APP_BASE_PATH.

There is already a pull request that would fix that issue. https://github.com/laravel/octane/pull/555

Steps To Reproduce

Please have a look to https://github.com/laravel/octane/pull/555

driesvints commented 1 year ago

What do you mean with "Mono repository"?

ItsReddi commented 1 year ago
- vendor
- package
  |-- laravel-app-1
  |-- laravel-app-2
  |-- laravel-package-x

Vendor only exists in root & not in the apps / packages.

The comment from the pull request describes it very well.

@taylorotwell Thanks for the reply, sorry for not explaining the problem right away.

I currently have a custom architecture that looks something like this:

- apps
  |-- src
  |-- ui
      |-- app1
          |-- bin
          |-- bootstrap
          |-- config
          |-- public
          |-- ...
      |-- app2
      |-- app3
- src (DDD architecture)
- vendor

So, I have several projects that work on a single code base.

In each application:

* base_path: path to `apps/ui/{project}`.

* namespace: overriden in `Illuminate\Foundation\Application`.

I.e. everything works fine except laravel/octane, which has a hardcoded path to the vendor folder.

Even if I don't run the roadrunner with the artisan command, I still can't do it, because inside bin/bootstrap it tries to take vendor from base_path, which I don't have.

Similar Pull Requests:

* [[9.x] Update PackageManifest::$vendorPath initialisation for cases, when composer vendor dir is not in project directory framework#41463](https://github.com/laravel/framework/pull/41463)

* [Use COMPOSER_VENDOR_DIR tinker#73](https://github.com/laravel/tinker/pull/73)

Since you asked about mono repository: What is a mono repository? https://semaphoreci.com/blog/what-is-monorepo

PHP Tooling example: https://github.com/symplify/monorepo-builder

driesvints commented 1 year ago

We don't support any such architecture sorry.