How to not overwrite ext folder with composer install ?
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
How to not overwrite ext folder with composer install ?
I have created new Laravel project, there in dependencies is laravel-aimeos. I push files to bitbacket repository, of course I don't push vendor folder.
Normally I work on my local machine. Let say I want to set up this project on remote server. I go to ssh remote server, there clone the project from bitbucket and run composer install.
The problem is when I make composer install not only vendor folder is creating, but also 'ext' folder is creating. Aimeos creates this ext folder. But during development for extending aimeos I need change or create new files inside ext folder. So when I set up the project on another device, I clone the project (there is modified ext folder), then I need make composer install to get vendor and dependencies, and in this moment ext folder gets overwritten.
Stupid situation(
I want to be able to clone project with modified files inside ext folder and make composer install and not get ext folder overwriten.
Aimeos version: 2019.04
PHP Version 7.2.19-1+ubuntu18.04.1+deb.sury.org+1
Normally I work on my local machine. Let say I want to set up this project on remote server. I go to ssh remote server, there clone the project from bitbucket and run composer install.
The problem is when I make composer install not only vendor folder is creating, but also 'ext' folder is creating. Aimeos creates this ext folder. But during development for extending aimeos I need change or create new files inside ext folder. So when I set up the project on another device, I clone the project (there is modified ext folder), then I need make composer install to get vendor and dependencies, and in this moment ext folder gets overwritten.
Stupid situation(
I want to be able to clone project with modified files inside ext folder and make composer install and not get ext folder overwriten.
Aimeos version: 2019.04
PHP Version 7.2.19-1+ubuntu18.04.1+deb.sury.org+1
Re: How to not overwrite ext folder with composer install ?
The only files you should add/change in your ./ext/ folder are the ones that are in your own extension for your project. Don't touch the other extensions (ai-client-html, etc.) as you can overwrite anything in your own one!
You should add your own extension in ./ext/ to your git repository and ignore anything else using the .gitignore file.
You should add your own extension in ./ext/ to your git repository and ignore anything else using the .gitignore file.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: How to not overwrite ext folder with composer install ?
There are several questions about the same topic.
We are working on the project that uses aimeos-laravel 2018.10.4 and want to upgrade it to latest version. But we have some custom code in ext directory, for example, in files like:
- ext/ai-client-html/client/html/src/Client/Html/Common/Client/Summary/Base.php
- ext/ai-client-html/client/html/client/html/templates/catalog/filter/attribute-body-standard.php
some translation files, etc.
After reading messages above, we know that ext should not contain any custom code.
1. So, what is the best way to solve this issue?
2. Should we create something like myextension in the ext directory and move our logic in files with the same names?
If so,
- what namespace should we use?
- how can we make aimeos use our classes, views and translations files instead of that ones in ext directory?
Thanks in advance
We are working on the project that uses aimeos-laravel 2018.10.4 and want to upgrade it to latest version. But we have some custom code in ext directory, for example, in files like:
- ext/ai-client-html/client/html/src/Client/Html/Common/Client/Summary/Base.php
- ext/ai-client-html/client/html/client/html/templates/catalog/filter/attribute-body-standard.php
some translation files, etc.
After reading messages above, we know that ext should not contain any custom code.
1. So, what is the best way to solve this issue?
2. Should we create something like myextension in the ext directory and move our logic in files with the same names?
If so,
- what namespace should we use?
- how can we make aimeos use our classes, views and translations files instead of that ones in ext directory?
Thanks in advance
Re: How to not overwrite ext folder with composer install ?
Exactly, your own extension should contain all custom code so you can update the installation without loosing it.
The namespace of the classes is exactly the same but you have to give your classes a new name and configure that name. The Base classes are problematic because you can't overwrite them (general OOP problem) and you can only overwrite the classes that extend from it.
The templates and translation files are easy because you only have to copy them into the same directory structure in your extension as the original files and they are automagically used.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: How to not overwrite ext folder with composer install ?
Thanks a lot for help! We'll try to do it.
Re: How to not overwrite ext folder with composer install ?
After rewriting classes and running "composer dump-autoload" I got such warning about a lot- of classes:
Could you please tell, if there any doc how to correctly configure names of custom extension's classes?
And is that correct that I placed myext directory inside ext or should they be on the same level?
Thanks in advance
Update: sorry missed this one in your previous post: "The namespace of the classes is exactly the same but you have to give your classes a new name and configure that name."Warning: Ambiguous class resolution, "Aimeos\Client\Html\Catalog\Detail\Standard" was found 2x: in ".../ext/myext/client/html/src/Client/Html/Catalog/Detail/Standard.php" and ".../ext/ai-client-html/client/html/src/Client/Html/Catalog/Detail/Standard.php", the first will be used.
Could you please tell, if there any doc how to correctly configure names of custom extension's classes?
And is that correct that I placed myext directory inside ext or should they be on the same level?
Thanks in advance
Re: How to not overwrite ext folder with composer install ?
There's a configuration for each component and for the catalog detail it's:
https://aimeos.org/docs/2020.x/config/c ... tail/#name
Yes.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: How to not overwrite ext folder with composer install ?
Thanks a lot! I managed to do it