Project

General

Profile

Actions

Enhancement(機能追加・改善) #557

closed

Add ability to manage plugin dependancy (プラグインの依存性を管理できるようにする)

Added by Kousuke Ebihara almost 15 years ago. Updated almost 15 years ago.

Status:
Fixed(完了)
Priority:
Normal(通常)
Target version:
Start date:
2010-02-02
Due date:
% Done:

100%

Estimated time:

Description

Summary (概要)

Add ability to manage plugin dependancy.

プラグインの依存性を管理できるようにする。

Spec (仕様)

About dependency-supported plugin (依存性をサポートしたプラグインについて)

OpenPNE Plugin uses PEAR-styled dependency.

If you want to know about PEAR-styled dependency, see: http://pear.php.net/manual/en/guide.developers.package2.dependencies.php

Plugin developer can write <dependencies> to package.xml by hand. However, until now, developers have generated package.xml automatically by some convinience-tasks, so writing package.xml will be painful for them.

So, OpenPNE provides generating <dependencies> in package.xml too.

OpenPNE プラグインは PEAR スタイルの依存性をサポートする。

PEAR パッケージの依存性については http://pear.php.net/manual/ja/guide.developers.package2.dependencies.php にて知ることができる。

プラグイン開発者は package.xml に <dependencies> を手で記述することができる。しかしながら、いままで、開発者は package.xml を有用なタスク群によって自動で生成してきており、 package.xml を記述する行為は苦痛になると思われる。

そこで、 OpenPNE では package.xml に <dependencies> を生成する機能も提供する。

Creating dependency-supported plugin (依存性をサポートしたプラグインの作成方法)

OpenPNE 3.5.1 以降で opGenerate:plugin タスクを実行すると、生成したプラグインに dependencies.yml.sample というファイルが作成される。このファイルを dependencies.yml としてコピーして編集することで、 opPlugin:define や opPlugin:generate による package.xml の生成時に <dependencies> の記述が一緒に生成される。

OpenPNE 3.5.1 未満のバージョンで生成したプラグインについては lib/task/skeleton/opPlugin/dependencies.yml.sample からプラグインのルートディレクトリに dependencies.yml としてコピーして使用する。

このファイルの記述方法についてはファイル自体に含まれている説明を参照のこと。

Working for checking dependency (依存性チェックの挙動)

プラグインインストールの際にバージョン指定がされなかった場合、依存性を満たすパッケージを探し、依存性を満たすものが見つからなければインストールに失敗する(従来の挙動)。

バージョン指定された場合、ダウンロードしたパッケージのための依存性を解決できない場合、詳細なエラーメッセージを表示して依存性の解決を促すように変更をおこなった。 symfony のプラグインマネージャでは自動的にパッケージをダウンロードして依存性を解決することはできないため、依存性の解決自体は手動で行う必要がある。

依存性を解決できなかった場合のエラーメッセージは以下のように表示される。

http://26.media.tumblr.com/tumblr_kz23df0UNC1qz6qi7o1_500.png

Actions #1

Updated by Kousuke Ebihara almost 15 years ago

  • Target version changed from OpenPNE 3.5.0 to OpenPNE 3.5.1
Actions #2

Updated by Kousuke Ebihara almost 15 years ago

  • Status changed from New(新規) to Pending Review(レビュー待ち)
  • % Done changed from 0 to 50

更新履歴 ebf63f89f0af171f32fbefbfcb7b2984a6085147 で適用されました。

Actions #3

Updated by Kousuke Ebihara almost 15 years ago

  • Subject changed from Add ability to manage plugin dependancy to Add ability to manage plugin dependancy (プラグインの依存性を管理できるようにする)
  • Assignee set to Kousuke Ebihara
Actions #4

Updated by Mutsumi Imamura almost 15 years ago

  • Status changed from Pending Review(レビュー待ち) to Rejected(差し戻し)

release時にwarningが発生したので、差し戻します。

[xxxxxx@f10 xxx.xxx.xxx]$ symfony opPlugin:release opMumumuPlugin ~/ --channel=plugins.ebihara.dazai.pne.jp
 Type plugin version
1
 Choose stability (stable, alpha, beta or devel)
beta
 Type release note
test
 These informations are inputed:
The Plugin Name         opMumumuPlugin
The Plugin Version      1
The Plugin Stability    beta
The Release note        test

 Is it OK to start this task? (y/n)
y
PHP Warning:  Invalid argument supplied for foreach() in /home/xxxxxx/sns/xxx.xxx.xxx/lib/task/opPluginDefineTask.class.php on line 149
PHP Stack trace:
PHP   1. {main}() /usr/bin/symfony:0
PHP   2. include() /usr/bin/symfony:37
PHP   3. sfSymfonyCommandApplication->run() /home/xxxxxx/sns/xxx.xxx.xxx/lib/vendor/symfony/lib/command/cli.php:20
PHP   4. sfTask->runFromCLI() /home/xxxxxx/sns/xxx.xxx.xxx/lib/vendor/symfony/lib/command/sfSymfonyCommandApplication.class.php:76
PHP   5. sfBaseTask->doRun() /home/xxxxxx/sns/xxx.xxx.xxx/lib/vendor/symfony/lib/task/sfTask.class.php:97
PHP   6. opPluginReleaseTask->execute() /home/xxxxxx/sns/xxx.xxx.xxx/lib/vendor/symfony/lib/task/sfBaseTask.class.php:68
PHP   7. opPluginReleaseTask->doRelease() /home/xxxxxx/sns/xxx.xxx.xxx/lib/task/opPluginReleaseTask.class.php:75
PHP   8. sfTask->run() /home/xxxxxx/sns/xxx.xxx.xxx/lib/task/opPluginReleaseTask.class.php:83
PHP   9. sfBaseTask->doRun() /home/xxxxxx/sns/xxx.xxx.xxx/lib/vendor/symfony/lib/task/sfTask.class.php:173
PHP  10. opPluginDefineTask->execute() /home/xxxxxx/sns/xxx.xxx.xxx/lib/vendor/symfony/lib/task/sfBaseTask.class.php:68
PHP  11. opPluginDefineTask->setDpendencies() /home/xxxxxx/sns/xxx.xxx.xxx/lib/task/opPluginDefineTask.class.php:100
Actions #5

Updated by Kousuke Ebihara almost 15 years ago

  • Status changed from Rejected(差し戻し) to Pending Review(レビュー待ち)

Warning が出ていたのを修正しました。 packge への依存性チェックなどで、値が空の依存性をスキップするようにして回避しました。

Actions #6

Updated by Mutsumi Imamura almost 15 years ago

Warningが回避されたのを確認しました。

Actions #7

Updated by Mutsumi Imamura almost 15 years ago

  • % Done changed from 50 to 70
動作確認しました。とくに問題ありません。
  1. dependencies.yml.sampleが作成されるか
  2. 依存性チェックがされるか
Actions #8

Updated by Kousuke Ebihara almost 15 years ago

  • Status changed from Pending Review(レビュー待ち) to Fixed(完了)
  • % Done changed from 70 to 100
Actions

Also available in: Atom PDF