プロジェクト

全般

プロフィール

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

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

Kousuke Ebihara約14年前に追加. 約14年前に更新.

ステータス:
Fixed(完了)
優先度:
Normal(通常)
担当者:
対象バージョン:
開始日:
2010-02-02
期日:
進捗率:

100%


説明

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

関係しているリビジョン

リビジョン 546eb0d1 (差分)
Kousuke Ebihara約14年前に追加

added ability to resolve plugin dependency with OpenPNE (refs #557)

リビジョン 3c19fa17 (差分)
Kousuke Ebihara約14年前に追加

added ability to resolve plugin dependency with OpenPNE (refs #557)

リビジョン ebf63f89 (差分)
Kousuke Ebihara約14年前に追加

changed to raise error if dependencies of a plugin is not filled (downloading automatically is not supported) (fixes #557)

リビジョン b1d2692a (差分)
Kousuke Ebihara約14年前に追加

fixed some Warnings in releasing plugin (refs #557)

履歴

#1 Kousuke Ebihara約14年前に更新

  • 対象バージョンOpenPNE 3.5.0 から OpenPNE 3.5.1 に変更

#2 Kousuke Ebihara約14年前に更新

  • ステータスNew(新規) から Pending Review(レビュー待ち) に変更
  • 進捗率0 から 50 に変更

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

#3 Kousuke Ebihara約14年前に更新

  • 題名Add ability to manage plugin dependancy から Add ability to manage plugin dependancy (プラグインの依存性を管理できるようにする) に変更
  • 担当者Kousuke Ebihara にセット

#4 Mutsumi Imamura約14年前に更新

  • ステータスPending Review(レビュー待ち) から 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

#5 Kousuke Ebihara約14年前に更新

  • ステータスRejected(差し戻し) から Pending Review(レビュー待ち) に変更

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

#6 Mutsumi Imamura約14年前に更新

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

#7 Mutsumi Imamura約14年前に更新

  • 進捗率50 から 70 に変更
動作確認しました。とくに問題ありません。
  1. dependencies.yml.sampleが作成されるか
  2. 依存性チェックがされるか

#8 Kousuke Ebihara約14年前に更新

  • ステータスPending Review(レビュー待ち) から Fixed(完了) に変更
  • 進捗率70 から 100 に変更

他の形式にエクスポート: Atom PDF