drufony / drupal-bridge
Symfony Drupal桥接器
1.2.0
2015-12-20 19:32 UTC
Requires (Dev)
- composer/composer: ~1.0@dev
- guzzle/guzzle: ~3.8
- symfony/filesystem: ~2.5
Suggests
- bangpound/drupal-bootstrap: Replace Drupal 7 bootstrap with a Pimple container
- bangpound/legacy-php-http-kernel: Run bad controllers on the Symfony kernel
- drufony/drufony: Drupal inside Symfony Standard Edition
- drufony/druplex: Drupal inside Silex
- guzzle/guzzle: Replace Drupal's HTTP function with Guzzle
- symfony/class-loader: Replace Drupal's class registry with Symfony's class loader
This package is auto-updated.
Last update: 2024-09-12 03:48:48 UTC
README
Composer
在您的composer.json文件中,定义Drupal根目录相对于composer.json文件的位置。drupal-root
是Composer集成所需唯一选项。
{ "extra": { "drupal-root": "docroot/" } }
Composer集成与composer/installers
配合良好,但这不是显式依赖项。当composer/installers
可用时,您可以安装Drupal模块、主题、配置文件和Drush插件。
以下示例基于composer/installers
文档,并依赖于将drupal-root
设置为docroot/
(如上所述)。
{ "extra": { "installer-paths": { "docroot/profiles/special/modules/custom/amazing": [ "somebody/amazing-module" ], "docroot/profiles/special/": [ "somebody/special-profile" ], "docroot/sites/all/modules/{$name}/": [ "type:drupal-module" ], "docroot/sites/all/themes/{$name}/": [ "type:drupal-theme" ], "docroot/sites/all/libraries/{$name}/": [ "type:drupal-library" ], "docroot/profiles/{$name}/": [ "type:drupal-profile" ], "docroot/sites/all/drush/{$name}/": [ "type:drupal-drush" ] } } }
配置文件安装的目录名称似乎必须与它的信息文件精确匹配。
Drupal安装
{ "repositories": [ { "type": "package", "package": { "name": "drupal/drupal", "version": "7.x-dev", "dist": { "type": "tar", "url": "http://ftp.drupal.org/files/projects/drupal-7.x-dev.tar.gz" }, "source": { "type": "git", "url": "git://git.drupal.org/project/drupal.git", "reference": "7.x" }, "bin": [ "scripts/drupal.sh", "scripts/password-hash.sh" ], "require": { "php": ">=5.2.4", "ext-date": "*", "ext-dom": "*", "ext-filter": "*", "ext-gd": "*", "ext-hash": "*", "ext-json": "*", "ext-pcre": "*", "ext-PDO": "*", "ext-session": "*", "ext-SimpleXML": "*", "ext-SPL": "*", "ext-xml": "*" } } } ], "require": { "drupal/drupal": "~7.0@dev", "drufony/drupal-bridge": "~1.0@dev" }, "extra": { "drupal-install": { "symlink": true, "relative": true } }, "scripts": { "create-sites-dir": "Bangpound\\Bridge\\Drupal\\Composer\\ScriptHandler::createSitesDir", "post-install-cmd": [ "Bangpound\\Bridge\\Drupal\\Composer\\ScriptHandler::prepareDrupalRoot" ], "post-update-cmd": [ "Bangpound\\Bridge\\Drupal\\Composer\\ScriptHandler::prepareDrupalRoot" ] } }
当您将drupal/drupal
定义为依赖项时,默认情况下,post-install-cmd
和post-update-cmd
脚本将创建includes
、misc
、modules
和themes
目录的相对符号链接。由于可以通过composer/installers
插件管理Drupal配置文件项目,因此省略了profiles
目录。
核心配置文件
对于standard
和minimal
安装的核心配置文件,可以从Drufony包仓库获取。只需将此片段合并到您的composer.json文件中。还要按照上述说明配置您的installer-paths
,以便将配置文件安装到Drupal根目录的profiles
目录。
{ "repositories": [ { "type": "composer", "url": "http://drufony.github.io/packages.json" } ], "require": { "drupal/minimal": "7.*@dev", "drupal/standard": "7.*@dev" } }
Drush命令
{ "require": { "drush/drush": "dev-master" }, "scripts": { "drush": "Bangpound\\Bridge\\Drupal\\Drush\\Composer\\ScriptHandler::drushCommand" } }
composer drush updatedb