[WP-Plugins]WP-Pears-1.0
2008.02.27
[ English ][ Japanese ]
“WP-Pears” is a plugin to use PEAR.
This plugin offers the folder that puts the PEAR library.
Installation
- Download wp-pears-1.0.zip.
- Unpack/upload the "wp-pears" into "wp-content/plugins/".
- Activate the plugin from the Admin interface; "Plugins".
- You put the pear library which you need into "wp-content/plugins/wp-pears".
- You do include/require like a normal pear library.
- < ?php
- include_once('sample.php');
- if( function_exists('hellow_world')){ hellow_world(); }
- else{ echo "NG"; }
- ?>
NoteI include “sample.php” in WP-Pears.
ここから日本語
WP-Pearsは、PEARを利用できるようにするためのプラグインです。
このプラグインは、PEARライブラリを置くフォルダを提供します。
インストール
- wp-IniFileLoad-1.0.zip をダウンロードします。
- 解凍した「wp-IniFileLoad.php」を 「wp-content/plugins/」に入れます。
- 管理画面の「プラグイン」にて、このプラグインを有効にします。
- あなたが利用中のテーマか「wp-content/themes/common/」にINIファイルを入れます。
- 関数「wp_load_inifile(INIファイル名)」を使って連想配列として読み込みます
- wp-pears-1.0.zip をダウンロードします。
- 解凍した「wp-pears」を 「wp-content/plugins/」に入れます。
- 管理画面の「プラグイン」にて、このプラグインを有効にします。
- 「wp-content/plugins/wp-pears」の中に必要とするPEARライブラリを置きます。
- 通常のPEARライブラリと同様にinclude/requireしてください。
使用例は上記 Example を見てください。
作った理由
他の方が作ったプラグインを見ていたら、PEARを含むのはいいのですが…
PEARがそのプラグイン専用で置かれていて、再利用しづらかったり…
PEARのバージョン管理が難しかったり…
レンタルサーバを借りていると、PEARライブラリを利用したくても置き場所に困ります。
特に他のPHPアプリケーション(たとえばXOOPSなど)を利用していると下手にPEAR置場を作ることができません。
もちろんその都度、パスを切ってもいいのですが…
といろいろとPEAR置き場に困ったわけです。
ならば、WordPressでPEARの置き場はここと決めてはどうか…と考えて作ったのがこのプラグインです。


1 Comment Add your own
1. サイト制作者の日&hellip | 5月 27th, 2009 at 7:28 PM
[...] http://www.belive.jp/archives/wp-pears-1_0/#exp wordpressでpearを使うプラグイン Comment (RSS) | トラックバック [...]
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed