yuncms / composer
The composer plugin for yuncms module installer
Installs: 2 446
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:composer-plugin
pkg:composer/yuncms/composer
Requires
- composer-plugin-api: ^1.0
Requires (Dev)
- composer/composer: ^1.0
This package is auto-updated.
Last update: 2022-07-09 17:21:30 UTC
README
YUNCMS Composer Installer
This is the composer installer for YUNCMS modules.
It implements a new composer package type named yii2-extension,
which should be used by all Yii 2 extensions if they are distributed as composer packages.
For license information check the LICENSE-file.
Usage
The Yii 2 Composer Installer is automatically installed with when installing the framework via Composer.
To use Yii 2 composer installer, simply set the package type to be yii2-extension in your composer.json,
like the following:
{
    "type": "yii2-extension",
    "require": {
        "yiisoft/yii2": "~2.0.0"
    },
    ...
}
You may specify a bootstrapping class in the extra section. The init() method of the class will be executed each time
the Yii 2 application is responding to a request. For example,
{
    "type": "yii2-extension",
    ...,
    "extra": {
        "yuncms": {
            "id": "framework",
            "migrationPath": "@vendor/yuncms/framework/migrations"
        }
    }
}
or :
{
    "type": "yii2-extension",
    ...,
    "extra": {
        "yuncms": "mainfest.php"
    }
}
mainfest.php :
return [ 'id'=> 'user', 'migrationPath'=> '@vendor/....', 'events'=> [ [etc], [etc1] ], 'tasks'=> [ [etc], [etc1] ], 'translations'=> [ 'yuncms/user'=> [ 'class' => 'yii\i18n\PhpMessageSource', //'basePath' => '@app/messages', 'sourceLanguage' => 'en-US', 'fileMap' => [ 'app' => 'app.php', 'app/error' => 'error.php', ], ] ], 'frontend'=> [ 'class=>'', 'etc' ], 'backend'=> [ 'class=>'', ], ];