aimeos / aimeos-symfony2
Professional, full-featured and high performance Symfony e-commerce bundle for online shops and complex B2B projects
Installs: 716
Dependents: 0
Suggesters: 0
Security: 0
Stars: 313
Watchers: 16
Forks: 52
Language:CSS
Type:symfony-bundle
Requires
- php: ~7.1
- composer-runtime-api: ^2.1
- aimeos/ai-admin-jqadm: 2021.10.*
- aimeos/ai-admin-jsonadm: 2021.10.*
- aimeos/ai-client-html: 2021.10.*
- aimeos/ai-client-jsonapi: 2021.10.*
- aimeos/ai-controller-frontend: 2021.10.*
- aimeos/ai-controller-jobs: 2021.10.*
- aimeos/ai-fosuser: 2021.10.*
- aimeos/ai-gettext: 2021.10.*
- aimeos/ai-monolog: 2021.10.*
- aimeos/ai-swiftmailer: 2021.10.*
- aimeos/ai-symfony: 2021.10.*
- aimeos/ai-twig: 2021.10.*
- aimeos/aimeos-core: 2021.10.*
- doctrine/common: ^2.8||^3.0
- nyholm/psr7: ~1.0
- sensio/framework-extra-bundle: ~3.4||~4.0||~5.0
- symfony/asset: ~3.4||~4.0||~5.0
- symfony/form: ~3.4||~4.0||~5.0
- symfony/framework-bundle: ~3.4||~4.0||~5.0
- symfony/monolog-bundle: ~3.0
- symfony/psr-http-message-bridge: ~1.0
- symfony/security-bundle: ~3.4||~4.0||~5.0
- symfony/swiftmailer-bundle: ~3.0
- symfony/templating: ~3.4||~4.0||~5.0
- symfony/twig-bundle: ~3.4||~4.0||~5.0
Requires (Dev)
- doctrine/doctrine-bundle: ~1.2
- doctrine/orm: ^2.2.3
- php-coveralls/php-coveralls: ~2.0
- phpunit/phpunit: ~7.0||~8.0
- symfony/browser-kit: ~3.4||~4.0||~5.0
- symfony/css-selector: ~3.4||~4.0||~5.0
Conflicts
- symfony/http-foundation: v5.2.0
- dev-master
- 2023.10.x-dev
- 2021.10.x-dev
- 2021.10.1
- 2021.07.x-dev
- 2021.07.1
- 2021.04.x-dev
- 2021.04.3
- 2021.04.2
- 2021.04.1
- 2021.01.x-dev
- 2020.10.x-dev
- 2020.10.5
- 2020.10.4
- 2020.10.3
- 2020.10.2
- 2020.10.1
- 2020.07.x-dev
- 2020.07.2
- 2020.07.1
- 2020.04.x-dev
- 2020.04.3
- 2020.04.2
- 2020.04.1
- 2020.01.x-dev
- 2020.01.1
- 2019.10.x-dev
- 2019.10.5
- 2019.10.4
- 2019.10.3
- 2019.10.2
- 2019.10.1
- 2019.07.x-dev
- 2019.07.3
- 2019.07.2
- 2019.07.1
- 2019.04.x-dev
- 2019.04.2
- 2019.04.1
- 2019.01.x-dev
- 2019.01.1
- 2018.10.x-dev
- 2018.10.2
- 2018.10.1
- 2018.07.x-dev
- 2018.07.1
- 2018.04.x-dev
- 2018.04.2
- 2018.04.1
- 2018.01.x-dev
- 2018.01.2
- 2018.01.1
- 2017.10.x-dev
- 2017.10.3
- 2017.10.2
- 2017.10.1
- 2017.07.x-dev
- 2017.07.3
- 2017.07.2
- 2017.07.1
- 2017.04.x-dev
- 2017.04.3
- 2017.04.2
- 2017.04.1
- 2017.03.x-dev
- 2017.03.1
- 2017.02.x-dev
- 2017.01.x-dev
- 2017.01.1
- 2016.10.x-dev
- 2016.10.5
- 2016.10.4
- 2016.10.3
- 2016.10.2
- 2016.10.1
- 2016.07.x-dev
- 2016.07.1
- 2016.04.x-dev
- 2016.04.3
- 2016.04.2
- 2016.04.1
- 2016.03.x-dev
- 2016.03.3
- 2016.03.2
- 2016.03.1
- 2016.01.x-dev
- 2016.01.3
- 2016.01.2
- 2016.01.1
- 1.2.x-dev
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.x-dev
- 1.1.1
- 1.1.0
- 1.0.x-dev
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-10-31 10:45:20 UTC
README
Aimeos Symfony bundle
⭐ Star us on GitHub — it helps!
Aimeos is THE professional, full-featured and ultra fast e-commerce package for Symfony! You can install it in your existing Symfony application within 5 minutes and can adapt, extend, overwrite and customize anything to your needs.
Table of content
Installation
This document is for the latest Aimeos 2023.10 and Symfony 6.3+.
If you want to upgrade between major versions, please have a look into the upgrade guide!
The Aimeos Symfony e-commerce bundle is a composer based library that can be installed easiest by using Composer. If you don't have an existing Symfony application, you can create a skeleton application using
composer create-project symfony/website-skeleton:~4.4 myshop
cd myshop
These settings need to be added to the ./config/packages/fos_user.yaml
file:
fos_user: db_driver: orm user_class: Aimeos\ShopBundle\Entity\FosUser firewall_name: aimeos_myaccount from_email: address: "me@example.com" sender_name: "Test shop" service: mailer: 'fos_user.mailer.noop'
The Aimeos components have to be configured as well to get authentication working correctly.
You need to take care of three things: Using the correct customer manager implementation and
password encryption method as well as the right path for the storages. All must be appended
at the end of the ./config/packages/aimeos_shop.yaml
:
aimeos_shop: resource: fs: baseurl: "https://yourdomain.com/" basedir: "%kernel.project_dir%/public" fs-admin: basedir: "%kernel.project_dir%/public/uploads" mshop: customer: manager: name: FosUser password: name: Bcrypt
To configure the Aimeos routing, create the file ./config/routes/aimeos_shop.yaml
with these lines:
aimeos_shop: resource: "@AimeosShopBundle/config/routing.yaml"
The same applies for the FosUser bundle. Create the file ./config/routes/fos_user.yaml
containing:
fos_user: resource: "@FOSUserBundle/Resources/config/routing/all.xml"
Make sure that the database is set up and it is configured in your ./config/packages/doctrine.yaml
:
parameters: env(DATABASE_URL): '' database_host: <your host/ip> database_port: <your port> database_name: <your database> database_user: <db username> database_password: <db password>
Also, you have to configure your database credentials in the .env
file:
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name
If you want to use a database server other than MySQL, please have a look into the article about supported database servers and their specific configuration.
If you don't use Sendmail but SMTP for sending e-mails, you have to adapt the MAILER_URL
configuration in your .env
file, e.g.:
MAILER_URL=smtp://smtp.mailtrap.io:2525?encryption=tls&auth_mode=login&username=...&password=...
Composer
Then add these lines to your composer.json
of your Symfony project:
"prefer-stable": true, "minimum-stability": "dev", "require": { "aimeos/aimeos-symfony": "~2023.10", "friendsofsymfony/user-bundle": "^3.2", ... }, "scripts": { "post-install-cmd": [ "Aimeos\\ShopBundle\\Composer\\ScriptHandler::installBundle", "Aimeos\\ShopBundle\\Composer\\ScriptHandler::setupDatabase", ... ], "post-update-cmd": [ "Aimeos\\ShopBundle\\Composer\\ScriptHandler::installBundle", "Aimeos\\ShopBundle\\Composer\\ScriptHandler::setupDatabase", ... ] }
Afterwards, install the Aimeos shop bundle using
composer update
In a production environment or if you don't want that the demo data gets installed, use the --no-dev option:
SYMFONY_ENV=prod composer update --no-dev
If you get an exception that the SensioGeneratorBundle
isn't found, follow the
steps described in the
Aimeos Symfony forum post
Start the PHP web server in the base directory of your application to do some quick tests:
php -S 127.0.0.1:8000 -t public
Then, you should be able to call the catalog list page in your browser using
http://127.0.0.1:8000/shop
Login and Admin
Setting up the administration interface is a matter of configuring the Symfony firewall to restrict access to the admin URLs.
Setting up the security configuration is the most complex part. The firewall
setup in ./config/packages/security.yaml
should look like this one:
security: providers: aimeos: entity: { class: Aimeos\ShopBundle\Entity\FosUser, property: username } password_hashers: Aimeos\ShopBundle\Entity\FosUser: bcrypt firewalls: aimeos_admin: pattern: ^/admin provider: aimeos form_login: login_path: /admin check_path: /admin_check aimeos_myaccount: pattern: ^/ form_login: provider: aimeos csrf_token_generator: security.csrf.token_manager logout: true access_control: - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/profile, roles: ROLE_USER } - { path: ^/admin/.+, roles: [ROLE_ADMIN, ROLE_SUPER_ADMIN] }
Caution: The order of the configuration settings in this file is important!
These settings will protect the /admin/*
URLs from unauthorized access from
someone without admin privileges.
The /profile
URL is protected by the FOS user bundle as well, which also offers
user registration.
As last step, you have to create an admin account using the Symfony command line:
./bin/console aimeos:account --admin me@mydomain.com
The e-mail address is the user name for login and the account will work for the frontend too. To protect the new account, the command will ask you for a password. The same command can create limited accounts by using "--editor" instead of "--admin". If you use "--super" the account will have access to all sites.
If the PHP web server is still running (php -S 127.0.0.1:8000 -t public
), you should be
able to call the admin login page in your browser using
http://127.0.0.1:8000/admin
and authenticating with your e-mail and the password which has been asked for by the
aimeos:account
command.
Hints
To simplify development, you should configure to use no content cache. You can
do this by adding these lines to ./config/packages/aimeos_shop.yaml
:
aimeos_shop: madmin: cache: manager: name: None
License
The Aimeos Symfony bundle is licensed under the terms of the MIT license and is available for free.