cancel
Showing results for 
Search instead for 
Did you mean: 

/app/functions.php

SOLVED

/app/functions.php

Currently /app/functions.php is only a convenience wrapper around \Magento\Framework\Phrase

 

Can we do something about it's current location?

 

The issue that I have with it's current location is that it is only available in the main magento/magento2ce project. This in turn means that if you look at a module like Magento_Backup in isolation and it's dependencies here https://github.com/magento/magento2/blob/develop/app/code/Magento/Backup/composer.json#L6-L9 this becomes incomplete (https://github.com/magento/magento2/blob/develop/app/code/Magento/Backup/view/adminhtml/templates/ba...

 

The options as I see them would be

 

1.) moving the convenience wrapper into Magento\Framework

2.) moving it into an existing Magento module like Translation which all other modules now depend on

3.) Create a new module

4.) add magento/magento2ce to the dependencies of Magento_Backup (not really an option)


At the same time maybe we can also think about loading it via a composer instruction?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: /app/functions.php

Your suggestions make sense, but I think this is a good question for GitHub. The more hands on code layout questions I tend to leave to the Engineering team. There are ongoing plans to move all composer installed files under vendor - this could be related to that effort as well (need to make sure the file is found correctly when moved under 'vendor'. There may be some dependency reason to avoid it in Framework for example - I am not sure.

View solution in original post

2 REPLIES 2

Re: /app/functions.php

Your suggestions make sense, but I think this is a good question for GitHub. The more hands on code layout questions I tend to leave to the Engineering team. There are ongoing plans to move all composer installed files under vendor - this could be related to that effort as well (need to make sure the file is found correctly when moved under 'vendor'. There may be some dependency reason to avoid it in Framework for example - I am not sure.

Re: /app/functions.php

Thanks, with Max's comment here https://twitter.com/maksek_ua/status/702962303415644160 I wasn't 100% sure where to post the question...

 

And also noticed that magento2-base seems to exist but haven't quite worked out yet how this translates to a github repo.