Skip to content

Commit 4bd6249

Browse files
committed
bug #7513 Adjust DDEV for EasyAdmin 5.x (a-r-m-i-n)
This PR was merged into the 5.x branch. Discussion ---------- Adjust DDEV for EasyAdmin 5.x Also, added "ddev make" command to run the original defined tasks from Makefile directly and marked existing commands "build-assets" and "run-tests" as deprecated. Raised PHP version to 8.5 Using Symfony 8.0 Commits ------- e635d82 Adjust DDEV for EasyAdmin 5.x
2 parents 8471455 + e635d82 commit 4bd6249

7 files changed

Lines changed: 31 additions & 19 deletions

File tree

.ddev/commands/web/build-assets

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22

3+
echo 'Deprecation notice: The "ddev build-assets" command is deprecated'
4+
echo 'Please use "ddev make build" and "ddev make build-assets" instead'
5+
echo ""
6+
37
cd ../easyadminbundle
4-
yarn install
5-
yarn encore production
6-
php ./src/Resources/bin/fix-assets-manifest-file.php
7-
../html/bin/console assets:install --symlink
8+
make build
9+
make build-assets

.ddev/commands/web/make

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
cd ../easyadminbundle
4+
make $@

.ddev/commands/web/run-tests

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
echo 'Deprecation notice: The "ddev run-tests" command is deprecated'
4+
echo 'Please use "ddev make tests" instead'
5+
echo ''
6+
37
cd ../easyadminbundle
4-
composer update
5-
vendor/bin/simple-phpunit -v
8+
make tests

.ddev/commands/web/setup

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# Installing Symfony Framework
4-
composer create-project symfony/skeleton:"7.2.*" -n
4+
composer create-project symfony/skeleton:"8.0.*" -n
55
mv -f ./skeleton/* ./
66
mv -f ./skeleton/.env ./
77
mv -f ./skeleton/.env.dev ./
@@ -30,6 +30,8 @@ ln -s ../../../easyadminbundle/.ddev/example/config/routes/easyadmin.yaml config
3030
echo 'DATABASE_URL="mysql://db:db@db:3306/db?serverVersion=10.11.0-MariaDB&charset=utf8mb4"' >> .env.local
3131
./bin/console doc:sch:up --force
3232

33+
bin/console assets:install --symlink
34+
3335
# Clear Cache
3436
sleep 2
3537
./bin/console c:c

.ddev/config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
name: easy-admin-bundle
2-
type: php
3-
docroot: public
1+
name: "easy-admin-bundle"
2+
type: "php"
3+
docroot: "public"
44
no_project_mount: true
5-
php_version: "8.3"
6-
webserver_type: apache-fpm
5+
php_version: "8.5"
6+
webserver_type: "apache-fpm"
77
router_http_port: "80"
88
router_https_port: "443"
99
xdebug_enabled: false
1010
additional_hostnames: []
1111
additional_fqdns: []
1212
database:
13-
type: mariadb
13+
type: "mariadb"
1414
version: "10.11"
1515
use_dns_when_possible: true
1616
composer_version: "2"
1717
web_environment: []
18+
webimage_extra_packages: ["build-essential"]
1819
nodejs_version: "22"
1920
timezone: "Europe/Berlin"

.ddev/example/Controller/Admin/DashboardController.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
88
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
99
use Symfony\Component\HttpFoundation\Response;
10-
use Symfony\Component\Routing\Attribute\Route;
1110

12-
#[AdminDashboard]
11+
#[AdminDashboard(routePath: '/', routeName: 'admin')]
1312
class DashboardController extends AbstractDashboardController
1413
{
15-
#[Route('/', name: 'admin')]
1614
public function index(): Response
1715
{
18-
return $this->render('@EasyAdmin/page/content.html.twig');
16+
return $this->render('@EasyAdmin/layout.html.twig');
1917
}
2018

2119
public function configureDashboard(): Dashboard

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ Symfony Framework project providing example entities and CRUD Controllers.
100100
* Checkout the EasyAdmin git repository and switch in the project directory
101101
* Perform `ddev setup` which starts and provisions the web container
102102
* EasyAdmin is available under the URL: https://easy-admin-bundle.ddev.site
103-
* To (re-)build frontend assets perform `ddev build-assets`
104-
* To run unit tests perform `ddev run-tests`
103+
* With `ddev make <target>` you can execute predefined tasks from [`Makefile`](./Makefile). Examples:
104+
* To update dependencies (Composer and Yarn): `ddev make build`
105+
* To (re-)build frontend assets perform `ddev make build-assets`
106+
* To run unit tests perform `ddev make tests`
105107

106108
## Resources
107109

0 commit comments

Comments
 (0)