Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you. This guide will help you, to build manage your custom modules and themes via composer and install them to OXID.
Installation instructions for composer can be found here
- Copy the example composer.json file to your project
- Open your modules/functions.php file
- Put the following line at the end of the file:
require __DIR__ . '/../vendor/autoload.php';
- Run
composer install
from CLI - Installation is complete.
- Fork the repository at https://github.com/superReal/composer-with-oxid-demo-module
- Modify it to your needs
- Adapt the composer.json file
- Define a dependency in your projects root composer.json file. For using private repositores refer to https://getcomposer.org/doc/05-repositories.md#using-private-repositories
- Run
composer update
to install the module - Activate it in the OXID backend
- Fork the repository at https://github.com/superReal/composer-with-oxid-demo-theme
- Modify it to your needs
- Adapt the composer.json file
- Define a dependency in your projects root composer.json file. For using private repositores refer to https://getcomposer.org/doc/05-repositories.md#using-private-repositories
- Add the post-autoload-dump-scripts, to symlink the assets to the out/ folder automatically, after installing
"scripts": {
"post-autoload-dump": [
"ln -sf ../application/views/composer-with-oxid-demo-theme/skin/composer-with-oxid-demo-theme out/composer-with-oxid-demo-theme"
]
}
- Run
composer update
to install the theme - Activate it in the OXID backend
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request