symfony Archive
[ symfony ] symfony 1.0 と 新しめのPEARの組み合わせで起きる、プラグインインストール時のエラー
エントリタイトルが糞長ぇ!
タイトルの通り、symfony 1.0と最近のバージョン(あやふやw)で起きる、symfony pluginインストール時のエラーです。
CentOS 5.3 i386/PEAR 1.9.0/symfony 1.0.22-PREの環境で発生。
symfonyプラグインのインストールでエラーがでた場合 | symfonyで開発Blog
同様の現象がこちらでも起きているんですが、こちらとちょっと違って前衛的な対処法です。
安全性は上記エントリのがバツグンにあるんで、上記のがオススメです。
プラグインインストール時のエラーは上記エントリと同様です。 一部パスを隠してます。
PHP Warning: require_once(PEAR/Remote.php): failed to open stream: No such file or directory in /usr/share/pear/symfony1.0/data/tasks/sfPakePlugins.php on line 155
Warning: require_once(PEAR/Remote.php): failed to open stream: No such file or directory in /usr/share/pear/symfony1.0/data/tasks/sfPakePlugins.php on line 155
PHP Fatal error: require_once(): Failed opening required ‘PEAR/Remote.php’ (include_path=’/var/www/documentroot/lib:/var/www/documentroot/apps//lib:
:/usr/share/pear/symfony1.0/lib/vendor:.:/usr/share/pear:/usr/share/php’)
in /usr/share/pear/symfony1.0/data/tasks/sfPakePlugins.php on line 155
Fatal error: require_once(): Failed opening required ‘PEAR/Remote.php’ (include_path=’/var/www/documentroot/lib:/var/www/documentroot/
apps//lib::/usr/share/pear/symfony1.0/lib/vendor:.:/usr/share/pear:/usr/share/php’)
in /usr/share/pear/symfony1.0/data/tasks/sfPakePlugins.php on line 155
要は、Remote.phpが見つからない、と。
で、上記エントリではRemote.phpが無いと書かれてますが、実はあるんです。 たぶん同じものが、
PEAR/Command/Remote.php
ここにありまする。
DIFF取ったわけじゃないけどたぶん同じです。
んで、Remote.phpは
/usr/share/pear/symfony1.0/data/tasks/sfPakePlugins.php
から呼び出されようとしています。
なのでこのファイルの155行目付近にある
require_once ‘PEAR/Remote.php’;
という行を
require_once ‘PEAR/Command/Remote.php’;
と書き換えるだけでもいけます。
symfonyのコアファイルに手を入れるのはちょっとあれなので、
/path/to/PEAR/Remote.php というシンボリックリンクを貼ってもよかと思います。 これでも通りました。
symfonyが悪いというわけではなく、PEARが易々とファイル構造を変えるのがイカンですな。
でもって追従出来てないsymfonyもちょっといかんー。
公式フォーラムにもこの件があるっちゃあるんですが・・・この有様だよ
- Comments: 0
- Trackbacks: 0
[ symfony ] view.ymlのstylesheets設定で複数のオプションをつける
view.ymlのstylesheetsでcssを設定することが出来ます。
オプションの設定はマニュアルに載ってますが複数のオプションの設定が無かったので補足。
まぁ、カンマ繋ぎするだけです。
stylesheets: [main, print: {media: print}]
↓
ソフトバンク端末絡みでview.ymlは使えなさそうだなぁ。。どうしようかな。 Actionで設定するしかないのかな。
もしくはinclude_stylesheets()/get_stylesheets()時に文字列をreplaceするとか。。スマートじゃないけど。
- Comments: 0
- Trackbacks: 0
[ symfony ] symfonyのcomponents.class.phpを分割する
前回のactions.class.php分割に引き続き・・・というか全く同じです。
symfony 1.0なので微妙に1.1や1.2では違うかもしれません。 そこだけ注意。
symfonyはページのサイドペインなどをコンポーネント化させることが出来ます。
うちの会社だとヘッダ・フッタ・レフトペイン・ライトペインをコンポーネント化し、真ん中だけをxxxxSuccess.phpに書いています。
コンポーネントはcomponentsモジュール/actionsアクションにcomponents.class.phpという名前で置く必要があります。
中身はこんな感じ。
class componentsComponents extends sfComponents{
public function executeHeader()
{}
public function executeFooter()
{}
public function executeLeftPane()
{}
public function executeRightPane()
{}
}
分割の際の命名ルールはアクションと全く同様です。
コンポーネント名Component.class.php です。
アクションのときはComponentではなく、hogeAction.class.phpでしたね。
それぞれのコンポーネントは
headerComponent.class.php
footerComponent.class.php
leftPaneComponent.class.php
rightPaneComponent.class.php
となります。
クラス名もそれぞれ
headerComponent
footerComponent
leftPaneComponent
rightPaneComponent
となります。 継承はsfComponentsです。
アクション同様、components.class.phpと両方に同じコンポーネントがある場合は分割されたものが使用されるようです。
実行部分はexecute()内に書けばいんですが、validate()やhandleError()が使えるかどうかは今の所未確認。
その内確認しときまーす。
てか、この辺のことってマニュアルに書いてないような気がするんだけど、見落としですかな・・・。
- Comments: 0
- Trackbacks: 0
- Search
- Feeds
- Meta