acquia / drupal-environment-detector

Provides common methods for detecting the current Acquia environment
GNU General Public License v2.0
10 stars 12 forks source link

Count LANDO as Local #22

Closed nikunjkotecha closed 2 years ago

nikunjkotecha commented 2 years ago

With acquia recipe of Lando we get LANDO for AH_SITE_ENVIRONMENT environment variable.

https://docs.lando.dev/config/acquia.html

Since this returns true lot of additional code is executed in local which is actually not required.

Steps to reproduce - Setup new project with Acquia CMS default steps using Lando and use acquia recipe for it.

danepowell commented 2 years ago

See #21 and https://github.com/acquia/blt/issues/4175 . I don't think the solution is so trivial as just making Lando local. Functionally, it's actually closer to Cloud (in terms of where settings files and other directories are located). Arbitrarily switching it to local would probably break the zero-configuration setup.

danepowell commented 2 years ago

Clarification: Lando is already considered local. It's also considered an AH environment.

nikunjkotecha commented 2 years ago

@danepowell It seems we need to update the function isAhEnv (assuming AH here means Acquia Hosting)

as checked in https://github.com/acquia/drupal-environment-detector/blob/master/src/AcquiaDrupalEnvironmentDetector.php#L13 it returns true even for LANDO and that is causing problems in conditions based on this function.

danepowell commented 2 years ago

What problems? It is an Acquia hosting environment, albeit one that you run locally. But the file structure and available resources should all be the same.

nikunjkotecha commented 2 years ago

See https://github.com/acquia/acquia_cms/blob/develop/patches/d9-acms-settings.patch

In Acquia CMS the condition is to execute some code on AH environment and that condition returns true even in LANDO since the variable is set and the only condition inside isAhEnv is that if the variable is set or not.

Question (sorry for stepping back):

danepowell commented 2 years ago

Again, I don't see what problem that conditional is causing, can you provide an example? It essentially just includes database settings, which is desirable (Acquia Lando environments provide DB settings just like Acquia Cloud). It shouldn't cause problems.

nikunjkotecha commented 2 years ago

We don't have /var/www/site-php/ in Lando