platformsh / platformsh-magento2-configuration

☠ DEPRECATED
9 stars 33 forks source link

Alter Compile function to work with M2 >=2.1 #18

Open waynetheisinger opened 8 years ago

waynetheisinger commented 8 years ago

The release of Magento 2.1.0 removed setup:di:compile-multi-tenant. As we haven't initiated Magento in this script we can't check its version number. To get round this I've put in some error handling. First we try multi-tenant complilation and if that fails we catch as we are greater or equal to 2.1 and use setup:di:compile.

ceer commented 8 years ago

I had to call $this->execute("php bin/magento setup:di:compile"); only. The fail test gave me the error:

[InvalidArgumentException]
Command "setup:di:compile-multi-tenant" is not defined. 
waynetheisinger commented 8 years ago

even though that echo's to the console - didn't the catch block also fire?

waynetheisinger commented 8 years ago

thinking about it - it was a runtime exception on my set-up but maybe that's too specific - maybe the catch block should just be for a standard exception...