web: 2008年11月アーカイブ

PEAR::MDB2

| | コメント(0) | トラックバック(0)

PHPでデーターベースを操作するクラスにPEARの「MDB2」があります。

ますはインストール

----------------------------------

pear install MDB2

----------------------------------

PEAR::MDB2では、各DB用のドライバをイン ストールする必要がる。
これらのインストールもPEARコマンドで行える。

----------------------------------

pear install MDB2_Driver_mysql

----------------------------------

これでPEARの「MDB2」が使えるようになる。

 

PEAR

| | コメント(0) | トラックバック(0)

PHP用のライブラリであるPEARをインストールための、PEARパッケージマネージャーのインストールします。

PEARのインストール

コマンドプロンプトを立ち上げてPHPをインストールしたディレクトリに移動する。

そして次のように実行する。

------------------------------

go-pear.bat

-----------------------------

Enterキーを押すとインストールが始まる。

--------------------------------------------------

Are you installing a system-wide PEAR or a local copy?
(system|local) [system] :

--------------------------------------------------

「system」又は「local」を選択する。
今回は「system」のままにしますのでEnterキーを押す。

--------------------------------------------------

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : c:\php
 2. Temporary directory for processing            : c:\php\tmp
 3. Temporary directory for downloads             : c:\php\tmp
 4. Binaries directory                            : c:\php
 5. PHP code directory ($php_dir)                 : c:\php\pear
 6. Documentation directory                       : c:\php\docs
 7. Data directory                                : c:\php\data
 8. User-modifiable configuration files directory : c:\php\cfg
 9. Public Web Files directory                    : c:\php\www
10. Tests directory                               : c:\php\tests
11. Name of configuration file                    : C:\Windows\pear.ini
12. Path to CLI php.exe                           : c:\php\.

1-12, 'all' or Enter to continue:

--------------------------------------------------

PEARのインストールに伴って設置されるファイルの位置を指定する画面が出る。
今回はデフォルトのままにしますので単にEnterキーを押す。
もし変更してければ、その番号を入力してEnterキーを押し変更する。

---------------------------------------------------

PEAR: To install optional features use "pear install pear/PEAR#featurename"

******************************************************************************
WARNING!  The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
<c:\php\pear>
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages working.


Would you like to alter php.ini <C:\php\php.ini>? [Y/n] :

-----------------------------------------------------

PEARに関する設定を「php.ini」に追加するかどうの質問が出る。
ここでは「Y」を押して書き換えるようにする。

-----------------------------------------------------

php.ini <C:\php\php.ini> include_path updated.

Current include path           : .;C:\php5\pear
Configured directory           : c:\php\pear
Currently used php.ini (guess) : C:\php\php.ini
Press Enter to continue:

------------------------------------------------------

確認画面が出るのでEnterキーを押す。

------------------------------------------------------

** WARNING! Old version found at c:\php, please remove it or be sure to use the
new c:\php\pear.bat command

The 'pear' command is now at your service at c:\php\pear.bat


* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under c:\php\PEAR_ENV.reg .
This file creates ENV variables for the current user.

Double-click this file to add it to the current user registry.

続行するには何かキーを押してください . . .

-------------------------------------------------------  

PEARに関する情報などが表示される。
キーを押せばインストールは終了。

 

php.iniの確認

PEARパッケージマネージャーのインストール時に「php.ini」の自動書き換えを選択した場合に「php.ini」ファイルの一番最後にインクルードパスに関する設定が追加されている。

;***** Added by go-pear
include_path=".;c:\php\pear"
;*****

ドキュメントのダウンロード

PEARのドキュメントはhttp://pear.php.net/からダウンロードできる。

 

 

スタイルシートで

height: auto;

と指定してブラウザで見ると中身が少ない時は背景が縮んでしまって見た目が悪い。
それを解消し、あらかじめ最低の高さをキープしておくためのプロパティがmini-heightである。
ひじょうに便利なものであるが、このプロパティは残念な事にIE6には対応いない。

とは言え、現在IE利用者の半分くらいはEI6を使われている現状では無視できない。
なにか得策はないかと探して見るとあった。

それは、「minmax.js」である。
これを適応すると

  • min-height
    高さの最低値をあらかじめ指定
  • max-height
    高さの最高値をあらかじめ指定
  • min-width
    幅の最低値をあらかじめ指定
  • max-width
    幅の最高値をあらかじめ指定

が有効になるらしい。

まずはjsファイルをダウンロードする。

ダウンロードしたminmax.jsをはここに置いた。

そして、htmlのhead内にjsファイルを読み込んで完了である。

<script type="text/javascript" src="./minmax.js"></script> 

 

KUMAOの押入TOP

カウンタ

Twitter

books

このアーカイブについて

このページには、2008年11月以降に書かれたブログ記事のうちwebカテゴリに属しているものが含まれています。

前のアーカイブはweb: 2008年8月です。

次のアーカイブはweb: 2008年12月です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。

にほんブログ村 IT技術ブログへ
無料テンプレートならテンプレートキング

books