From 6b6ef51a33845b677cf7971dd0d7df73ea36722f Mon Sep 17 00:00:00 2001 From: Ivan Garcia Date: Sat, 26 Sep 2026 14:42:50 +0200 Subject: [PATCH 1/2] feat: add yii2 definition --- frameworks/index.json | 8 +++ frameworks/yii2/2.yaml | 108 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 frameworks/yii2/2.yaml diff --git a/frameworks/index.json b/frameworks/index.json index 0b7d595..bda9d01 100644 --- a/frameworks/index.json +++ b/frameworks/index.json @@ -128,6 +128,14 @@ {"file": "tempest"} ] } + , + { + "name": "yii2", + "label": "Yii 2", + "versions": ["2"], + "latest": "2", + "detect": ["file:yii", "composer:yiisoft/yii2"] +} ], "packages": [ {"name": "apache-solr-for-typo3/solr"}, diff --git a/frameworks/yii2/2.yaml b/frameworks/yii2/2.yaml new file mode 100644 index 0000000..4bddafa --- /dev/null +++ b/frameworks/yii2/2.yaml @@ -0,0 +1,108 @@ +name: yii2 +version: "2" +label: Yii 2 +color: "#b8dc4d" +public_dir: web +create: composer create-project yiisoft/yii2-app-basic:^2.0 +php: + min: "7.4" + max: "8.4" +detect: + - file: "yii" + - composer: "yiisoft/yii2" + +env: + file: "config/db.php" + example_file: "config/db.php.example" + format: php-array + services: + sqlite: + detect: + - key: "dsn" + value_prefix: "sqlite:" + vars: + - "dsn=sqlite:/var/www/html/runtime/database.db" + mysql: + detect: + - key: "dsn" + value_prefix: "mysql:" + - key: "dsn" + value_prefix: "mariadb:" + vars: + - "dsn=mysql:host=lerd-mysql;dbname={{site}}" + - "username=root" + - "password=lerd" + postgres: + detect: + - key: "dsn" + value_prefix: "pgsql:" + vars: + - "dsn=pgsql:host=lerd-postgres;dbname={{site}}" + - "username=postgres" + - "password=lerd" + redis: + detect: + - key: "class" + value_prefix: "yii\\redis\\Cache" + - key: "class" + value_prefix: "yii\\queue\\redis\\Queue" + vars: + - "class=yii\\redis\\Cache" + - "redis.host=lerd-redis" + - "redis.port=6379" + +workers: + queue: + label: Queue Worker + icon: queue + command: php yii queue/run --verbose + requires_service: + name: redis + when_env: "class=yii\\queue\\redis\\Queue" + restart: always + check: + composer: "yiisoft/yii2-queue" + +setup: + - label: Set permissions + command: mkdir -p runtime assets && chmod -R 777 runtime assets + default: true + - label: Run migrations + command: php yii migrate --interactive=0 + default: true + - label: Load fixtures + command: php yii fixture/load "*" --interactive=0 + default: false + +tinker: + command: ["yii", "shell"] + execute_flag: "--execute" + requires_package: "yiisoft/yii2-shell" + requires_file: "yii" + +commands: + - name: cache:flush + label: Flush cache + description: Clear all application caches + icon: cache + command: php yii cache/flush-all + - name: migrate + label: Run migrations + description: Apply database migrations + icon: database + command: php yii migrate --interactive=0 + - name: migrate:create + label: Create migration + description: Generate a new migration file + icon: code + command: php yii migrate/create {{name}} --migrationPath=@app/migrations + - name: gii + label: Gii code generator + description: Launch Gii web interface + icon: code + command: php yii gii --interactive=0 + +doctor: + migrate_command: migrate + health_check: "curl -sf http://localhost/index.php > /dev/null || exit 1" + check_composer: "yiisoft/yii2" From fe366f2a60ee2226bd083cc25dcd644fcd997b7c Mon Sep 17 00:00:00 2001 From: George Dumitrescu Date: Sat, 26 Sep 2026 16:40:24 +0300 Subject: [PATCH 2/2] fix: make the Yii definition load, wire and run cleanly The index entry gave its detect rules as strings, which lerd cannot parse, so the whole store index would have failed to load on every install. It now uses the same rule objects as every other entry, and the framework is named yii with 2 as its version so Yii 3 can join it later. Detection keys on yiisoft/yii2 alone, because Yii 3 ships a yii console script too. db.php is handed straight to yii\db\Connection, which rejects unknown keys, so url_key is none and lerd no longer writes APP_URL into it. The queue worker runs queue/listen, since queue/run drains the queue and exits, which left the unit restarting forever. The redis wiring is gone because it overwrote the connection class in db.php, and so is sqlite, which needs a project path lerd cannot express in env values yet. Tinker, migrate:create and gii are dropped because none of them worked from lerd, along with the permissions step the Yii installer already covers. Fixtures only show when the project has a fixtures folder, and the definition now carries the Yii leaf mark. --- frameworks/index.json | 17 ++++--- frameworks/yii.svg | 1 + frameworks/yii/2.yaml | 70 ++++++++++++++++++++++++++ frameworks/yii2/2.yaml | 108 ----------------------------------------- 4 files changed, 80 insertions(+), 116 deletions(-) create mode 100644 frameworks/yii.svg create mode 100644 frameworks/yii/2.yaml delete mode 100644 frameworks/yii2/2.yaml diff --git a/frameworks/index.json b/frameworks/index.json index bda9d01..62007a4 100644 --- a/frameworks/index.json +++ b/frameworks/index.json @@ -127,15 +127,16 @@ {"composer": "tempest/framework"}, {"file": "tempest"} ] - } - , + }, { - "name": "yii2", - "label": "Yii 2", - "versions": ["2"], - "latest": "2", - "detect": ["file:yii", "composer:yiisoft/yii2"] -} + "name": "yii", + "label": "Yii", + "versions": ["2"], + "latest": "2", + "detect": [ + {"composer": "yiisoft/yii2"} + ] + } ], "packages": [ {"name": "apache-solr-for-typo3/solr"}, diff --git a/frameworks/yii.svg b/frameworks/yii.svg new file mode 100644 index 0000000..f54e773 --- /dev/null +++ b/frameworks/yii.svg @@ -0,0 +1 @@ + diff --git a/frameworks/yii/2.yaml b/frameworks/yii/2.yaml new file mode 100644 index 0000000..76a1ea1 --- /dev/null +++ b/frameworks/yii/2.yaml @@ -0,0 +1,70 @@ +name: yii +version: "2" +label: Yii +color: "#40b3d8" +public_dir: web +create: composer create-project yiisoft/yii2-app-basic:^2.0 +php: + min: "7.4" + max: "8.4" +# The yii console script alone is not enough: Yii 3 ships one too. +detect: + - composer: "yiisoft/yii2" + +env: + file: config/db.php + format: php-array + # Yii keeps no application URL here, and db.php is handed straight to + # yii\db\Connection, which rejects any key it does not know. + url_key: none + services: + mysql: + detect: + - key: dsn + value_prefix: "mysql:" + vars: + - "dsn=mysql:host=lerd-mysql;dbname={{site}}" + - "username=root" + - "password=lerd" + postgres: + detect: + - key: dsn + value_prefix: "pgsql:" + vars: + - "dsn=pgsql:host=lerd-postgres;dbname={{site}}" + - "username=postgres" + - "password=lerd" + +workers: + queue: + label: Queue Worker + icon: queue + command: php yii queue/listen --verbose + restart: always + check: + composer: "yiisoft/yii2-queue" + +setup: + - label: Run migrations + command: php yii migrate --interactive=0 + default: true + - label: Load fixtures + command: php yii fixture/load "*" --interactive=0 + default: false + check: + file: tests/unit/fixtures + +commands: + - name: cache:flush + label: Flush cache + description: Clear all application caches + icon: cache + command: php yii cache/flush-all + - name: migrate + label: Run migrations + description: Apply database migrations + icon: database + command: php yii migrate --interactive=0 + +doctor: + migrate_command: migrate diff --git a/frameworks/yii2/2.yaml b/frameworks/yii2/2.yaml deleted file mode 100644 index 4bddafa..0000000 --- a/frameworks/yii2/2.yaml +++ /dev/null @@ -1,108 +0,0 @@ -name: yii2 -version: "2" -label: Yii 2 -color: "#b8dc4d" -public_dir: web -create: composer create-project yiisoft/yii2-app-basic:^2.0 -php: - min: "7.4" - max: "8.4" -detect: - - file: "yii" - - composer: "yiisoft/yii2" - -env: - file: "config/db.php" - example_file: "config/db.php.example" - format: php-array - services: - sqlite: - detect: - - key: "dsn" - value_prefix: "sqlite:" - vars: - - "dsn=sqlite:/var/www/html/runtime/database.db" - mysql: - detect: - - key: "dsn" - value_prefix: "mysql:" - - key: "dsn" - value_prefix: "mariadb:" - vars: - - "dsn=mysql:host=lerd-mysql;dbname={{site}}" - - "username=root" - - "password=lerd" - postgres: - detect: - - key: "dsn" - value_prefix: "pgsql:" - vars: - - "dsn=pgsql:host=lerd-postgres;dbname={{site}}" - - "username=postgres" - - "password=lerd" - redis: - detect: - - key: "class" - value_prefix: "yii\\redis\\Cache" - - key: "class" - value_prefix: "yii\\queue\\redis\\Queue" - vars: - - "class=yii\\redis\\Cache" - - "redis.host=lerd-redis" - - "redis.port=6379" - -workers: - queue: - label: Queue Worker - icon: queue - command: php yii queue/run --verbose - requires_service: - name: redis - when_env: "class=yii\\queue\\redis\\Queue" - restart: always - check: - composer: "yiisoft/yii2-queue" - -setup: - - label: Set permissions - command: mkdir -p runtime assets && chmod -R 777 runtime assets - default: true - - label: Run migrations - command: php yii migrate --interactive=0 - default: true - - label: Load fixtures - command: php yii fixture/load "*" --interactive=0 - default: false - -tinker: - command: ["yii", "shell"] - execute_flag: "--execute" - requires_package: "yiisoft/yii2-shell" - requires_file: "yii" - -commands: - - name: cache:flush - label: Flush cache - description: Clear all application caches - icon: cache - command: php yii cache/flush-all - - name: migrate - label: Run migrations - description: Apply database migrations - icon: database - command: php yii migrate --interactive=0 - - name: migrate:create - label: Create migration - description: Generate a new migration file - icon: code - command: php yii migrate/create {{name}} --migrationPath=@app/migrations - - name: gii - label: Gii code generator - description: Launch Gii web interface - icon: code - command: php yii gii --interactive=0 - -doctor: - migrate_command: migrate - health_check: "curl -sf http://localhost/index.php > /dev/null || exit 1" - check_composer: "yiisoft/yii2"