cvs: phpdoc /ja/functions mhash.xml ming.xml misc.xml mnogosearch.xml msql.xml mssql.xml mysql.xml network.xml

From: Date: Sat, 26 Jan 2002 08:55:52 +0000
Subject: cvs: phpdoc /ja/functions mhash.xml ming.xml misc.xml mnogosearch.xml msql.xml mssql.xml mysql.xml network.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969341628@lists.php.net to get a copy of this message
hirokawa Sat Jan 26 03:55:52 2002 EDT Modified files: /phpdoc/ja/functions mhash.xml ming.xml misc.xml mnogosearch.xml msql.xml mssql.xml mysql.xml network.xml Log: fixed typos and changed script code based on php notation rule.

Index: phpdoc/ja/functions/mhash.xml diff -u phpdoc/ja/functions/mhash.xml:1.10 phpdoc/ja/functions/mhash.xml:1.11 --- phpdoc/ja/functions/mhash.xml:1.10 Wed Dec 12 15:53:18 2001 +++ phpdoc/ja/functions/mhash.xml Sat Jan 26 03:55:51 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.11 $ --> <reference id="ref.mhash"> <title>Mhash関数</title> <titleabbrev>mhash</titleabbrev> @@ -29,30 +30,35 @@ <example> <title>MD5ダイジェストとhmacを計算し、16進数で出力する</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $input = "what do ya want for nothing?"; $hash = mhash (MHASH_MD5, $input); -print "The hash is ".bin2hex ($hash)."\n&lt;br>"; +print "The hash is ".bin2hex ($hash)."<br />\n"; $hash = mhash (MHASH_MD5, $input, "Jefe"); -print "The hmac is ".bin2hex ($hash)."\n&lt;br>"; -?&gt; +print "The hmac is ".bin2hex ($hash)."<br />\n"; +?> +]]> </programlisting> - </example> - この例の出力は次のようになります。 - <programlisting> + <para> + この例の出力は次のようになります。 + <screen> +<![CDATA[ The hash is d03cb659cbf9192dcd066272249f8412 The hmac is 750c783e6ab0b503eaa86e310a5db738 - </programlisting> - サポートされるハッシュの完全なリストについては、mhashのドキュメントを - 参照下さい。 - PHPから特定のハッシュアルゴリズムにアクセスするには、「MHASH_ハッシュ名」 - を指定します。例えば、TIGERにアクセスするには、PHP定数 MHASH_TIGER - を使用します。 +]]> + </screen> + </para> + </example> + サポートされるハッシュの完全なリストについては、mhashのドキュメ + ントを参照下さい。PHPから特定のハッシュアルゴリズムにアクセスす + るには、「MHASH_ハッシュ名」を指定します。例えば、TIGERにアクセ + スするには、PHP定数 MHASH_TIGERを使用します。 </para> <para> 以下に現在mhashによりサポートされているハッシュの一覧を示します。 - mhashにサポートされているハッシュが、このリストにない場合は、 - このドキュメントが古いと仮定して下さい。 + mhashにサポートされているハッシュが、このリストにない場合は、こ + のドキュメントが古いと仮定して下さい。 <itemizedlist> <listitem> <simpara> @@ -139,17 +145,23 @@ <example> <title><function>mhash_get_hash_name</function>の例</title> <programlisting> -&lt;?php +<![CDATA[ +<?php $hash = MHASH_MD5; print mhash_get_hash_name ($hash); -?&gt; +?> +]]> </programlisting> + <para> + 上の例の出力は次のようになります。 + <screen> +<![CDATA[ + MD5 +]]> + </screen> + </para> </example> - 上の例の出力は次のようになります。 - <programlisting> -MD5 - </programlisting> </para> </refsect1> </refentry> @@ -190,7 +202,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>mhash_count</function></funcdef> - <paramdef>void </paramdef> + <void/> </funcprototype> </funcsynopsis> <para> @@ -201,16 +213,18 @@ <example> <title>全ハッシュをループする</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $nr = mhash_count(); -for ($i = 0; $i &lt;= $nr; $i++) { +for ($i = 0; $i <= $nr; $i++) { echo sprintf ("The blocksize of %s is %d\n", - mhash_get_hash_name ($i), - mhash_get_block_size ($i)); + mhash_get_hash_name ($i), + mhash_get_block_size ($i)); } -?&gt; +?> +]]> </programlisting> </example> </para> @@ -240,7 +254,7 @@ <function>mhash</function>は、<parameter>data</parameter>に <parameter>hash</parameter>で指定したハッシュ関数を適用し、 (ダイジェストとも呼ばれる)ハッシュを返します。 - <parameter> key</parameter> が指定されていた場合、結果としてHMAC + <parameter>key</parameter> が指定されていた場合、結果としてHMAC が返されます。HMACは、メッセージ認証時はキーに基づくハッシュ、また は指定したキーに基づく単なるメッセージダイジェストです。mhashでサ ポートされている全てのアルゴリズムがHMACモードで使用できるわけで Index: phpdoc/ja/functions/ming.xml diff -u phpdoc/ja/functions/ming.xml:1.9 phpdoc/ja/functions/ming.xml:1.10 --- phpdoc/ja/functions/ming.xml:1.9 Wed Dec 12 15:53:19 2001 +++ phpdoc/ja/functions/ming.xml Sat Jan 26 03:55:51 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.10 $ --> <reference id="ref.ming"> <title>Flash 用 Ming 関数</title> <titleabbrev>Ming (flash)</titleabbrev> @@ -66,13 +67,17 @@ <sect2 id="ming.install.php.unix"> <title>PHP (unix) に組み込む</title> <para> - <literallayout> - mkdir &lt;phpdir>/ext/ming - cp php_ext/* &lt;phpdir>/ext/ming - cd &lt;phpdir> + <informalexample> + <literallayout> +<![CDATA[ + mkdir <phpdir>/ext/ming + cp php_ext/* <phpdir>/ext/ming + cd <phpdir> ./buildconf - ./configure --with-ming &lt;other config options&gt; - </literallayout> + ./configure --with-ming <other config options> +]]> + </literallayout> + </informalexample> PHP を通常と同様に構築、インストールして下さい。必要ならば Web サーバを再起動して下さい。 </para> @@ -168,6 +173,90 @@ </itemizedlist> </sect1> </partintro> + + <refentry id='function.ming-setcubicthreshold'> + <refnamediv> + <refname>ming_setcubicthreshold</refname> + <refpurpose> + Set cubic threshold (?) + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>ming_setcubicthreshold</function></funcdef> + <paramdef>int <parameter>threshold</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.ming-setscale'> + <refnamediv> + <refname>ming_setscale</refname> + <refpurpose> + Set scale (?) + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>ming_setscale</function></funcdef> + <paramdef>int <parameter>scale</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.ming-useswfversion'> + <refnamediv> + <refname>ming_useswfversion</refname> + <refpurpose> + Use SWF version (?) + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>ming_useswfversion</function></funcdef> + <paramdef>int <parameter>version</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.swfbutton-keypress'> + <refnamediv> + <refname>swfbutton_keypress</refname> + <refpurpose> + Returns the action flag for keyPress(char) + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>swfbutton_keypress</function></funcdef> + <paramdef>string <parameter>str</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> <!-- SWFMovie --> @@ -183,9 +272,10 @@ <funcsynopsis> <funcprototype> <funcdef>new <function>swfmovie</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfmovie</function> は、SWFバージョン4ムービー形式で新た にムービーオブジェクトを作成します。 @@ -221,7 +311,7 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->output</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> <para> @@ -229,9 +319,11 @@ します。PHP では、この前に次のコマンドを実行することにより、ブラ ウザにflashムービーが出力されます。 <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php header('Content-type: application/x-shockwave-flash'); -?&gt; +?> +]]> </programlisting> </para> <simpara> @@ -259,6 +351,7 @@ <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfmovie->save</function> は、ムービーを <parameter>filename</parameter> という名前のファイルに保存します。 @@ -323,6 +416,7 @@ <paramdef>ressource <parameter>instance</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfmovie->remove</function> は、表示リストからオブジェ クトのインスタンス <parameter>instance</parameter>を削除します。 @@ -348,6 +442,7 @@ <paramdef>int <parameter>blue</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfmovie->setbackground</function>は背景色を設定します。 Why is @@ -373,6 +468,7 @@ <paramdef>int <parameter>rate</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>nom_de_la_fonction</function> sets the frame rate to <parameter>rate</parameter>, in frame per seconds. @@ -397,6 +493,7 @@ <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfmovie->setdimension</function> は、ムービーの幅を <parameter>width</parameter> に、高さを @@ -418,6 +515,7 @@ <paramdef>string <parameter>numberofframes</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfmovie->setframes</function> sets the total number of frames in the animation to <parameter>numberofframes</parameter>. @@ -435,9 +533,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->nextframe</function></funcdef> - <paramdef>void </paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfmovie->setframes</function> moves to the next frame of the animation. @@ -458,6 +557,7 @@ <paramdef>string <parameter>mp3FileName</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfmovie->streammp3</function> streams the mp3 file <parameter>mp3FileName</parameter>. Not very robust in dealing with @@ -476,18 +576,20 @@ <example> <title><function>swfmovie->streammp3</function> の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $m = new SWFMovie(); - $m-&gt;setRate(12.0); - $m-&gt;streamMp3("distortobass.mp3"); -// use your own MP3 + $m->setRate(12.0); + $m->streamMp3("distortobass.mp3"); + // use your own MP3 // 11.85 seconds at 12.0 fps = 142 frames - $m-&gt;setFrames(142); + $m->setFrames(142); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -506,9 +608,10 @@ <funcsynopsis> <funcprototype> <funcdef>new <function>swfdisplayitem</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem</function> creates a new swfdisplayitem object. </para> @@ -545,6 +648,7 @@ <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->moveto</function> moves the current object to (<parameter>x</parameter>,<parameter>y</parameter>) in global coordinates. @@ -575,6 +679,7 @@ <paramdef>int <parameter>dy</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->move</function> moves the current object by (<parameter>dx</parameter>,<parameter>dy</parameter>) from its @@ -606,6 +711,7 @@ <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->scaleto</function> scales the current object to (<parameter>x</parameter>,<parameter>y</parameter>) in global coordinates. @@ -636,6 +742,7 @@ <paramdef>int <parameter>dy</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->scale</function> scales the current object by (<parameter>dx</parameter>,<parameter>dy</parameter>) from its @@ -663,9 +770,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->rotateto</function></funcdef> - <paramdef>double <parameter>degrees</parameter></paramdef> + <paramdef>float <parameter>degrees</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->rotateto</function> set the current object rotation to <parameter>degrees</parameter> degrees in global coordinates. @@ -682,15 +790,16 @@ <example> <title><function>swfdisplayitem->rotateto</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $thetext = "ming!"; $f = new SWFFont("Bauhaus 93.fdb"); $m = new SWFMovie(); - $m-&gt;setRate(24.0); - $m-&gt;setDimension(2400, 1600); - $m-&gt;setBackground(0xff, 0xff, 0xff); + $m->setRate(24.0); + $m->setDimension(2400, 1600); + $m->setBackground(0xff, 0xff, 0xff); // functions with huge numbers of arbitrary // arguments are always a good idea! Really! @@ -700,23 +809,23 @@ global $f, $m; $t = new SWFText(); - $t-&gt;setFont($f); - $t-&gt;setColor($r, $g, $b, $a); - $t-&gt;setHeight(960); - $t-&gt;moveTo(-($f-&gt;getWidth($string))/2, $f-&gt;getAscent()/2); - $t-&gt;addString($string); + $t->setFont($f); + $t->setColor($r, $g, $b, $a); + $t->setHeight(960); + $t->moveTo(-($f->getWidth($string))/2, $f->getAscent()/2); + $t->addString($string); // we can add properties just like a normal php var, // as long as the names aren't already used. - // e.g., we can't set $i-&gt;scale, because that's a function + // e.g., we can't set $i->scale, because that's a function - $i = $m-&gt;add($t); - $i-&gt;x = $x; - $i-&gt;y = $y; - $i-&gt;rot = $rot; - $i-&gt;s = $scale; - $i-&gt;rotateTo($rot); - $i-&gt;scale($scale, $scale); + $i = $m->add($t); + $i->x = $x; + $i->y = $y; + $i->rot = $rot; + $i->s = $scale; + $i->rotateTo($rot); + $i->scale($scale, $scale); // but the changes are local to the function, so we have to // return the changed object. kinda weird.. @@ -726,15 +835,15 @@ function step($i) { - $oldrot = $i-&gt;rot; - $i-&gt;rot = 19*$i-&gt;rot/20; - $i-&gt;x = (19*$i-&gt;x + 1200)/20; - $i-&gt;y = (19*$i-&gt;y + 800)/20; - $i-&gt;s = (19*$i-&gt;s + 1.0)/20; - - $i-&gt;rotateTo($i-&gt;rot); - $i-&gt;scaleTo($i-&gt;s, $i-&gt;s); - $i-&gt;moveTo($i-&gt;x, $i-&gt;y); + $oldrot = $i->rot; + $i->rot = 19*$i->rot/20; + $i->x = (19*$i->x + 1200)/20; + $i->y = (19*$i->y + 800)/20; + $i->s = (19*$i->s + 1.0)/20; + + $i->rotateTo($i->rot); + $i->scaleTo($i->s, $i->s); + $i->moveTo($i->x, $i->y); return $i; } @@ -745,18 +854,19 @@ $i2 = text(0x00, 0x33, 0xff, 0x7f, -560, 1200, 800, 0.04, $thetext); $i3 = text(0xff, 0xff, 0xff, 0x9f, 180, 1200, 800, 0.001, $thetext); - for($i=1; $i&lt;=100; ++$i) + for($i=1; $i<=100; ++$i) { $i1 = step($i1); $i2 = step($i2); $i3 = step($i3); - $m-&gt;nextFrame(); + $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -776,9 +886,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->rotate</function></funcdef> - <paramdef>double <parameter>ddegrees</parameter></paramdef> + <paramdef>float <parameter>ddegrees</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->rotate</function> rotates the current object by <parameter>ddegrees</parameter> degrees from its current rotation. @@ -805,9 +916,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->skewxto</function></funcdef> - <paramdef>double <parameter>degrees</parameter></paramdef> + <paramdef>float <parameter>degrees</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->skewxto</function> sets the x-skew to <parameter>degrees</parameter>. For <parameter>degrees</parameter> @@ -838,9 +950,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->skewx</function></funcdef> - <paramdef>double <parameter>ddegrees</parameter></paramdef> + <paramdef>float <parameter>ddegrees</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->skewx</function> adds <parameter>ddegrees</parameter> to current x-skew. @@ -869,9 +982,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->skewyto</function></funcdef> - <paramdef>double <parameter>degrees</parameter></paramdef> + <paramdef>float <parameter>degrees</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->skewyto</function> sets the y-skew to <parameter>degrees</parameter>. For <parameter>degrees</parameter> @@ -902,9 +1016,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->skewy</function></funcdef> - <paramdef>double <parameter>ddegrees</parameter></paramdef> + <paramdef>float <parameter>ddegrees</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->skewy</function> adds <parameter>ddegrees</parameter> to current y-skew. @@ -933,7 +1048,7 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->setdepth</function></funcdef> - <paramdef>double <parameter>depth</parameter></paramdef> + <paramdef>float <parameter>depth</parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -962,9 +1077,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->remove</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->remove</function> removes this object from the movie's display list. @@ -994,6 +1110,7 @@ <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->setname</function> sets the object's name to <parameter>name</parameter>, for targetting with action script. @@ -1018,9 +1135,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->setratio</function></funcdef> - <paramdef>double <parameter>ratio</parameter></paramdef> + <paramdef>float <parameter>ratio</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->setratio</function> sets the object's ratio to <parameter>ratio</parameter>. Obviously only useful for morphs. @@ -1036,63 +1154,65 @@ <example> <title><function>swfdisplayitem->setname</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $p = new SWFMorph(); $g = new SWFGradient(); - $g-&gt;addEntry(0.0, 0, 0, 0); - $g-&gt;addEntry(0.16, 0xff, 0xff, 0xff); - $g-&gt;addEntry(0.32, 0, 0, 0); - $g-&gt;addEntry(0.48, 0xff, 0xff, 0xff); - $g-&gt;addEntry(0.64, 0, 0, 0); - $g-&gt;addEntry(0.80, 0xff, 0xff, 0xff); - $g-&gt;addEntry(1.00, 0, 0, 0); - - $s = $p-&gt;getShape1(); - $f = $s-&gt;addFill($g, SWFFILL_RADIAL_GRADIENT); - $f-&gt;scaleTo(0.05); - $s-&gt;setLeftFill($f); - $s-&gt;movePenTo(-160, -120); - $s-&gt;drawLine(320, 0); - $s-&gt;drawLine(0, 240); - $s-&gt;drawLine(-320, 0); - $s-&gt;drawLine(0, -240); + $g->addEntry(0.0, 0, 0, 0); + $g->addEntry(0.16, 0xff, 0xff, 0xff); + $g->addEntry(0.32, 0, 0, 0); + $g->addEntry(0.48, 0xff, 0xff, 0xff); + $g->addEntry(0.64, 0, 0, 0); + $g->addEntry(0.80, 0xff, 0xff, 0xff); + $g->addEntry(1.00, 0, 0, 0); + + $s = $p->getShape1(); + $f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); + $f->scaleTo(0.05); + $s->setLeftFill($f); + $s->movePenTo(-160, -120); + $s->drawLine(320, 0); + $s->drawLine(0, 240); + $s->drawLine(-320, 0); + $s->drawLine(0, -240); $g = new SWFGradient(); - $g-&gt;addEntry(0.0, 0, 0, 0); - $g-&gt;addEntry(0.16, 0xff, 0, 0); - $g-&gt;addEntry(0.32, 0, 0, 0); - $g-&gt;addEntry(0.48, 0, 0xff, 0); - $g-&gt;addEntry(0.64, 0, 0, 0); - $g-&gt;addEntry(0.80, 0, 0, 0xff); - $g-&gt;addEntry(1.00, 0, 0, 0); - - $s = $p-&gt;getShape2(); - $f = $s-&gt;addFill($g, SWFFILL_RADIAL_GRADIENT); - $f-&gt;scaleTo(0.05); - $f-&gt;skewXTo(1.0); - $s-&gt;setLeftFill($f); - $s-&gt;movePenTo(-160, -120); - $s-&gt;drawLine(320, 0); - $s-&gt;drawLine(0, 240); - $s-&gt;drawLine(-320, 0); - $s-&gt;drawLine(0, -240); + $g->addEntry(0.0, 0, 0, 0); + $g->addEntry(0.16, 0xff, 0, 0); + $g->addEntry(0.32, 0, 0, 0); + $g->addEntry(0.48, 0, 0xff, 0); + $g->addEntry(0.64, 0, 0, 0); + $g->addEntry(0.80, 0, 0, 0xff); + $g->addEntry(1.00, 0, 0, 0); + + $s = $p->getShape2(); + $f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); + $f->scaleTo(0.05); + $f->skewXTo(1.0); + $s->setLeftFill($f); + $s->movePenTo(-160, -120); + $s->drawLine(320, 0); + $s->drawLine(0, 240); + $s->drawLine(-320, 0); + $s->drawLine(0, -240); $m = new SWFMovie(); - $m-&gt;setDimension(320, 240); - $i = $m-&gt;add($p); - $i-&gt;moveTo(160, 120); + $m->setDimension(320, 240); + $i = $m->add($p); + $i->moveTo(160, 120); - for($n=0; $n&lt;=1.001; $n+=0.01) + for($n=0; $n<=1.001; $n+=0.01) { - $i-&gt;setRatio($n); - $m-&gt;nextFrame(); + $i->setRatio($n); + $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -1111,20 +1231,21 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->addcolor</function></funcdef> - <paramdef>integer + <paramdef>int <parameter><optional>red</optional></parameter> </paramdef> - <paramdef>integer + <paramdef>int <parameter><optional>green</optional></parameter> </paramdef> - <paramdef>integer + <paramdef>int <parameter><optional>blue</optional></parameter> </paramdef> - <paramdef>integer + <paramdef>int <parameter><optional>a</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->addcolor</function> adds the color to this item's color transform. The color is given in its RGB form. @@ -1148,20 +1269,21 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->multcolor</function></funcdef> - <paramdef>integer + <paramdef>int <parameter><optional>red</optional></parameter> </paramdef> - <paramdef>integer + <paramdef>int <parameter><optional>green</optional></parameter> </paramdef> - <paramdef>integer + <paramdef>int <parameter><optional>blue</optional></parameter> </paramdef> - <paramdef>integer + <paramdef>int <parameter><optional>a</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfdisplayitem->multcolor</function> multiplies the item's color transform by the given values. @@ -1178,32 +1300,34 @@ <example> <title><function>swfdisplayitem->multcolor</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $b = new SWFBitmap("backyard.jpg"); // note use your own picture :-) $s = new SWFShape(); - $s-&gt;setRightFill($s-&gt;addFill($b)); - $s-&gt;drawLine($b-&gt;getWidth(), 0); - $s-&gt;drawLine(0, $b-&gt;getHeight()); - $s-&gt;drawLine(-$b-&gt;getWidth(), 0); - $s-&gt;drawLine(0, -$b-&gt;getHeight()); + $s->setRightFill($s->addFill($b)); + $s->drawLine($b->getWidth(), 0); + $s->drawLine(0, $b->getHeight()); + $s->drawLine(-$b->getWidth(), 0); + $s->drawLine(0, -$b->getHeight()); $m = new SWFMovie(); - $m-&gt;setDimension($b-&gt;getWidth(), $b-&gt;getHeight()); + $m->setDimension($b->getWidth(), $b->getHeight()); - $i = $m-&gt;add($s); + $i = $m->add($s); - for($n=0; $n&lt;=20; ++$n) + for($n=0; $n<=20; ++$n) { - $i-&gt;multColor(1.0-$n/10, 1.0, 1.0); - $i-&gt;addColor(0xff*$n/20, 0, 0); - $m-&gt;nextFrame(); + $i->multColor(1.0-$n/10, 1.0, 1.0); + $i->addColor(0xff*$n/20, 0, 0); + $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -1222,9 +1346,10 @@ <funcsynopsis> <funcprototype> <funcdef>new <function>swfshape</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfshape</function> creates a new shape object. </para> @@ -1241,24 +1366,26 @@ <example> <title><function>swfshape</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $s = new SWFShape(); - $s-&gt;setLine(40, 0x7f, 0, 0); - $s-&gt;setRightFill($s-&gt;addFill(0xff, 0, 0)); - $s-&gt;movePenTo(200, 200); - $s-&gt;drawLineTo(6200, 200); - $s-&gt;drawLineTo(6200, 4600); - $s-&gt;drawCurveTo(200, 4600, 200, 200); + $s->setLine(40, 0x7f, 0, 0); + $s->setRightFill($s->addFill(0xff, 0, 0)); + $s->movePenTo(200, 200); + $s->drawLineTo(6200, 200); + $s->drawLineTo(6200, 4600); + $s->drawCurveTo(200, 4600, 200, 200); $m = new SWFMovie(); - $m-&gt;setDimension(6400, 4800); - $m-&gt;setRate(12.0); - $m-&gt;add($s); - $m-&gt;nextFrame(); + $m->setDimension(6400, 4800); + $m->setRate(12.0); + $m->add($s); + $m->nextFrame(); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -1276,12 +1403,13 @@ <funcprototype> <funcdef>void <function>swfshape->setline</function></funcdef> <paramdef>int <parameter>width</parameter></paramdef> - <paramdef>integer <parameter><optional>red</optional></parameter></paramdef> - <paramdef>integer <parameter><optional>green</optional></parameter></paramdef> - <paramdef>integer <parameter><optional>blue</optional></parameter></paramdef> - <paramdef>integer <parameter><optional>a</optional></parameter></paramdef> + <paramdef>int <parameter><optional>red</optional></parameter></paramdef> + <paramdef>int <parameter><optional>green</optional></parameter></paramdef> + <paramdef>int <parameter><optional>blue</optional></parameter></paramdef> + <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfshape->setline</function> sets the shape's line style. <parameter>width</parameter> is the line's width. If <parameter>width</parameter> @@ -1303,56 +1431,58 @@ <example> <title><function>swfshape->setline</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $s = new SWFShape(); - $f1 = $s-&gt;addFill(0xff, 0, 0); - $f2 = $s-&gt;addFill(0xff, 0x7f, 0); - $f3 = $s-&gt;addFill(0xff, 0xff, 0); - $f4 = $s-&gt;addFill(0, 0xff, 0); - $f5 = $s-&gt;addFill(0, 0, 0xff); + $f1 = $s->addFill(0xff, 0, 0); + $f2 = $s->addFill(0xff, 0x7f, 0); + $f3 = $s->addFill(0xff, 0xff, 0); + $f4 = $s->addFill(0, 0xff, 0); + $f5 = $s->addFill(0, 0, 0xff); // bug: have to declare all line styles before you use them - $s-&gt;setLine(40, 0x7f, 0, 0); - $s-&gt;setLine(40, 0x7f, 0x3f, 0); - $s-&gt;setLine(40, 0x7f, 0x7f, 0); - $s-&gt;setLine(40, 0, 0x7f, 0); - $s-&gt;setLine(40, 0, 0, 0x7f); + $s->setLine(40, 0x7f, 0, 0); + $s->setLine(40, 0x7f, 0x3f, 0); + $s->setLine(40, 0x7f, 0x7f, 0); + $s->setLine(40, 0, 0x7f, 0); + $s->setLine(40, 0, 0, 0x7f); $f = new SWFFont('Techno.fdb'); - $s-&gt;setRightFill($f1); - $s-&gt;setLine(40, 0x7f, 0, 0); - $s-&gt;drawGlyph($f, '!'); - $s-&gt;movePen($f-&gt;getWidth('!'), 0); - - $s-&gt;setRightFill($f2); - $s-&gt;setLine(40, 0x7f, 0x3f, 0); - $s-&gt;drawGlyph($f, '#'); - $s-&gt;movePen($f-&gt;getWidth('#'), 0); - - $s-&gt;setRightFill($f3); - $s-&gt;setLine(40, 0x7f, 0x7f, 0); - $s-&gt;drawGlyph($f, '%'); - $s-&gt;movePen($f-&gt;getWidth('%'), 0); - - $s-&gt;setRightFill($f4); - $s-&gt;setLine(40, 0, 0x7f, 0); - $s-&gt;drawGlyph($f, '*'); - $s-&gt;movePen($f-&gt;getWidth('*'), 0); - - $s-&gt;setRightFill($f5); - $s-&gt;setLine(40, 0, 0, 0x7f); - $s-&gt;drawGlyph($f, '@'); + $s->setRightFill($f1); + $s->setLine(40, 0x7f, 0, 0); + $s->drawGlyph($f, '!'); + $s->movePen($f->getWidth('!'), 0); + + $s->setRightFill($f2); + $s->setLine(40, 0x7f, 0x3f, 0); + $s->drawGlyph($f, '#'); + $s->movePen($f->getWidth('#'), 0); + + $s->setRightFill($f3); + $s->setLine(40, 0x7f, 0x7f, 0); + $s->drawGlyph($f, '%'); + $s->movePen($f->getWidth('%'), 0); + + $s->setRightFill($f4); + $s->setLine(40, 0, 0x7f, 0); + $s->drawGlyph($f, '*'); + $s->movePen($f->getWidth('*'), 0); + + $s->setRightFill($f5); + $s->setLine(40, 0, 0, 0x7f); + $s->drawGlyph($f, '@'); $m = new SWFMovie(); - $m-&gt;setDimension(3000,2000); - $m-&gt;setRate(12.0); - $i = $m-&gt;add($s); - $i-&gt;moveTo(1500-$f-&gt;getWidth("!#%*@")/2, 1000+$f-&gt;getAscent()/2); + $m->setDimension(3000,2000); + $m->setRate(12.0); + $i = $m->add($s); + $i->moveTo(1500-$f->getWidth("!#%*@")/2, 1000+$f->getAscent()/2); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -1369,32 +1499,35 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->addfill</function></funcdef> - <paramdef>integer <parameter>red</parameter></paramdef> - <paramdef>integer <parameter>green</parameter></paramdef> - <paramdef>integer <parameter>blue</parameter></paramdef> - <paramdef>integer + <paramdef>int <parameter>red</parameter></paramdef> + <paramdef>int <parameter>green</parameter></paramdef> + <paramdef>int <parameter>blue</parameter></paramdef> + <paramdef>int <parameter><optional>a</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->addfill</function></funcdef> <paramdef>SWFbitmap <parameter>bitmap</parameter></paramdef> - <paramdef>integer + <paramdef>int <parameter><optional>flags</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->addfill</function></funcdef> <paramdef>SWFGradient <parameter>gradient</parameter></paramdef> - <paramdef>integer + <paramdef>int <parameter><optional>flags</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfshape->addfill</function> adds a solid fill to the shape's list @@ -1437,54 +1570,56 @@ <example> <title><function>swfshape->addfill</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $p = new SWFMorph(); $b = new SWFBitmap("alphafill.jpg"); // use your own bitmap - $width = $b-&gt;getWidth(); - $height = $b-&gt;getHeight(); + $width = $b->getWidth(); + $height = $b->getHeight(); - $s = $p-&gt;getShape1(); - $f = $s-&gt;addFill($b, SWFFILL_TILED_BITMAP); - $f-&gt;moveTo(-$width/2, -$height/4); - $f-&gt;scaleTo(1.0, 0.5); - $s-&gt;setLeftFill($f); - $s-&gt;movePenTo(-$width/2, -$height/4); - $s-&gt;drawLine($width, 0); - $s-&gt;drawLine(0, $height/2); - $s-&gt;drawLine(-$width, 0); - $s-&gt;drawLine(0, -$height/2); + $s = $p->getShape1(); + $f = $s->addFill($b, SWFFILL_TILED_BITMAP); + $f->moveTo(-$width/2, -$height/4); + $f->scaleTo(1.0, 0.5); + $s->setLeftFill($f); + $s->movePenTo(-$width/2, -$height/4); + $s->drawLine($width, 0); + $s->drawLine(0, $height/2); + $s->drawLine(-$width, 0); + $s->drawLine(0, -$height/2); - $s = $p-&gt;getShape2(); - $f = $s-&gt;addFill($b, SWFFILL_TILED_BITMAP); + $s = $p->getShape2(); + $f = $s->addFill($b, SWFFILL_TILED_BITMAP); // these two have no effect! - $f-&gt;moveTo(-$width/4, -$height/2); - $f-&gt;scaleTo(0.5, 1.0); + $f->moveTo(-$width/4, -$height/2); + $f->scaleTo(0.5, 1.0); - $s-&gt;setLeftFill($f); - $s-&gt;movePenTo(-$width/4, -$height/2); - $s-&gt;drawLine($width/2, 0); - $s-&gt;drawLine(0, $height); - $s-&gt;drawLine(-$width/2, 0); - $s-&gt;drawLine(0, -$height); + $s->setLeftFill($f); + $s->movePenTo(-$width/4, -$height/2); + $s->drawLine($width/2, 0); + $s->drawLine(0, $height); + $s->drawLine(-$width/2, 0); + $s->drawLine(0, -$height); $m = new SWFMovie(); - $m-&gt;setDimension($width, $height); - $i = $m-&gt;add($p); - $i-&gt;moveTo($width/2, $height/2); + $m->setDimension($width, $height); + $i = $m->add($p); + $i->moveTo($width/2, $height/2); - for($n=0; $n&lt;1.001; $n+=0.03) + for($n=0; $n<1.001; $n+=0.03) { - $i-&gt;setRatio($n); - $m-&gt;nextFrame(); + $i->setRatio($n); + $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -1504,17 +1639,19 @@ <paramdef>swfgradient <parameter>fill</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->setleftfill</function></funcdef> - <paramdef>integer <parameter>red</parameter></paramdef> - <paramdef>integer <parameter>green</parameter></paramdef> - <paramdef>integer <parameter>blue</parameter></paramdef> - <paramdef>integer + <paramdef>int <parameter>red</parameter></paramdef> + <paramdef>int <parameter>green</parameter></paramdef> + <paramdef>int <parameter>blue</parameter></paramdef> + <paramdef>int <parameter><optional>a</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> What this nonsense is about is, every edge segment borders at most two fills. When rasterizing the object, it's pretty handy to know what those fills are @@ -1552,17 +1689,19 @@ <paramdef>swfgradient <parameter>fill</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->setrightfill</function></funcdef> - <paramdef>integer <parameter>red</parameter></paramdef> - <paramdef>integer <parameter>green</parameter></paramdef> - <paramdef>integer <parameter>blue</parameter></paramdef> - <paramdef>integer + <paramdef>int <parameter>red</parameter></paramdef> + <paramdef>int <parameter>green</parameter></paramdef> + <paramdef>int <parameter>blue</parameter></paramdef> + <paramdef>int <parameter><optional>a</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <simpara> See also <function>swfshape->setleftfill</function>. </simpara> @@ -1582,10 +1721,11 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->movepento</function></funcdef> - <paramdef>integer <parameter>x</parameter></paramdef> - <paramdef>integer <parameter>y</parameter></paramdef> + <paramdef>int <parameter>x</parameter></paramdef> + <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <simpara> <function>swfshape->setrightfill</function> move the shape's pen to (<parameter>x</parameter>,<parameter>y</parameter>) in the shape's @@ -1611,10 +1751,11 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->movepen</function></funcdef> - <paramdef>integer <parameter>dx</parameter></paramdef> - <paramdef>integer <parameter>dy</parameter></paramdef> + <paramdef>int <parameter>dx</parameter></paramdef> + <paramdef>int <parameter>dy</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <simpara> <function>swfshape->setrightfill</function> move the shape's pen from coordinates (current x,current y) to (current x + <parameter>dx</parameter>, @@ -1640,10 +1781,11 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->drawlineto</function></funcdef> - <paramdef>integer <parameter>x</parameter></paramdef> - <paramdef>integer <parameter>y</parameter></paramdef> + <paramdef>int <parameter>x</parameter></paramdef> + <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <simpara> <function>swfshape->setrightfill</function> draws a line (using the current line style, set by <function>swfshape->setline</function>) from the current @@ -1670,10 +1812,11 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->drawline</function></funcdef> - <paramdef>integer <parameter>dx</parameter></paramdef> - <paramdef>integer <parameter>dy</parameter></paramdef> + <paramdef>int <parameter>dx</parameter></paramdef> + <paramdef>int <parameter>dy</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <simpara> <function>swfshape->setrightfill</function> draws a line (using the current line style set by <function>swfshape->setline</function>) from the current pen position to @@ -1699,12 +1842,13 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->drawcurveto</function></funcdef> - <paramdef>integer <parameter>controlx</parameter></paramdef> - <paramdef>integer <parameter>controly</parameter></paramdef> - <paramdef>integer <parameter>anchorx</parameter></paramdef> - <paramdef>integer <parameter>anchory</parameter></paramdef> + <paramdef>int <parameter>controlx</parameter></paramdef> + <paramdef>int <parameter>controly</parameter></paramdef> + <paramdef>int <parameter>anchorx</parameter></paramdef> + <paramdef>int <parameter>anchory</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <simpara> <function>swfshape->drawcurveto</function> draws a quadratic curve (using the current line style, set by <function>swfshape->setline</function>) @@ -1734,12 +1878,13 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->drawcurve</function></funcdef> - <paramdef>integer <parameter>controldx</parameter></paramdef> - <paramdef>integer <parameter>controldy</parameter></paramdef> - <paramdef>integer <parameter>anchordx</parameter></paramdef> - <paramdef>integer <parameter>anchordy</parameter></paramdef> + <paramdef>int <parameter>controldx</parameter></paramdef> + <paramdef>int <parameter>controldy</parameter></paramdef> + <paramdef>int <parameter>anchordx</parameter></paramdef> + <paramdef>int <parameter>anchordy</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <simpara> <function>swfshape->drawcurve</function> draws a quadratic curve (using the current line style,set by <function>swfshape->setline</function>) @@ -1772,9 +1917,10 @@ <funcsynopsis> <funcprototype> <funcdef>new <function>swfgradient</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfgradient</function> creates a new SWFGradient object. </para> @@ -1791,50 +1937,52 @@ <example> <title><function>swfgradient</function> の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $m = new SWFMovie(); - $m-&gt;setDimension(320, 240); + $m->setDimension(320, 240); $s = new SWFShape(); // first gradient- black to white $g = new SWFGradient(); - $g-&gt;addEntry(0.0, 0, 0, 0); - $g-&gt;addEntry(1.0, 0xff, 0xff, 0xff); + $g->addEntry(0.0, 0, 0, 0); + $g->addEntry(1.0, 0xff, 0xff, 0xff); - $f = $s-&gt;addFill($g, SWFFILL_LINEAR_GRADIENT); - $f-&gt;scaleTo(0.01); - $f-&gt;moveTo(160, 120); - $s-&gt;setRightFill($f); - $s-&gt;drawLine(320, 0); - $s-&gt;drawLine(0, 240); - $s-&gt;drawLine(-320, 0); - $s-&gt;drawLine(0, -240); + $f = $s->addFill($g, SWFFILL_LINEAR_GRADIENT); + $f->scaleTo(0.01); + $f->moveTo(160, 120); + $s->setRightFill($f); + $s->drawLine(320, 0); + $s->drawLine(0, 240); + $s->drawLine(-320, 0); + $s->drawLine(0, -240); - $m-&gt;add($s); + $m->add($s); $s = new SWFShape(); // second gradient- radial gradient from red to transparent $g = new SWFGradient(); - $g-&gt;addEntry(0.0, 0xff, 0, 0, 0xff); - $g-&gt;addEntry(1.0, 0xff, 0, 0, 0); + $g->addEntry(0.0, 0xff, 0, 0, 0xff); + $g->addEntry(1.0, 0xff, 0, 0, 0); - $f = $s-&gt;addFill($g, SWFFILL_RADIAL_GRADIENT); - $f-&gt;scaleTo(0.005); - $f-&gt;moveTo(160, 120); - $s-&gt;setRightFill($f); - $s-&gt;drawLine(320, 0); - $s-&gt;drawLine(0, 240); - $s-&gt;drawLine(-320, 0); - $s-&gt;drawLine(0, -240); + $f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); + $f->scaleTo(0.005); + $f->moveTo(160, 120); + $s->setRightFill($f); + $s->drawLine(320, 0); + $s->drawLine(0, 240); + $s->drawLine(-320, 0); + $s->drawLine(0, -240); - $m-&gt;add($s); + $m->add($s); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -1851,13 +1999,14 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfgradient->addentry</function></funcdef> - <paramdef>double <parameter>ratio</parameter></paramdef> - <paramdef>integer <parameter>red</parameter></paramdef> - <paramdef>integer <parameter>green</parameter></paramdef> - <paramdef>integer <parameter>blue</parameter></paramdef> - <paramdef>integer <parameter><optional>a</optional></parameter></paramdef> + <paramdef>float <parameter>ratio</parameter></paramdef> + <paramdef>int <parameter>red</parameter></paramdef> + <paramdef>int <parameter>green</parameter></paramdef> + <paramdef>int <parameter>blue</parameter></paramdef> + <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfgradient->addentry</function> adds an entry to the gradient list. <parameter>ratio</parameter> is a number between 0 and 1 indicating where in @@ -1883,9 +2032,10 @@ <funcprototype> <funcdef>new <function>swfbitmap</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> - <paramdef>integer <parameter><optional>alphafilename</optional></parameter></paramdef> + <paramdef>int <parameter><optional>alphafilename</optional></parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfbitmap</function> creates a new SWFBitmap object from the Jpeg or DBL file named <parameter>filename</parameter>. @@ -1910,23 +2060,25 @@ <example> <title>Import PNG files</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $s = new SWFShape(); - $f = $s-&gt;addFill(new SWFBitmap("png.dbl")); - $s-&gt;setRightFill($f); + $f = $s->addFill(new SWFBitmap("png.dbl")); + $s->setRightFill($f); - $s-&gt;drawLine(32, 0); - $s-&gt;drawLine(0, 32); - $s-&gt;drawLine(-32, 0); - $s-&gt;drawLine(0, -32); + $s->drawLine(32, 0); + $s->drawLine(0, 32); + $s->drawLine(-32, 0); + $s->drawLine(0, -32); $m = new SWFMovie(); - $m-&gt;setDimension(32, 32); - $m-&gt;add($s); + $m->setDimension(32, 32); + $m->add($s); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -1935,53 +2087,55 @@ <example> <title><function>swfbitmap</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $s = new SWFShape(); // .msk file generated with "gif2mask" utility - $f = $s-&gt;addFill(new SWFBitmap("alphafill.jpg", "alphafill.msk")); - $s-&gt;setRightFill($f); + $f = $s->addFill(new SWFBitmap("alphafill.jpg", "alphafill.msk")); + $s->setRightFill($f); - $s-&gt;drawLine(640, 0); - $s-&gt;drawLine(0, 480); - $s-&gt;drawLine(-640, 0); - $s-&gt;drawLine(0, -480); + $s->drawLine(640, 0); + $s->drawLine(0, 480); + $s->drawLine(-640, 0); + $s->drawLine(0, -480); $c = new SWFShape(); - $c-&gt;setRightFill($c-&gt;addFill(0x99, 0x99, 0x99)); - $c-&gt;drawLine(40, 0); - $c-&gt;drawLine(0, 40); - $c-&gt;drawLine(-40, 0); - $c-&gt;drawLine(0, -40); + $c->setRightFill($c->addFill(0x99, 0x99, 0x99)); + $c->drawLine(40, 0); + $c->drawLine(0, 40); + $c->drawLine(-40, 0); + $c->drawLine(0, -40); $m = new SWFMovie(); - $m-&gt;setDimension(640, 480); - $m-&gt;setBackground(0xcc, 0xcc, 0xcc); + $m->setDimension(640, 480); + $m->setBackground(0xcc, 0xcc, 0xcc); // draw checkerboard background - for($y=0; $y&lt;480; $y+=40) + for($y=0; $y<480; $y+=40) { - for($x=0; $x&lt;640; $x+=80) + for($x=0; $x<640; $x+=80) { - $i = $m-&gt;add($c); - $i-&gt;moveTo($x, $y); + $i = $m->add($c); + $i->moveTo($x, $y); } $y+=40; - for($x=40; $x&lt;640; $x+=80) + for($x=40; $x<640; $x+=80) { - $i = $m-&gt;add($c); - $i-&gt;moveTo($x, $y); + $i = $m->add($c); + $i->moveTo($x, $y); } } - $m-&gt;add($s); + $m->add($s); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -1998,9 +2152,10 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>swfbitmap->getwidth</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfbitmap->getwidth</function> returns the bitmap's width in pixels. </para> @@ -2020,9 +2175,10 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>swfbitmap->getheight</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfbitmap->getheight</function> returns the bitmap's height in pixels. </para> @@ -2064,10 +2220,11 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swffill->moveto</function></funcdef> - <paramdef>integer <parameter>x</parameter></paramdef> - <paramdef>integer <parameter>y</parameter></paramdef> + <paramdef>int <parameter>x</parameter></paramdef> + <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swffill->moveto</function> moves fill's origin to (<parameter>x</parameter>,<parameter>y</parameter>) in global coordinates. @@ -2085,10 +2242,11 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swffill->scaleto</function></funcdef> - <paramdef>integer <parameter>x</parameter></paramdef> - <paramdef>integer <parameter>y</parameter></paramdef> + <paramdef>int <parameter>x</parameter></paramdef> + <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swffill->scaleto</function> sets fill's scale to <parameter>x</parameter> in the x-direction, @@ -2107,9 +2265,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swffill->rotateto</function></funcdef> - <paramdef>double <parameter>degrees</parameter></paramdef> + <paramdef>float <parameter>degrees</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swffill->rotateto</function> sets fill's rotation to <parameter>degrees</parameter> degrees. @@ -2127,9 +2286,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swffill->skewxto</function></funcdef> - <paramdef>double <parameter>x</parameter></paramdef> + <paramdef>float <parameter>x</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swffill->skewxto</function> sets fill x-skew to <parameter>x</parameter>. For <parameter>x</parameter> is 1.0, it is a is a 45-degree @@ -2148,9 +2308,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swffill->skewyto</function></funcdef> - <paramdef>double <parameter>y</parameter></paramdef> + <paramdef>float <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swffill->skewyto</function> sets fill y-skew to <parameter>y</parameter>. For <parameter>y</parameter> is 1.0, it is a is a 45-degree @@ -2171,9 +2332,10 @@ <funcsynopsis> <funcprototype> <funcdef>new <function>swfmorph</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfmorph</function> creates a new SWFMorph object. </para> @@ -2199,47 +2361,49 @@ <example> <title><function>swfmorph</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $p = new SWFMorph(); - $s = $p-&gt;getShape1(); - $s-&gt;setLine(0,0,0,0); + $s = $p->getShape1(); + $s->setLine(0,0,0,0); /* Note that this is backwards from normal shapes (left instead of right). I have no idea why, but this seems to work.. */ - $s-&gt;setLeftFill($s-&gt;addFill(0xff, 0, 0)); - $s-&gt;movePenTo(-1000,-1000); - $s-&gt;drawLine(2000,0); - $s-&gt;drawLine(0,2000); - $s-&gt;drawLine(-2000,0); - $s-&gt;drawLine(0,-2000); - - $s = $p-&gt;getShape2(); - $s-&gt;setLine(60,0,0,0); - $s-&gt;setLeftFill($s-&gt;addFill(0, 0, 0xff)); - $s-&gt;movePenTo(0,-1000); - $s-&gt;drawLine(1000,1000); - $s-&gt;drawLine(-1000,1000); - $s-&gt;drawLine(-1000,-1000); - $s-&gt;drawLine(1000,-1000); + $s->setLeftFill($s->addFill(0xff, 0, 0)); + $s->movePenTo(-1000,-1000); + $s->drawLine(2000,0); + $s->drawLine(0,2000); + $s->drawLine(-2000,0); + $s->drawLine(0,-2000); + + $s = $p->getShape2(); + $s->setLine(60,0,0,0); + $s->setLeftFill($s->addFill(0, 0, 0xff)); + $s->movePenTo(0,-1000); + $s->drawLine(1000,1000); + $s->drawLine(-1000,1000); + $s->drawLine(-1000,-1000); + $s->drawLine(1000,-1000); $m = new SWFMovie(); - $m-&gt;setDimension(3000,2000); - $m-&gt;setBackground(0xff, 0xff, 0xff); + $m->setDimension(3000,2000); + $m->setBackground(0xff, 0xff, 0xff); - $i = $m-&gt;add($p); - $i-&gt;moveTo(1500,1000); + $i = $m->add($p); + $i->moveTo(1500,1000); - for($r=0.0; $r&lt;=1.0; $r+=0.1) + for($r=0.0; $r<=1.0; $r+=0.1) { - $i-&gt;setRatio($r); - $m-&gt;nextFrame(); + $i->setRatio($r); + $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -2256,9 +2420,10 @@ <funcsynopsis> <funcprototype> <funcdef>mixed <function>swfmorph->getshape1</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfmorph->getshape1</function> gets a handle to the morph's starting shape. <function>swfmorph->getshape1</function> returns an @@ -2277,9 +2442,10 @@ <funcsynopsis> <funcprototype> <funcdef>mixed <function>swfmorph->getshape2</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfmorph->getshape2</function> gets a handle to the morph's ending shape. <function>swfmorph->getshape2</function> returns an @@ -2300,9 +2466,10 @@ <funcsynopsis> <funcprototype> <funcdef>new <function>swftext</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftext</function> creates a new SWFText object, fresh for manipulating. @@ -2319,23 +2486,25 @@ <example> <title><function>swftext</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $f = new SWFFont("Techno.fdb"); $t = new SWFText(); - $t-&gt;setFont($f); - $t-&gt;moveTo(200, 2400); - $t-&gt;setColor(0xff, 0xff, 0); - $t-&gt;setHeight(1200); - $t-&gt;addString("PHP generates Flash with Ming!!"); + $t->setFont($f); + $t->moveTo(200, 2400); + $t->setColor(0xff, 0xff, 0); + $t->setHeight(1200); + $t->addString("PHP generates Flash with Ming!!"); $m = new SWFMovie(); - $m-&gt;setDimension(5400, 3600); + $m->setDimension(5400, 3600); - $m-&gt;add($t); + $m->add($t); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -2355,6 +2524,7 @@ <paramdef>string <parameter>font</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftext->setfont</function> は、カレントのフォントを <parameter>font</parameter> に設定します。 @@ -2372,9 +2542,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swftext->setheight</function></funcdef> - <paramdef>integer <parameter>height</parameter></paramdef> + <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftext->setheight</function> sets the current font height to <parameter>height</parameter>. Default is 240. @@ -2392,9 +2563,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swftext->setspacing</function></funcdef> - <paramdef>double <parameter>spacing</parameter></paramdef> + <paramdef>float <parameter>spacing</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftext->setspacing</function> sets the current font spacing to <parameter>spacing</parameter><parameter>spacing</parameter>. Default is 1.0. @@ -2418,12 +2590,13 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swftext->setcolor</function></funcdef> - <paramdef>integer <parameter>red</parameter></paramdef> - <paramdef>integer <parameter>green</parameter></paramdef> - <paramdef>integer <parameter>blue</parameter></paramdef> - <paramdef>integer <parameter><optional>a</optional></parameter></paramdef> + <paramdef>int <parameter>red</parameter></paramdef> + <paramdef>int <parameter>green</parameter></paramdef> + <paramdef>int <parameter>blue</parameter></paramdef> + <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftext->setspacing</function> changes the current text color. Default is black. I think. Color is represented using the RGB system. @@ -2441,10 +2614,11 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swftext->moveto</function></funcdef> - <paramdef>integer <parameter>x</parameter></paramdef> - <paramdef>integer <parameter>y</parameter></paramdef> + <paramdef>int <parameter>x</parameter></paramdef> + <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftext->moveto</function> moves the pen (or cursor, if that makes more sense) to (<parameter>x</parameter>,<parameter>y</parameter>) @@ -2467,6 +2641,7 @@ <paramdef>string <parameter>string</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftext->addstring</function> draws the string <parameter>string</parameter> at the current pen (cursor) location. Pen is at the baseline of the text; @@ -2488,6 +2663,7 @@ <paramdef>string <parameter>string</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftext->addstring</function> returns the rendered width of the <parameter>string</parameter> string at the text object's current font, @@ -2511,6 +2687,7 @@ <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <parameter>filename</parameter> が、FDBファイルの名前(すなわち、 ".fdb" で終る)の場合、このファイル中のフォントの定義をロードしま @@ -2530,9 +2707,11 @@ 仮定します。フォント _serif, _sans, _typewriter は、常に使用可能 です。例えば、 <programlisting role="php"> -&lt;?php -$f = new SWFFont("_sans"); -?&gt; +<![CDATA[ +<?php +$f = newSWFFont("_sans"); +?> +]]> </programlisting> により、標準的な sans-serif フォントが指定されます。これは、HTML で <literal>&lt;font name="sans-serif"&gt;</literal> と指定した場 @@ -2563,6 +2742,7 @@ <paramdef>string <parameter>string</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swffont->getwidth</function> returns the string <parameter>string</parameter>'s width, using font's default scaling. @@ -2589,6 +2769,7 @@ </paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield</function> creates a new text field object. Text Fields are less flexible than <function>swftext</function> objects- @@ -2633,9 +2814,11 @@ Flags are combined with the bitwise <link linkend="language.operators.bitwise">OR</link> operation. For example, <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $t = newSWFTextField(SWFTEXTFIELD_PASSWORD | SWFTEXTFIELD_NOEDIT); -?&gt; +?> +]]> </programlisting> creates a totally useless non-editable password field. </para> @@ -2664,6 +2847,7 @@ <paramdef>string <parameter>font</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->setfont</function> sets the text field font to the [browser-defined?] <parameter>font</parameter> font. @@ -2685,6 +2869,7 @@ <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->setbounds</function> sets the text field width to <parameter>width</parameter> and height to <parameter>height</parameter>. @@ -2707,6 +2892,7 @@ <paramdef>int <parameter>alignement</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->align</function> sets the text field alignment to <parameter>alignement</parameter>. Valid values for @@ -2732,6 +2918,7 @@ <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->setheight</function> sets the font height of this text field font to the given height <parameter>height</parameter>. Default is 240. @@ -2752,6 +2939,7 @@ <paramdef>int <parameter>width</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->setleftmargin</function> sets the left margin width of the text field to <parameter>width</parameter>. Default is 0. @@ -2772,6 +2960,7 @@ <paramdef>int <parameter>width</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->setrightmargin</function> sets the right margin width of the text field to <parameter>width</parameter>. Default is 0. @@ -2793,6 +2982,7 @@ <paramdef>int <parameter>right</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->setmargins</function> set both margins at once, for the man on the go. @@ -2813,6 +3003,7 @@ <paramdef>int <parameter>width</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->setindentation</function> sets the indentation of the first line in the text field, to <parameter>width</parameter>. @@ -2833,6 +3024,7 @@ <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->setlinespacing</function> sets the line spacing of the text field to the height of <parameter>height</parameter>. Default is 40. @@ -2850,12 +3042,13 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->setcolor</function></funcdef> - <paramdef>integer <parameter>red</parameter></paramdef> - <paramdef>integer <parameter>green</parameter></paramdef> - <paramdef>integer <parameter>blue</parameter></paramdef> - <paramdef>integer <parameter><optional>a</optional></parameter></paramdef> + <paramdef>int <parameter>red</parameter></paramdef> + <paramdef>int <parameter>green</parameter></paramdef> + <paramdef>int <parameter>blue</parameter></paramdef> + <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->setcolor</function> sets the color of the text field. Default is fully opaque black. Color is represented using RGB system. @@ -2876,6 +3069,7 @@ <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->setname</function> sets the variable name of this text field to <parameter>name</parameter>, for form posting and action @@ -2897,6 +3091,7 @@ <paramdef>string <parameter>string</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swftextfield->setname</function> は、文字列 <parameter>string</parameter>をテキストフィールドに結合します。 @@ -2916,9 +3111,10 @@ <funcsynopsis> <funcprototype> <funcdef>new <function>swfsprite</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfsprite</function> are also known as a "movie clip", this allows one to create objects which are animated in their own @@ -2935,40 +3131,42 @@ <example> <title><function>swfsprite</function> の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $s = new SWFShape(); - $s-&gt;setRightFill($s-&gt;addFill(0xff, 0, 0)); - $s-&gt;movePenTo(-500,-500); - $s-&gt;drawLineTo(500,-500); - $s-&gt;drawLineTo(500,500); - $s-&gt;drawLineTo(-500,500); - $s-&gt;drawLineTo(-500,-500); + $s->setRightFill($s->addFill(0xff, 0, 0)); + $s->movePenTo(-500,-500); + $s->drawLineTo(500,-500); + $s->drawLineTo(500,500); + $s->drawLineTo(-500,500); + $s->drawLineTo(-500,-500); $p = new SWFSprite(); - $i = $p-&gt;add($s); - $p-&gt;nextFrame(); - $i-&gt;rotate(15); - $p-&gt;nextFrame(); - $i-&gt;rotate(15); - $p-&gt;nextFrame(); - $i-&gt;rotate(15); - $p-&gt;nextFrame(); - $i-&gt;rotate(15); - $p-&gt;nextFrame(); - $i-&gt;rotate(15); - $p-&gt;nextFrame(); + $i = $p->add($s); + $p->nextFrame(); + $i->rotate(15); + $p->nextFrame(); + $i->rotate(15); + $p->nextFrame(); + $i->rotate(15); + $p->nextFrame(); + $i->rotate(15); + $p->nextFrame(); + $i->rotate(15); + $p->nextFrame(); $m = new SWFMovie(); - $i = $m-&gt;add($p); - $i-&gt;moveTo(1500,1000); - $i-&gt;setName("blah"); + $i = $m->add($p); + $i->moveTo(1500,1000); + $i->setName("blah"); - $m-&gt;setBackground(0xff, 0xff, 0xff); - $m-&gt;setDimension(3000,2000); + $m->setBackground(0xff, 0xff, 0xff); + $m->setDimension(3000,2000); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -2985,9 +3183,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfsprite->add</function></funcdef> - <paramdef>ressource <parameter>object</parameter></paramdef> + <paramdef>resource <parameter>object</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfsprite->add</function> adds a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function>, @@ -3034,9 +3233,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfsprite->setframes</function></funcdef> - <paramdef>integer <parameter>numberofframes</parameter></paramdef> + <paramdef>int <parameter>numberofframes</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfsprite->setframes</function> sets the total number of frames in the animation to <parameter>numberofframes</parameter>. @@ -3054,9 +3254,10 @@ <funcsynopsis> <funcprototype> <funcdef>void <function>swfsprite->nextframe</function></funcdef> - <paramdef>void </paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfsprite->setframes</function> moves to the next frame of the animation. @@ -3076,9 +3277,10 @@ <funcsynopsis> <funcprototype> <funcdef>new <function>swfbutton</function></funcdef> - <paramdef>void</paramdef> + <void/> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfbutton</function> creates a new Button. Roll over it, click it, see it call action code. Swank. @@ -3096,7 +3298,8 @@ <example> <title><function>swfbutton</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $f = new SWFFont("_serif"); @@ -3107,22 +3310,22 @@ global $f; $t = new SWFTextField(); - $t-&gt;setFont($f); - $t-&gt;addString($string); - $t-&gt;setHeight(200); - $t-&gt;setBounds(3200,200); + $t->setFont($f); + $t->addString($string); + $t->setHeight(200); + $t->setBounds(3200,200); return $t; } function addLabel($string) { global $p; - $i = $p-&gt;add(label($string)); - $p-&gt;nextFrame(); - $p-&gt;remove($i); + $i = $p->add(label($string)); + $p->nextFrame(); + $p->remove($i); } - $p-&gt;add(new SWFAction("stop();")); + $p->add(new SWFAction("stop();")); addLabel("NO ACTION"); addLabel("SWFBUTTON_MOUSEUP"); addLabel("SWFBUTTON_MOUSEDOWN"); @@ -3135,54 +3338,55 @@ function rect($r, $g, $b) { $s = new SWFShape(); - $s-&gt;setRightFill($s-&gt;addFill($r, $g, $b)); - $s-&gt;drawLine(600,0); - $s-&gt;drawLine(0,600); - $s-&gt;drawLine(-600,0); - $s-&gt;drawLine(0,-600); + $s->setRightFill($s->addFill($r, $g, $b)); + $s->drawLine(600,0); + $s->drawLine(0,600); + $s->drawLine(-600,0); + $s->drawLine(0,-600); return $s; } $b = new SWFButton(); - $b-&gt;addShape(rect(0xff, 0, 0), SWFBUTTON_UP | SWFBUTTON_HIT); - $b-&gt;addShape(rect(0, 0xff, 0), SWFBUTTON_OVER); - $b-&gt;addShape(rect(0, 0, 0xff), SWFBUTTON_DOWN); + $b->addShape(rect(0xff, 0, 0), SWFBUTTON_UP | SWFBUTTON_HIT); + $b->addShape(rect(0, 0xff, 0), SWFBUTTON_OVER); + $b->addShape(rect(0, 0, 0xff), SWFBUTTON_DOWN); - $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(1);"), - SWFBUTTON_MOUSEUP); + $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(1);"), + SWFBUTTON_MOUSEUP); - $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(2);"), - SWFBUTTON_MOUSEDOWN); + $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(2);"), + SWFBUTTON_MOUSEDOWN); - $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(3);"), - SWFBUTTON_MOUSEOVER); + $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(3);"), + SWFBUTTON_MOUSEOVER); - $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(4);"), - SWFBUTTON_MOUSEOUT); + $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(4);"), + SWFBUTTON_MOUSEOUT); - $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(5);"), - SWFBUTTON_MOUSEUPOUTSIDE); + $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(5);"), + SWFBUTTON_MOUSEUPOUTSIDE); - $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(6);"), - SWFBUTTON_DRAGOVER); + $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(6);"), + SWFBUTTON_DRAGOVER); - $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(7);"), - SWFBUTTON_DRAGOUT); + $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(7);"), + SWFBUTTON_DRAGOUT); $m = new SWFMovie(); - $m-&gt;setDimension(4000,3000); + $m->setDimension(4000,3000); - $i = $m-&gt;add($p); - $i-&gt;setName("label"); - $i-&gt;moveTo(400,1900); + $i = $m->add($p); + $i->setName("label"); + $i->moveTo(400,1900); - $i = $m-&gt;add($b); - $i-&gt;moveTo(400,900); + $i = $m->add($b); + $i->moveTo(400,900); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -3192,36 +3396,38 @@ <example> <title><function>swfbutton->addaction</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $s = new SWFShape(); - $s-&gt;setRightFill($s-&gt;addFill(0xff, 0, 0)); - $s-&gt;drawLine(1000,0); - $s-&gt;drawLine(0,1000); - $s-&gt;drawLine(-1000,0); - $s-&gt;drawLine(0,-1000); + $s->setRightFill($s->addFill(0xff, 0, 0)); + $s->drawLine(1000,0); + $s->drawLine(0,1000); + $s->drawLine(-1000,0); + $s->drawLine(0,-1000); $b = new SWFButton(); - $b-&gt;addShape($s, SWFBUTTON_HIT | SWFBUTTON_UP | SWFBUTTON_DOWN | SWFBUTTON_OVER); + $b->addShape($s, SWFBUTTON_HIT | SWFBUTTON_UP | SWFBUTTON_DOWN | SWFBUTTON_OVER); - $b-&gt;addAction(new SWFAction("startDrag('/test', 0);"), // '0' means don't lock to mouse - SWFBUTTON_MOUSEDOWN); + $b->addAction(new SWFAction("startDrag('/test', 0);"), // '0' means don't lock to mouse + SWFBUTTON_MOUSEDOWN); - $b-&gt;addAction(new SWFAction("stopDrag();"), - SWFBUTTON_MOUSEUP | SWFBUTTON_MOUSEUPOUTSIDE); + $b->addAction(new SWFAction("stopDrag();"), + SWFBUTTON_MOUSEUP | SWFBUTTON_MOUSEUPOUTSIDE); $p = new SWFSprite(); - $p-&gt;add($b); - $p-&gt;nextFrame(); + $p->add($b); + $p->nextFrame(); $m = new SWFMovie(); - $i = $m-&gt;add($p); - $i-&gt;setName('test'); - $i-&gt;moveTo(1000,1000); + $i = $m->add($p); + $i->setName('test'); + $i->moveTo(1000,1000); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -3239,9 +3445,10 @@ <funcprototype> <funcdef>void <function>swfbutton->addshape</function></funcdef> <paramdef>ressource <parameter>shape</parameter></paramdef> - <paramdef>integer <parameter>flags</parameter></paramdef> + <paramdef>int <parameter>flags</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfbutton->addshape</function> adds the shape <parameter>shape</parameter> to this button. The following @@ -3267,9 +3474,15 @@ <paramdef>ressource <parameter>shape</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfbutton->setup</function> alias for addShape(shape, SWFBUTTON_UP). </para> + <para> + See also + <function>swfbutton->addshape</function> and + <function>SWFAction</function>. + </para> </refsect1> </refentry> @@ -3286,9 +3499,15 @@ <paramdef>ressource <parameter>shape</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfbutton->setup</function> alias for addShape(shape, SWFBUTTON_OVER). </para> + <para> + See also + <function>swfbutton->addshape</function> and + <function>SWFAction</function>. + </para> </refsect1> </refentry> @@ -3305,9 +3524,46 @@ <paramdef>ressource <parameter>shape</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfbutton->sethit</function> alias for addShape(shape, SWFBUTTON_HIT). </para> + <para> + See also + <function>swfbutton->addshape</function> and + <function>SWFAction</function>. + </para> + </refsect1> + </refentry> + + <refentry id="function.swfbutton.addaction"> + <refnamediv> + <refname>SWFbutton->addAction</refname> + <refpurpose>アクションを追加する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>void <function>swfbutton->addaction</function></funcdef> + <paramdef>ressource <parameter>action</parameter></paramdef> + <paramdef>int <parameter>flags</parameter></paramdef> + </funcprototype> + </funcsynopsis> + &warn.experimental.func; + <para> + <function>swfbutton->addaction</function> adds the action + <parameter>action</parameter> to this button for the given conditions. + The following <parameter>flags</parameter> are valid: + SWFBUTTON_MOUSEOVER, SWFBUTTON_MOUSEOUT, SWFBUTTON_MOUSEUP, + SWFBUTTON_MOUSEUPOUTSIDE, SWFBUTTON_MOUSEDOWN, SWFBUTTON_DRAGOUT and + SWFBUTTON_DRAGOVER. + </para> + <para> + See also + <function>swfbutton->addshape</function> and + <function>SWFAction</function>. + </para> </refsect1> </refentry> @@ -3324,11 +3580,17 @@ <paramdef>ressource <parameter>action</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfbutton->setaction</function> sets the action to be performed when the button is clicked. Alias for addAction(shape, SWFBUTTON_MOUSEUP). <parameter>action</parameter> is a <function>swfaction</function>. </para> + <para> + See also + <function>swfbutton->addshape</function> and + <function>SWFAction</function>. + </para> </refsect1> </refentry> @@ -3347,6 +3609,7 @@ <paramdef>string <parameter>script</parameter></paramdef> </funcprototype> </funcsynopsis> + &warn.experimental.func; <para> <function>swfaction</function> creates a new Action, and compiles the given script into an SWFAction object. @@ -3740,45 +4003,47 @@ <example> <title><function>swfaction</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $s = new SWFShape(); - $f = $s-&gt;addFill(0xff, 0, 0); - $s-&gt;setRightFill($f); + $f = $s->addFill(0xff, 0, 0); + $s->setRightFill($f); - $s-&gt;movePenTo(-500,-500); - $s-&gt;drawLineTo(500,-500); - $s-&gt;drawLineTo(500,500); - $s-&gt;drawLineTo(-500,500); - $s-&gt;drawLineTo(-500,-500); + $s->movePenTo(-500,-500); + $s->drawLineTo(500,-500); + $s->drawLineTo(500,500); + $s->drawLineTo(-500,500); + $s->drawLineTo(-500,-500); $p = new SWFSprite(); - $i = $p-&gt;add($s); - $i-&gt;setDepth(1); - $p-&gt;nextFrame(); + $i = $p->add($s); + $i->setDepth(1); + $p->nextFrame(); - for($n=0; $n&lt;5; ++$n) + for($n=0; $n<5; ++$n) { - $i-&gt;rotate(-15); - $p-&gt;nextFrame(); + $i->rotate(-15); + $p->nextFrame(); } $m = new SWFMovie(); - $m-&gt;setBackground(0xff, 0xff, 0xff); - $m-&gt;setDimension(6000,4000); + $m->setBackground(0xff, 0xff, 0xff); + $m->setDimension(6000,4000); - $i = $m-&gt;add($p); - $i-&gt;setDepth(1); - $i-&gt;moveTo(-500,2000); - $i-&gt;setName("box"); - - $m-&gt;add(new SWFAction("/box.x += 3;")); - $m-&gt;nextFrame(); - $m-&gt;add(new SWFAction("gotoFrame(0); play();")); - $m-&gt;nextFrame(); + $i = $m->add($p); + $i->setDepth(1); + $i->moveTo(-500,2000); + $i->setName("box"); + + $m->add(new SWFAction("/box.x += 3;")); + $m->nextFrame(); + $m->add(new SWFAction("gotoFrame(0); play();")); + $m->nextFrame(); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -3787,75 +4052,76 @@ <example> <title><function>swfaction</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $m = new SWFMovie(); - $m-&gt;setRate(36.0); - $m-&gt;setDimension(1200, 800); - $m-&gt;setBackground(0, 0, 0); + $m->setRate(36.0); + $m->setDimension(1200, 800); + $m->setBackground(0, 0, 0); /* mouse tracking sprite - empty, but follows mouse so we can get its x and y coordinates */ - $i = $m-&gt;add(new SWFSprite()); - $i-&gt;setName('mouse'); + $i = $m->add(new SWFSprite()); + $i->setName('mouse'); - $m-&gt;add(new SWFAction(" + $m->add(new SWFAction(" startDrag('/mouse', 1); /* '1' means lock sprite to the mouse */ ")); /* might as well turn off antialiasing, since these are just squares. */ - $m-&gt;add(new SWFAction(" + $m->add(new SWFAction(" this.quality = 0; ")); /* morphing box */ $r = new SWFMorph(); - $s = $r-&gt;getShape1(); + $s = $r->getShape1(); /* Note this is backwards from normal shapes. No idea why. */ - $s-&gt;setLeftFill($s-&gt;addFill(0xff, 0xff, 0xff)); - $s-&gt;movePenTo(-40, -40); - $s-&gt;drawLine(80, 0); - $s-&gt;drawLine(0, 80); - $s-&gt;drawLine(-80, 0); - $s-&gt;drawLine(0, -80); - - $s = $r-&gt;getShape2(); - - $s-&gt;setLeftFill($s-&gt;addFill(0x00, 0x00, 0x00)); - $s-&gt;movePenTo(-1, -1); - $s-&gt;drawLine(2, 0); - $s-&gt;drawLine(0, 2); - $s-&gt;drawLine(-2, 0); - $s-&gt;drawLine(0, -2); + $s->setLeftFill($s->addFill(0xff, 0xff, 0xff)); + $s->movePenTo(-40, -40); + $s->drawLine(80, 0); + $s->drawLine(0, 80); + $s->drawLine(-80, 0); + $s->drawLine(0, -80); + + $s = $r->getShape2(); + + $s->setLeftFill($s->addFill(0x00, 0x00, 0x00)); + $s->movePenTo(-1, -1); + $s->drawLine(2, 0); + $s->drawLine(0, 2); + $s->drawLine(-2, 0); + $s->drawLine(0, -2); /* sprite container for morphing box - this is just a timeline w/ the box morphing */ $box = new SWFSprite(); - $box-&gt;add(new SWFAction(" + $box->add(new SWFAction(" stop(); ")); - $i = $box-&gt;add($r); + $i = $box->add($r); - for($n=0; $n&lt;=20; ++$n) + for($n=0; $n<=20; ++$n) { - $i-&gt;setRatio($n/20); - $box-&gt;nextFrame(); + $i->setRatio($n/20); + $box->nextFrame(); } /* this container sprite allows us to use the same action code many times */ $cell = new SWFSprite(); - $i = $cell-&gt;add($box); - $i-&gt;setName('box'); + $i = $cell->add($box); + $i->setName('box'); - $cell-&gt;add(new SWFAction(" + $cell->add(new SWFAction(" setTarget('box'); @@ -3866,31 +4132,31 @@ ")); - $cell-&gt;nextFrame(); - $cell-&gt;add(new SWFAction(" + $cell->nextFrame(); + $cell->add(new SWFAction(" gotoFrame(0); play(); ")); - $cell-&gt;nextFrame(); + $cell->nextFrame(); /* finally, add a bunch of the cells to the movie */ - for($x=0; $x&lt;12; ++$x) + for($x=0; $x<12; ++$x) { - for($y=0; $y&lt;8; ++$y) + for($y=0; $y<8; ++$y) { - $i = $m-&gt;add($cell); - $i-&gt;moveTo(100*$x+50, 100*$y+50); + $i = $m->add($cell); + $i->moveTo(100*$x+50, 100*$y+50); } } - $m-&gt;nextFrame(); + $m->nextFrame(); - $m-&gt;add(new SWFAction(" + $m->add(new SWFAction(" gotoFrame(1); play(); @@ -3898,8 +4164,9 @@ ")); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -3908,13 +4175,14 @@ <example> <title><function>swfaction</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $m = new SWFMovie(); - $m-&gt;setDimension(11000, 8000); - $m-&gt;setBackground(0x00, 0x00, 0x00); + $m->setDimension(11000, 8000); + $m->setBackground(0x00, 0x00, 0x00); - $m-&gt;add(new SWFAction(" + $m->add(new SWFAction(" this.quality = 0; /frames.visible = 0; @@ -3924,56 +4192,56 @@ // mouse tracking sprite $t = new SWFSprite(); - $i = $m-&gt;add($t); - $i-&gt;setName('mouse'); + $i = $m->add($t); + $i->setName('mouse'); $g = new SWFGradient(); - $g-&gt;addEntry(0, 0xff, 0xff, 0xff, 0xff); - $g-&gt;addEntry(0.1, 0xff, 0xff, 0xff, 0xff); - $g-&gt;addEntry(0.5, 0xff, 0xff, 0xff, 0x5f); - $g-&gt;addEntry(1.0, 0xff, 0xff, 0xff, 0); + $g->addEntry(0, 0xff, 0xff, 0xff, 0xff); + $g->addEntry(0.1, 0xff, 0xff, 0xff, 0xff); + $g->addEntry(0.5, 0xff, 0xff, 0xff, 0x5f); + $g->addEntry(1.0, 0xff, 0xff, 0xff, 0); // gradient shape thing $s = new SWFShape(); - $f = $s-&gt;addFill($g, SWFFILL_RADIAL_GRADIENT); - $f-&gt;scaleTo(0.03); - $s-&gt;setRightFill($f); - $s-&gt;movePenTo(-600, -600); - $s-&gt;drawLine(1200, 0); - $s-&gt;drawLine(0, 1200); - $s-&gt;drawLine(-1200, 0); - $s-&gt;drawLine(0, -1200); + $f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); + $f->scaleTo(0.03); + $s->setRightFill($f); + $s->movePenTo(-600, -600); + $s->drawLine(1200, 0); + $s->drawLine(0, 1200); + $s->drawLine(-1200, 0); + $s->drawLine(0, -1200); // need to make this a sprite so we can multColor it $p = new SWFSprite(); - $p-&gt;add($s); - $p-&gt;nextFrame(); + $p->add($s); + $p->nextFrame(); // put the shape in here, each frame a different color $q = new SWFSprite(); - $q-&gt;add(new SWFAction("gotoFrame(random(7)+1); stop();")); - $i = $q-&gt;add($p); + $q->add(new SWFAction("gotoFrame(random(7)+1); stop();")); + $i = $q->add($p); - $i-&gt;multColor(1.0, 1.0, 1.0); - $q-&gt;nextFrame(); - $i-&gt;multColor(1.0, 0.5, 0.5); - $q-&gt;nextFrame(); - $i-&gt;multColor(1.0, 0.75, 0.5); - $q-&gt;nextFrame(); - $i-&gt;multColor(1.0, 1.0, 0.5); - $q-&gt;nextFrame(); - $i-&gt;multColor(0.5, 1.0, 0.5); - $q-&gt;nextFrame(); - $i-&gt;multColor(0.5, 0.5, 1.0); - $q-&gt;nextFrame(); - $i-&gt;multColor(1.0, 0.5, 1.0); - $q-&gt;nextFrame(); + $i->multColor(1.0, 1.0, 1.0); + $q->nextFrame(); + $i->multColor(1.0, 0.5, 0.5); + $q->nextFrame(); + $i->multColor(1.0, 0.75, 0.5); + $q->nextFrame(); + $i->multColor(1.0, 1.0, 0.5); + $q->nextFrame(); + $i->multColor(0.5, 1.0, 0.5); + $q->nextFrame(); + $i->multColor(0.5, 0.5, 1.0); + $q->nextFrame(); + $i->multColor(1.0, 0.5, 1.0); + $q->nextFrame(); // finally, this one contains the action code $p = new SWFSprite(); - $i = $p-&gt;add($q); - $i-&gt;setName('frames'); - $p-&gt;add(new SWFAction(" + $i = $p->add($q); + $i->setName('frames'); + $p->add(new SWFAction(" dx = (/:mousex-/:lastx)/3 + random(10)-5; dy = (/:mousey-/:lasty)/3; @@ -3982,9 +4250,9 @@ alpha = 100; ")); - $p-&gt;nextFrame(); + $p->nextFrame(); - $p-&gt;add(new SWFAction(" + $p->add(new SWFAction(" this.x = x; this.y = y; @@ -3995,16 +4263,16 @@ alpha -= 8; ")); - $p-&gt;nextFrame(); + $p->nextFrame(); - $p-&gt;add(new SWFAction("prevFrame(); play();")); - $p-&gt;nextFrame(); + $p->add(new SWFAction("prevFrame(); play();")); + $p->nextFrame(); - $i = $m-&gt;add($p); - $i-&gt;setName('frames'); - $m-&gt;nextFrame(); + $i = $m->add($p); + $i->setName('frames'); + $m->nextFrame(); - $m-&gt;add(new SWFAction(" + $m->add(new SWFAction(" lastx = mousex; lasty = mousey; @@ -4016,17 +4284,18 @@ if(num == 11) num = 1; -removeClip('char' &amp; num); -duplicateClip(/frames, 'char' &amp; num, num); +removeClip('char' & num); +duplicateClip(/frames, 'char' & num, num); ")); - $m-&gt;nextFrame(); - $m-&gt;add(new SWFAction("prevFrame(); play();")); + $m->nextFrame(); + $m->add(new SWFAction("prevFrame(); play();")); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); -?&gt; + $m->output(); +?> +]]> </programlisting> </example> </para> @@ -4039,46 +4308,47 @@ <example> <title><function>swfaction</function> example</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php /* sprite has one letter per frame */ $p = new SWFSprite(); - $p-&gt;add(new SWFAction("stop();")); + $p->add(new SWFAction("stop();")); $chars = "abcdefghijklmnopqrstuvwxyz". - "ABCDEFGHIJKLMNOPQRSTUVWXYZ". - "1234567890!@#$%^&amp;*()_+-=/[]{}|;:,.&lt;&gt;?`~"; + "ABCDEFGHIJKLMNOPQRSTUVWXYZ". + "1234567890!@#$%^&/*()_+-=/[]{}|;:,.<>?`~"; $f = new SWFFont("_sans"); for($n=0; $nremove($i); $t = new SWFTextField(); - $t-&gt;setFont($f); - $t-&gt;setHeight(240); - $t-&gt;setBounds(600,240); - $t-&gt;align(SWFTEXTFIELD_ALIGN_CENTER); - $t-&gt;addString($c); - $i = $p-&gt;add($t); - $p-&gt;labelFrame($c); - $p-&gt;nextFrame(); + $t->setFont($f); + $t->setHeight(240); + $t->setBounds(600,240); + $t->align(SWFTEXTFIELD_ALIGN_CENTER); + $t->addString($c); + $i = $p->add($t); + $p->labelFrame($c); + $p->nextFrame(); } /* hit region for button - the entire frame */ $s = new SWFShape(); - $s-&gt;setFillStyle0($s-&gt;addSolidFill(0, 0, 0, 0)); - $s-&gt;drawLine(600, 0); - $s-&gt;drawLine(0, 400); - $s-&gt;drawLine(-600, 0); - $s-&gt;drawLine(0, -400); + $s->setFillStyle0($s->addSolidFill(0, 0, 0, 0)); + $s->drawLine(600, 0); + $s->drawLine(0, 400); + $s->drawLine(-600, 0); + $s->drawLine(0, -400); /* button checks for pressed key, sends sprite to the right frame */ $b = new SWFButton(); - $b-&gt;addShape($s, SWFBUTTON_HIT); + $b->addShape($s, SWFBUTTON_HIT); for($n=0; $naddAction(new SWFAction(" @@ -4089,23 +4359,26 @@ } $m = new SWFMovie(); - $m-&gt;setDimension(600,400); - $i = $m-&gt;add($p); - $i-&gt;setName('char'); - $i-&gt;moveTo(0,80); + $m->setDimension(600,400); + $i = $m->add($p); + $i->setName('char'); + $i->moveTo(0,80); - $m-&gt;add($b); + $m->add($b); header('Content-type: application/x-shockwave-flash'); - $m-&gt;output(); + $m->output(); -?&gt; +?> +]]> </programlisting> </example> </para> </refsect1> </refentry> + </reference> + <!-- Keep this comment at the end of the file Local variables: mode: sgml Index: phpdoc/ja/functions/misc.xml diff -u phpdoc/ja/functions/misc.xml:1.24 phpdoc/ja/functions/misc.xml:1.25 --- phpdoc/ja/functions/misc.xml:1.24 Wed Dec 12 15:53:20 2001 +++ phpdoc/ja/functions/misc.xml Sat Jan 26 03:55:51 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.25 $ --> <reference id="ref.misc"> <title>その他の関数</title> <titleabbrev>その他</titleabbrev> @@ -21,7 +22,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>connection_aborted</function></funcdef> - <paramdef>void <parameter></parameter></paramdef> + <void/> </funcprototype> </funcsynopsis> <simpara> @@ -43,7 +44,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>connection_status</function></funcdef> - <paramdef>void <parameter></parameter></paramdef> + <void/> </funcprototype> </funcsynopsis> <simpara> @@ -65,7 +66,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>connection_timeout</function></funcdef> - <paramdef>void <parameter></parameter></paramdef> + <void/> </funcprototype> </funcsynopsis> <simpara> @@ -111,14 +112,16 @@ <example> <title><function>constant</function> の例</title> <programlisting role="php"> -&lt;php +<![CDATA[ +<?php define ("MAXSIZE", 100); echo MAXSIZE; echo constant("MAXSIZE"); // 前の行と動作は同じ -?&gt; +?> +]]> </programlisting> </example> </para> @@ -169,7 +172,8 @@ <example> <title>定数の定義</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php define ("CONSTANT", "Hello world."); echo CONSTANT; // "Hello world."を出力します。 echo Constant; // "Constant"を出力し、警告が発生します。 @@ -178,7 +182,8 @@ echo GREETING; // "Hello you."を出力 echo Greeting; // "Hello you."を出力 -?&gt; +?> +]]> </programlisting> </example> </para> @@ -215,11 +220,13 @@ <example> <title>定数のチェック</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php if (defined("CONSTANT")){ // 引用符で括られている必要があります echo CONSTANT; // } -?&gt; +?> +]]> </programlisting> </example> </para> @@ -234,65 +241,13 @@ <refentry id="function.die"> <refnamediv> <refname>die</refname> - <refpurpose> - メッセージを出力し、現在のスクリプトを終了する - </refpurpose> + <refpurpose><function>exit</function>のエイリアス</refpurpose> </refnamediv> <refsect1> <title>説明</title> - <funcsynopsis> - <funcprototype> - <funcdef>void <function>die</function></funcdef> - <paramdef>string <parameter>message</parameter></paramdef> - </funcprototype> - </funcsynopsis> - <simpara> - <function>die</function> は、<parameter>message</parameter> を出 - 力し、スクリプトの処理を終了します。この関数は値を何も返しません。 - </simpara> - <simpara> - また、<function>die</function> には、パラメータとして関数も指定可 - 能です。この関数は、<function>die</function> がスクリプトのパース - を終了する前に実行されます。 - </simpara> <para> - <example> - <title><function>die</function> の例</title> - <programlisting role="php"> -&lt;?php - -$filename = '/path/to/data-file'; -$file = fopen ($filename, 'r') - or die("unable to open file ($filename)"); - -?&gt; - </programlisting> - </example> - </para> - <para> - <example> - <title>関数を使用する<function>die</function>の例</title> - <programlisting role="php"> -&lt;?php - -function handle_error($msg) { - if ($fp = @fopen("/tmp/error.log", "a")) { - fwrite($fp, $msg, strlen($msg)); - fclose($fp); - } -} - -if ($bad) { - die(handle_error("Something bad happened.\n")); -} - -?&gt; - </programlisting> - </example> + この関数は<function>exit</function>のエイリアスです。 </para> - <simpara> - <function>exit</function>も参照下さい。 - </simpara> </refsect1> </refentry> @@ -330,10 +285,10 @@ </simpara> <simpara> <literal>return</literal> 文は、文字列の評価をただちに終了します。 - PHP4では、<function>eval</function>関数の結果の値を返すために - <literal>return</literal>を使用することが可能です。一方、PHP3では、 - <function>eval</function>の型は<literal>void</literal>であり、値 - を何も返しません。 + PHP4では、<function>eval</function>関数は &false;を返します。さも + なくば、結果の値を返すために<literal>return</literal>を使用するこ + とが可能です。一方、PHP3では、<function>eval</function>の型は + <literal>void</literal>であり、値を何も返しません。 </simpara> <para> <example> @@ -341,48 +296,89 @@ <function>eval</function>の例 - 簡単なテキストのマージ </title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php $string = 'cup'; $name = 'coffee'; -$str = 'This is a $string with my $name in it.&lt;br&gt;'; +$str = 'This is a $string with my $name in it.<br>'; echo $str; -eval( "\$str = \"$str\";" ); +eval ("\$str = \"$str\";"); echo $str; -?&gt; +?> +]]> </programlisting> - </example> - </para> - <para> - 上の例は、以下を表示します。 - <programlisting> + <para> + 上の例は、以下を表示します。 + <screen> +<![CDATA[ This is a $string with my $name in it. This is a cup with my coffee in it. - </programlisting> +]]> + </screen> + </para> + </example> </para> + &tip.ob-capture; </refsect1> </refentry> <refentry id="function.exit"> <refnamediv> <refname>exit</refname> - <refpurpose>現在のスクリプトを終了します</refpurpose> + <refpurpose>メッセージを出力し、カレントのスクリプトを終了する</refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> <funcdef>void <function>exit</function></funcdef> - <paramdef>mixed <parameter>status</parameter></paramdef> + <paramdef>string + <parameter><optional>status</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> + <note> + <simpara> + この関数は実際には関数ではなく言語構造です。 + </simpara> + </note> <simpara> <function>exit</function> 関数は、スクリプトの実行を終了します。 - 返り値はないですが、<parameter>status</parameter>を終了ステータス - として使用します。 + 終了直前に<parameter>status</parameter>を出力します。 </simpara> <simpara> - <function>die</function>も参照下さい。 + <parameter>status</parameter>が<type>integer</type>の場合、その値 + も終了ステータスとして使用されます。 </simpara> + <note> + <simpara> + カレントのCVS版は、<type>integer</type>の場合、 + <parameter>status</parameter>を出力しません。 + </simpara> + </note> + <note> + <simpara> + 関数<function>die</function>は、<function>exit</function>のエイ + リアスです。 + </simpara> + </note> + <para> + <example> + <title><function>exit</function>の例</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$filename = '/path/to/data-file'; +$file = fopen ($filename, 'r') + or exit("unable to open file ($filename)"); + +?> +]]> + </programlisting> + <!-- TODO: example with integer exit-statis --> + </example> + </para> </refsect1> </refentry> @@ -433,17 +429,19 @@ <example> <title><function>get_browser</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php function list_array ($array) { - while (list ($key, $value) = each ( $array ) ) { - $str .= "&lt;b&gt;$key:&lt;/b&gt; $value&lt;br&gt;\n"; - } - return $str; + while (list ($key, $value) = each ($array)) { + $str .= "<b>$key:</b> $value<br>\n"; + } + return $str; } -echo "$HTTP_USER_AGENT&lt;hr&gt;\n"; +echo "$HTTP_USER_AGENT<hr>\n"; $browser = get_browser(); echo list_array ((array) $browser); -?&gt; +?> +]]> </programlisting> </example> </para> @@ -451,26 +449,28 @@ 上のスクリプトの出力は、次のようになります。 </simpara> <programlisting> -Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586)&lt;hr&gt; -&lt;b&gt;browser_name_pattern:&lt;/b&gt; Mozilla/4\.5.*&lt;br&gt; -&lt;b&gt;parent:&lt;/b&gt; Netscape 4.0&lt;br&gt; -&lt;b&gt;platform:&lt;/b&gt; Unknown&lt;br&gt; -&lt;b&gt;majorver:&lt;/b&gt; 4&lt;br&gt; -&lt;b&gt;minorver:&lt;/b&gt; 5&lt;br&gt; -&lt;b&gt;browser:&lt;/b&gt; Netscape&lt;br&gt; -&lt;b&gt;version:&lt;/b&gt; 4&lt;br&gt; -&lt;b&gt;frames:&lt;/b&gt; 1&lt;br&gt; -&lt;b&gt;tables:&lt;/b&gt; 1&lt;br&gt; -&lt;b&gt;cookies:&lt;/b&gt; 1&lt;br&gt; -&lt;b&gt;backgroundsounds:&lt;/b&gt; &lt;br&gt; -&lt;b&gt;vbscript:&lt;/b&gt; &lt;br&gt; -&lt;b&gt;javascript:&lt;/b&gt; 1&lt;br&gt; -&lt;b&gt;javaapplets:&lt;/b&gt; 1&lt;br&gt; -&lt;b&gt;activexcontrols:&lt;/b&gt; &lt;br&gt; -&lt;b&gt;beta:&lt;/b&gt; &lt;br&gt; -&lt;b&gt;crawler:&lt;/b&gt; &lt;br&gt; -&lt;b&gt;authenticodeupdate:&lt;/b&gt; &lt;br&gt; -&lt;b&gt;msn:&lt;/b&gt; &lt;br&gt; +<![CDATA[ +Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586)<hr> +<b>browser_name_pattern:</b> Mozilla/4\.5.*<br> +<b>parent:</b> Netscape 4.0<br> +<b>platform:</b> Unknown<br> +<b>majorver:</b> 4<br> +<b>minorver:</b> 5<br> +<b>browser:</b> Netscape<br> +<b>version:</b> 4<br> +<b>frames:</b> 1<br> +<b>tables:</b> 1<br> +<b>cookies:</b> 1<br> +<b>backgroundsounds:</b> <br> +<b>vbscript:</b> <br> +<b>javascript:</b> 1<br> +<b>javaapplets:</b> 1<br> +<b>activexcontrols:</b> <br> +<b>beta:</b> <br> +<b>crawler:</b> <br> +<b>authenticodeupdate:</b> <br> +<b>msn:</b> <br> +]]> </programlisting> <simpara> これを動作させるためには、設定ファイルの @@ -494,7 +494,7 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>boolean <function>highlight_file</function></funcdef> + <funcdef>bool <function>highlight_file</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -529,45 +529,48 @@ <para> <informalexample> <programlisting> -&lt;Location /source&gt; +<![CDATA[ +<Location /source> ForceType application/x-httpd-php -&lt;/Location&gt; +</Location> +]]> </programlisting> </informalexample> </para> <simpara> - そして、&quot;source&quot; という名前のファイルを作成し、それを - Webのルートディレクトリに置きます。 + そして、"source"という名前のファイルを作成し、それをWebのルート + ディレクトリに置きます。 </simpara> <para> <programlisting role="php"> -&lt;HTML&gt; -&lt;HEAD&gt; -&lt;TITLE&gt;Source Display&lt;/TITLE&gt; -&lt;/HEAD&gt; -&lt;BODY BGCOLOR=&quot;white&quot;&gt; -&lt;?php - $script = getenv (&quot;PATH_TRANSLATED&quot;); +<![CDATA[ +<HTML> +<HEAD> +<TITLE>Source Display</TITLE> +</HEAD> +<BODY BGCOLOR="white"> +<?php + $script = getenv ("PATH_TRANSLATED"); if(!$script) { - echo &quot;&lt;BR&gt;&lt;B&gt;ERROR: Script Name needed&lt;/B&gt;&lt;BR&gt;&quot;; + echo "<BR><B>ERROR: Script Name needed</B><BR>"; } else { - if (ereg(&quot;(\.php|\.inc)$&quot;,$script)) { - echo &quot;&lt;H1&gt;Source of: $PATH_INFO&lt;/H1&gt;\n&lt;HR&gt;\n&quot;; - highlight_file($script); + if (ereg("(\.php|\.inc)$",$script)) { + echo "<H1>Source of: $PATH_INFO</H1>\n<HR>\n"; + highlight_file($script); } else { - echo &quot;&lt;H1&gt;ERROR: Only PHP or include script names are allowed&lt;/H1&gt;&quot;; + echo "<H1>ERROR: Only PHP or include script names are allowed</H1>"; } } - echo &quot;&lt;HR&gt;Processed: &quot;.date(&quot;Y/M/d H:i:s&quot;,time()); -?&gt; -&lt;/BODY&gt; -&lt;/HTML&gt; + echo "<HR>Processed: ".date("Y/M/d H:i:s",time()); +?> +</BODY> +</HTML> +]]> </programlisting> </para> <simpara> - これにより、&quot;/path/to/script.php&quot; にあるスクリプトの - カラー表示を表示するために以下のURLを使用することができるように - なります。 + これにより、"/path/to/script.php"にあるスクリプトのカラー表示を + 表示するために以下のURLを使用することができるようになります。 </simpara> <para> <informalexample> @@ -578,6 +581,7 @@ </para> </example> </para> + &tip.ob-capture; <simpara> <function>highlight_string</function>, <function>show_source</function>も参照下さい。 @@ -594,7 +598,7 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>boolean <function>highlight_string</function></funcdef> + <funcdef>bool <function>highlight_string</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -602,8 +606,9 @@ <function>highlight_string</function> 関数は、PHP組込みの構文ハイ ライタで定義されたカラーを使用して<parameter>str</parameter>を構 文ハイライト表示されたものを出力します。 - 成功時に&true;、そうでない場合に&false;を返します。(PHP 4) + &return.success; </simpara> + &tip.ob-capture; <simpara> <function>highlight_file</function>, <function>show_source</function>も参照下さい。 @@ -834,7 +839,9 @@ <example> <title>フォーマット文字列のパック</title> <programlisting role="php"> -$binarydata = pack("nvc*", 0x1234, 0x5678, 65, 66); +<![CDATA[ +$binarydata = pack ("nvc*", 0x1234, 0x5678, 65, 66); +]]> </programlisting> <para> この結果のバイナリ文字列は、6バイト長であり、 @@ -849,10 +856,10 @@ さい。 </para> <para> - PHP は内部的に値をマシン依存の大きさの符号付の値として保持する - ことにも注意して下さい。 + PHP は内部的に値をマシン依存の大きさの符号付の + <type>integer</type>値として保持することにも注意して下さい。 このように保持するには大きすぎる符号無しの値を与えた場合、 - 倍精度実数に変換する際にしばしば期待外れの結果となります。 + <type>float</type>に変換する際にしばしば期待外れの結果となります。 </para> </refsect1> </refentry> @@ -866,7 +873,7 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>boolean <function>show_source</function></funcdef> + <funcdef>bool <function>show_source</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -927,7 +934,7 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>uniqid</function></funcdef> + <funcdef>string <function>uniqid</function></funcdef> <paramdef>string <parameter>prefix</parameter></paramdef> <paramdef>bool <parameter> @@ -965,8 +972,10 @@ キー)、次の例のようにするのが推奨されます。 <informalexample> <programlisting role="php"> -$token = md5 (uniqid ("")); // ランダム要素なし -$better_token = md5 (uniqid (rand())); // 推測が困難であり、より優れている。 +<![CDATA[ +$token = md5(uniqid("")); // ランダム要素なし +$better_token = md5(uniqid(rand(),1)); // 推測が困難であり、より優れている。 +]]> </programlisting> </informalexample> </para> @@ -1003,7 +1012,9 @@ <example> <title>フォーマット文字列の<function>unpack</function></title> <programlisting role="php"> +<![CDATA[ $array = unpack ("c2chars/nint", $binarydata); +]]> </programlisting> <para> 結果の配列は、エントリ "chars1","chars2","int" を保持します。 @@ -1053,6 +1064,7 @@ </refentry> </reference> + <!-- Keep this comment at the end of the file Local variables: mode: sgml Index: phpdoc/ja/functions/mnogosearch.xml diff -u phpdoc/ja/functions/mnogosearch.xml:1.7 phpdoc/ja/functions/mnogosearch.xml:1.8 --- phpdoc/ja/functions/mnogosearch.xml:1.7 Wed Dec 12 15:53:21 2001 +++ phpdoc/ja/functions/mnogosearch.xml Sat Jan 26 03:55:51 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.8 $ --> <reference id="ref.mnogo"> <title>mnoGoSearch 関数</title> <titleabbrev>mnoGoSearch</titleabbrev> @@ -6,13 +7,15 @@ <simpara> ここで示す関数により、フリーの検索エンジン mnoGoSearch (旧名は UdmSearch)へアクセスすることが可能となります。これらの関数を利用可 - 能とするためには、オプション <option - role="configure">--with-mnogosearch</option> により mnogosearchサ - ポートを指定してPHPをコンパイルする必要があります。mnogosearchのパ - スを指定せずにこのオプションを使用した場合、PHPはデフォルトで - mnogosearchが/usr/local/mnogosearchにあるものとして検索を行います。 - mnogosearchを他の場所にインストールしている場合には、 - <option role="configure">--with-mnogosearch=DIR</option>のようにそ + 能とするためには、オプション<link + linkend="install.configure.with-mnogosearch"><option + role="configure">--with-mnogosearch</option></link>により + mnogosearchサポートを指定してPHPをコンパイルする必要があります。 + mnogosearchのパスを指定せずにこのオプションを使用した場合、PHPはデ + フォルトでmnogosearchが/usr/local/mnogosearchにあるものとして検索 + を行います。mnogosearchを他の場所にインストールしている場合には、 + <link linkend="install.configure.with-mnogosearch"><option + role="configure">--with-mnogosearch=DIR</option></link>のようにそ のパスを指定する必要があります。 </simpara> <para> @@ -41,7 +44,8 @@ configureにMySQLをインストールしたディレクトリを指定する必要が あります。これは、mnoGoSearchに関する設定で使用され、例えば、次の ようになります。 - <option role="configure">--with-mnogosearch --with-mysql=/usr</option> + <link linkend="install.configure.with-mnogosearch"><option role="configure"> + --with-mnogosearch --with-mysql=/usr</option></link> </para> </note> <simpara> @@ -54,283 +58,6 @@ </simpara> </partintro> - <refentry id="function.udm-alloc-agent"> - <refnamediv> - <refname>udm_alloc_agent</refname> - <refpurpose>mnoGoSearch セッションを確保する</refpurpose> - </refnamediv> - <refsect1> - <title>説明</title> - <funcsynopsis> - <funcprototype> - <funcdef>int <function>udm_alloc_agent</function></funcdef> - <paramdef>string <parameter>dbaddr</parameter></paramdef> - <paramdef>string - <parameter> - <optional>dbmode</optional> - </parameter> - </paramdef> - </funcprototype> - </funcsynopsis> - <para> - <function>udm_alloc_agent</function> は、成功時にmnogosearchエー - ジェントID、エラー時に&false;を返します。この関 - 数は、データベースパラメータを有するセッションを生成します。 - </para> - <para> - <parameter>dbaddr</parameter> - URL形式のデータベース名。SQLデー - タベースへ接続する際のオプション(型、ホスト、データベース名、ポー - ト、ユーザ、パスワード)。 - 組み込みのテキストファイルサポートには関係ありません。フォーマッ - ト: DBAddr DBType:[//[DBUser[:DBPass]@]DBHost[:DBPort]]/DBName/ - 現在、サポートされている DBType の値は次のものです。: mysql, - pgsql, msql, solid, mssql, oracle, ibase - 実際、ネーティブなライブラリのサポートは重要ではありません。しかし、 - ODBCユーザは、サポートされる値の一つを指定する必要があります。使 - 用するデータベース型がサポートされていない場合、"unknown"を代わり - に使用することも可能です。 - </para> - <para> - <parameter>dbmode</parameter> - 単語の記憶用SQLデータベースモー - ドを選択可能です。"single"を指定した場合、全ての単語は、同じテー - ブルに保存されます。"multi"を選択した場合、単語はその長さに応じて - 別々のテーブルに保存されます。"multi"モードの方が通常高速ですが、 - データベース上でより多くのテーブルを必要とします。"crc"モードが選 - 択された場合、mnoGoSearch は、単語の代わりにCRC32アルゴリズムで計 - 算された32ビット整数の単語IDを保存します。このモードで必要なディ - スク容量はより小さいですが、"single"および"multi"モードと比較して - より高速です。"crc-multi" は、"crc"モードと同じ記憶構造を使用しま - すが、"multi"モードのように単語長に応じて別々のデータベースに単語 - を保存します。フォーマット: DBMode single/multi/crc/crc-multi - </para> - <note> - <para> - <parameter>dbaddr</parameter> および - <parameter>dbmode</parameter> は、インデックス作成時に使用される - これらの選択子に一致している必要があります。 - </para> - </note> - <note> - <para> - 実際、これらの関数はデータベースへの接続をオープンする必要はなく、 - よって、ログイン名やパスワードを確認しません。実際のデータベース - への接続およびログイン/パスワード認証は、 - <function>udm_find</function>で行われます。 - </para> - </note> - </refsect1> - </refentry> - - <refentry id="function.udm-set-agent-param"> - <refnamediv> - <refname>udm_set_agent_param</refname> - <refpurpose> - mnoGoSearch エージェントのセッションパラメータを設定する - </refpurpose> - </refnamediv> - <refsect1> - <title>説明</title> - <funcsynopsis> - <funcprototype> - <funcdef>int <function>udm_set_agent_param</function></funcdef> - <paramdef>int <parameter>agent</parameter></paramdef> - <paramdef>int <parameter>var</parameter></paramdef> - <paramdef>string <parameter>val</parameter></paramdef> - </funcprototype> - </funcsynopsis> - <para> - <function>udm_set_agent_param</function> は成功時に - &true;、エラー時に&false;を返し - ます。mnoGoSearch セッションパラメータを定義します。 - </para> - <simpara> - 以下のパラメータおよびそれらの値が利用可能です。 - </simpara> - <itemizedlist> - <listitem> - <simpara> - UDM_PARAM_PAGE_NUM - はページ番号を検索結果とするために使用さ - れます。(結果は、ページ毎にUDM_PARAM_PAGE_SIZE個の結果を有する0 - から始まるページで返されます) - </simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_PAGE_SIZE - は一ページに表示される検索結果の数。 - </simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_SEARCH_MODE - 検索モード。次の値が利用可能です。: - UDM_MODE_ALL - 全ての単語を検索します。; - UDM_MODE_ANY - 全ての単語で検索する; - UDM_MODE_PHRASE - 熟語検索; - UDM_MODE_BOOL - 論理値検索。論理値検索に関する詳細については - <function>udm_find</function> を参照下さい。 - </simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_CACHE_MODE - 検索結果のキャッシュモードをオンまたはオ - フにします。有効の場合、検索エンジンは検索結果をディスクに保存 - します。似たような検索が後で実行された場合、エンジンはより高速 - にキャッシュから結果を得ることが可能です。 - 利用可能な値: UDM_CACHE_ENABLED, UDM_CACHE_DISABLED. - </simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_TRACK_MODE - クエリ追跡モードをオンまたはオフにします。 - バージョン3.1.2以降、mnoGoSearch はクエリ追跡モードをサポートし - ています。追跡はSQLバージョンにのみ実装されており、組み込みデー - タベースでは利用できません。追跡を使用するには、テーブルを追跡 - サポート用に作成する必要があります。MySQLの場合、 - create/mysql/track.txtを使用して下さい。検索実行時に、フロント - エンドはクエリ単語、見つけたドキュメントの数、カレントの秒単位 - のUNIXタイムスタンプを保存するためにこれらのテーブルを使用しま - す。 - 利用可能な値: UDM_TRACK_ENABLED, UDM_TRACK_DISABLED. - </simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_PHRASE_MODE - 熟語を用いたインデックスデータベースか - どうかを定義します。(indexer.confにおける"phrase" パラメータ) - 使用可能な値: UDM_PHRASE_ENABLED および UDM_PHRASE_DISABLED。 - 熟語検索が有効な場合(UDM_PHRASE_ENABLED)でも、全てのモード - (ANY、ALL、BOOL、PHRASE)で検索が可能であることに注意して下さい。 - mnoGoSearchのバージョン3.1.10で熟語検索がSQLと組み込みデータベー - スモードでのみサポートされました。一方、3.1.11で熟語がcachemode - でもサポートされ始めました。 - </simpara> - <simpara> - 熟語検索の例: - </simpara> - <simpara> - "Arizona desert" - このクエリは、"Arizona desert"を熟語として含 - む全てのドキュメントを返します。熟語の前後に二重引用符が必要で - あることに注意して下さい。 - </simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_CHARSET - ローカルなcharsetを定義します。利用可能な値: - mnoGoSearchによりサポートされるcharsetの組, - 例えば、koi8-r, cp1251, ... - </simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_STOPFILE - stopfileの名前とパスを定義します。 - (mnoGoSearchと若干違いがあります。つまり、mnoGoSearchにおいては、 - 相対パスまたはパスが入力されなかった場合、UDM_CONF_DIRに関して - このファイルが探されます。モジュールは、このファイルをカレント - のパス(すなわち、PHPスクリプトが実行されるパス)で探します。 - </simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_STOPTABLE - 指定したSQLテーブルから停止単語をロードし - ます。複数のStopwordTableコマンドを使用可能です。このコマンドは、 - SQLデータベースサポートを有効にせずにコンパイルした場合は使用で - きません。 - </simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_WEIGHT_FACTOR - 指定したドキュメント部分の重み係数を - 表します。現在、body, title, keywords, description, urlがサポー - トされています。この機能を有効にするには、indexer.confの*Weight - コマンドに2の累乗を指定して下さい。ここで次のような重みを指定し - た場合を考えてみましょう。 - </simpara> - <simpara>URLWeight 1</simpara> - <simpara>BodyWeight 2</simpara> - <simpara>TitleWeight 4</simpara> - <simpara>KeywordWeight 8</simpara> - <simpara>DescWeight 16</simpara> - <simpara> - 同じドキュメントにいくつかの単語が複数回現れる場合、 - indexerが単語の重みにOR演算子を使用するので、異なったドキュメン - トの部分に単語が現れる回数を検出可能です。全てのドキュメント部 - 分で使用される単語は、重み集合 00011111 を有します。 - </simpara> - <simpara> - このパラメータの値は、16進数文字列 ABCDE です。各桁は、単語重み - の対応するビットの因子です。上で指定した重み設定は次のようにな - ります。 - </simpara> - <simpara>E は重み1の因子 (URL Weight ビット)</simpara> - <simpara>D は重み2の因子 (BodyWeight ビット)</simpara> - <simpara>C は重み4の因子 (TitleWeight ビット)</simpara> - <simpara>B は重み8の因子 (KeywordWeight ビット)</simpara> - <simpara>A は重み16の因子 (DescWeight ビット)</simpara> - <simpara> - 例: - </simpara> - <simpara> - UDM_PARAM_WEIGHT_FACTOR=00001 は、URLのみを検索します。 - </simpara> - <simpara> - UDM_PARAM_WEIGHT_FACTOR=00100 は、Titleのみを検索します。 - </simpara> - <simpara> - UDM_PARAM_WEIGHT_FACTOR=11100 は、Title,Keywords,Desctriptionを - 検索しますが、URL と Bodyは検索しません。 - </simpara> - <simpara> - UDM_PARAM_WEIGHT_FACTOR=F9421 は、次の検索を行います。 - </simpara> - <simpara>Description with factor 15 (16進数 F)</simpara> - <simpara>Keywords with factor 9</simpara> - <simpara>Title with factor 4</simpara> - <simpara>Body with factor 2</simpara> - <simpara>URL with factor 1</simpara> - <simpara> - UDM_PARAM_WEIGHT_FACTOR 変数が省略された場合、元の重みの値はソー - ト結果から引き出されます。上記で指定した重み設定の場合、ドキュ - メントのDescriptionは、最大重み16を有するドキュメントの - descriptionを意味します。 - </simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_WORD_MATCH - 単語にマッチ。このパラメータを単語検索型 - を選択する際に使用可能です。この機能は、"single"および"multi"モー - ドでSQLデータベースおよび組み込みのデータベースを使用する場合に - のみ動作します。この機能は、cachemodeおよび他のモードでは動作し - ません。これは、これらのモードが、単語CRCを使用しており、部分文 - 字列検索をサポートしていないからです。 - 利用可能な値は次のようになります。 - </simpara> - <simpara>UDM_MATCH_BEGIN - 単語の始めにマッチ</simpara> - <simpara>UDM_MATCH_END - 単語の終りにマッチ</simpara> - <simpara>UDM_MATCH_WORD - 単語全体にマッチ</simpara> - <simpara>UDM_MATCH_SUBSTR - 単語の部分文字列にマッチ</simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_MIN_WORD_LEN - 単語の最短長を定義します。 - この制限より短い単語は、stopwordとみなされます。このパラメータ - はその値自身も範囲に含むことに注意して下さい。つまり、 - UDM_PARAM_MIN_WORD_LEN=3 の場合、3文字の長さの単語はstopwordと - 見なされませんが、2文字の単語はstopwordとみなされます。デフォル - トは1です。 - </simpara> - </listitem> - <listitem> - <simpara> - UDM_PARAM_MAX_WORD_LEN - 最長の単語を定義します。この制限よりも - 長い単符は、stopwordとみなされます。このパラメータはその値も範 - 囲に含むことに注意して下さい。つまり、UDM_PARAM_MAX_WORD_LEN=32 - の場合、32文字の単語はstopwordとみなされませんが、33文字の単語 - はみなされます。デフォルトは、32です。 - </simpara> - </listitem> - </itemizedlist> - </refsect1> - </refentry> - <refentry id="function.udm-add-search-limit"> <refnamediv> <refname>udm_add_search_limit</refname> @@ -416,8 +143,246 @@ </itemizedlist> </refsect1> </refentry> - -<refentry id="function.udm-clear-search-limits"> + + <refentry id="function.udm-alloc-agent"> + <refnamediv> + <refname>udm_alloc_agent</refname> + <refpurpose>mnoGoSearch セッションを確保する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>udm_alloc_agent</function></funcdef> + <paramdef>string <parameter>dbaddr</parameter></paramdef> + <paramdef>string + <parameter><optional>dbmode</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_alloc_agent</function> は、成功時にmnogosearchエー + ジェントID、エラー時に&false;を返します。この関数は、データベース + パラメータを有するセッションを生成します。 + </para> + <para> + <parameter>dbaddr</parameter> - URL形式のデータベース名。SQLデー + タベースへ接続する際のオプション(型、ホスト、データベース名、ポー + ト、ユーザ、パスワード)。 + 組み込みのテキストファイルサポートには関係ありません。フォーマッ + ト: DBAddr DBType:[//[DBUser[:DBPass]@]DBHost[:DBPort]]/DBName/ + 現在、サポートされている DBType の値は次のものです。: mysql, + pgsql, msql, solid, mssql, oracle, ibase + 実際、ネーティブなライブラリのサポートは重要ではありません。しかし、 + ODBCユーザは、サポートされる値の一つを指定する必要があります。使 + 用するデータベース型がサポートされていない場合、"unknown"を代わり + に使用することも可能です。 + </para> + <para> + <parameter>dbmode</parameter> - 単語の記憶用SQLデータベースモー + ドを選択可能です。"single"を指定した場合、全ての単語は、同じテー + ブルに保存されます。"multi"を選択した場合、単語はその長さに応じて + 別々のテーブルに保存されます。"multi"モードの方が通常高速ですが、 + データベース上でより多くのテーブルを必要とします。"crc"モードが選 + 択された場合、mnoGoSearch は、単語の代わりにCRC32アルゴリズムで計 + 算された32ビット整数の単語IDを保存します。このモードで必要なディ + スク容量はより小さいですが、"single"および"multi"モードと比較して + より高速です。"crc-multi" は、"crc"モードと同じ記憶構造を使用しま + すが、"multi"モードのように単語長に応じて別々のデータベースに単語 + を保存します。フォーマット: DBMode single/multi/crc/crc-multi + </para> + <note> + <para> + <parameter>dbaddr</parameter> および + <parameter>dbmode</parameter> は、インデックス作成時に使用される + これらの選択子に一致している必要があります。 + </para> + </note> + <note> + <para> + 実際、これらの関数はデータベースへの接続をオープンする必要はなく、 + よって、ログイン名やパスワードを確認しません。実際のデータベース + への接続およびログイン/パスワード認証は、 + <function>udm_find</function>で行われます。 + </para> + </note> + </refsect1> + </refentry> + + <refentry id="function.udm-api-version"> + <refnamediv> + <refname>udm_api_version</refname> + <refpurpose>mnoGoSearch APIバージョンを取得する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>udm_api_version</function></funcdef> + <void/> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_api_version</function>は、mnoGoSearch APIバージョン + 番号を返します。例えば、mnoGoSearch 3.1.10 APIを使用している場合、 + この関数は、<literal>30110</literal>を返します。 + </para> + <para> + この関数により利用可能なAPI関数をユーザが調べることが可能となりま + す。例えば、<function>udm_get_doc_count</function>関数は + mnoGoSearch 3.1.11以降でのみ利用可能です。 + </para> + <simpara>例:</simpara> + <informalexample> + <programlisting role="php"> +<![CDATA[ + if (udm_api_version() >= 30111) { + print "Total number of urls in database: ".udm_get_doc_count($udm)."<br>\n"; + } +]]> + </programlisting> + </informalexample> + </refsect1> + </refentry> + + <refentry id="function.udm-cat-path"> + <refnamediv> + <refname>udm_cat_path</refname> + <refpurpose>カレントのカテゴリへのパスを取得する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>array <function>udm_cat_path</function></funcdef> + <paramdef>int <parameter>agent</parameter></paramdef> + <paramdef>string <parameter>category</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_cat_path</function>は、ツリールートからカレントのカ + テゴリへのカテゴリツリーの中の既述パスを含む配列を返します。 + </para> + <para> + <parameter>agent</parameter> - エージェントリンクID。 + </para> + <para> + <parameter>category</parameter> - カレントのカテゴリ - パスを得よ + うとするカテゴリ。 + </para> + <para> + 以下の形式の配列を返します。 + </para> + <para> + 組から構成される配列。偶数添字番号の要素にはカテゴリパス、奇数要 + 素には、対応するカテゴリ名が含まれます。 + </para> + <para> + 例えば、<literal>$array=udm_cat_path($agent, '02031D');</literal> + とコールすると、以下の配列が返されます。 + </para> + <literallayout> +<![CDATA[ +$array[0] will contain '' +$array[1] will contain 'Root' +$array[2] will contain '02' +$array[3] will contain 'Sport' +$array[4] will contain '0203' +$array[5] will contain 'Auto' +$array[4] will contain '02031D' +$array[5] will contain 'Ferrari' +]]> + </literallayout> + <example> + <title> + カレントのカテゴリへのパスは以下の形式で指定します。 + '&gt; Root &gt; Sport &gt; Auto &gt; Ferrari' + </title> + <programlisting role="php"> +<![CDATA[ +<?php + $cat_path_arr = udm_cat_path($udm_agent,$cat); + $cat_path = ''; + for ($i=0; $i<count($cat_path_arr); $i+=2) { + $path = $cat_path_arr[$i]; + $name = $cat_path_arr[$i+1]; + $cat_path .= " > <a href=\"$PHP_SELF?cat=$path\">$name</a> "; + } +?> +]]> + </programlisting> + </example> + </refsect1> + </refentry> + + <refentry id="function.udm-cat-list"> + <refnamediv> + <refname>udm_cat_list</refname> + <refpurpose> + カレントのカテゴリと同じレベルのカテゴリを全て取得する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>array <function>udm_cat_list</function></funcdef> + <paramdef>int <parameter>agent</parameter></paramdef> + <paramdef>string <parameter>category</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_cat_list</function>は、カテゴリツリーの中のカレント + カテゴリと同じレベルの全てのカテゴリの一覧を配列として返します。 + </para> + <para> + この関数は、カテゴリツリーのブラウザを開発する際に有用です。 + </para> + <para> + 以下の形式で配列を返します。 + </para> + <para> + 組から構成される配列。偶数添字番号の要素にはカテゴリパス、奇数要 + 素には、対応するカテゴリ名が含まれます。 + </para> + <literallayout> +<![CDATA[ +$array[0] will contain '020300' +$array[1] will contain 'Audi' +$array[2] will contain '020301' +$array[3] will contain 'BMW' +$array[4] will contain '020302' +$array[5] will contain 'Opel' +... +etc. +]]> + </literallayout> + <literallayout> + 以下は、カレントのレベルのリンクをこの形式で表示する例です。 + Audi + BMW + Opel + ... + </literallayout> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php + $cat_list_arr = udm_cat_list($udm_agent,$cat); + $cat_list = ''; + for ($i=0; $i<count($cat_list_arr); $i+=2) { + $path = $cat_list_arr[$i]; + $name = $cat_list_arr[$i+1]; + $cat_list .= "<a href=\"$PHP_SELF?cat=$path\">$name</a><br>"; + } +?> +]]> + </programlisting> + </informalexample> + </refsect1> + </refentry> + + <refentry id="function.udm-clear-search-limits"> <refnamediv> <refname>udm_clear_search_limits</refname> <refpurpose> @@ -439,6 +404,62 @@ </refsect1> </refentry> + <refentry id="function.udm-errno"> + <refnamediv> + <refname>udm_errno</refname> + <refpurpose>mnoGoSearch エラー番号を取得する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>udm_errno</function></funcdef> + <paramdef>int <parameter>agent</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_errno</function> は、mnoGoSearch エラー番号を返しま + す。エラーがない場合にゼロを返します。 + </para> + <para> + <parameter>agent</parameter> - + <function>udm_alloc_agent</function>へのコールから返されるエージェ + ントIDへのリンク + </para> + <para> + 数字でエージェントエラーコードを返します。 + </para> + </refsect1> + </refentry> + + <refentry id="function.udm-error"> + <refnamediv> + <refname>udm_error</refname> + <refpurpose>mnoGoSearch エラーメッセージを得る</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>udm_error</function></funcdef> + <paramdef>int <parameter>agent</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_error</function> は、mnoGoSearch エラーメッセージを + 返します。エラーがない場合には、空の文字列を返します。 + </para> + <para> + <parameter>agent</parameter> は、エージェントIDへのリンクであり、 + <function>udm_alloc_agent</function>をコールした際に得られたもの + です。 + </para> + <para> + エージェントエラーメッセージを得ます。 + </para> + </refsect1> + </refentry> + <refentry id="function.udm-find"> <refnamediv> <refname>udm_find</refname> @@ -457,7 +478,7 @@ <function>udm_find</function> は成功時に結果リンクID、エラー時に &false; を返します。 </para> - <para> + <para> 検索を行います。最初の引数はセッション、次の引数はクエリ本体です。 検索の実行は、探す単語を入力し、投稿ボタンを押すだけで可能です。 例えば、"mysql odbc"。この例で引用符は他のテキストから区別するた @@ -498,7 +519,229 @@ </refsect1> </refentry> - <refentry id="function.udm-get-res-param"> + <refentry id="function.udm-free-agent"> + <refnamediv> + <refname>udm_free_agent</refname> + <refpurpose>mnoGoSearch セッションを開放する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>udm_free_agent</function></funcdef> + <paramdef>int <parameter>agent</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_free_agent</function> は成功時に + &true;、エラー時に&false;を返し + ます。 + </para> + <para> + <parameter>agent</parameter> - + <function>udm_alloc_agent</function>から返されたエージェントIDへ + のリンク。 + </para> + <para> + エージェントセッション用に確保されたメモリを開放します。 + </para> + </refsect1> + </refentry> + + <refentry id="function.udm-free-ispell-data"> + <refnamediv> + <refname>udm_free_ispell_data</refname> + <refpurpose>ispellデータ用に確保されたメモリを解放する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>udm_free_ispell_data</function></funcdef> + <paramdef>int <parameter>agent</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_free_ispell_data</function>は、常に&true;を返します。 + </para> + <para> + <parameter>agent</parameter> - + <function>udm_alloc_agent</function>により得られるエージェントリン + クID。 + </para> + <note> + <para> + この関数は、mnoGoSearchバージョン3.1.12以降でサポートされた関数で、 + これ以前のバージョンではサポートされていません。 + </para> + </note> + </refsect1> + </refentry> + + <refentry id="function.udm-free-res"> + <refnamediv> + <refname>udm_free_res</refname> + <refpurpose>mnoGoSearch 結果を開放する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>udm_free_res</function></funcdef> + <paramdef>int <parameter>res</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_free_res</function> は成功時に + &true;、エラー時に&false;を返し + ます。 + </para> + <para> + <parameter>res</parameter> - <function>udm_find</function>から返 + された結果IDへのリンク。 + </para> + <para> + 結果用に確保されたメモリを開放します。 + </para> + </refsect1> + </refentry> + + <refentry id="function.udm-get-doc-count"> + <refnamediv> + <refname>udm_get_doc_count</refname> + <refpurpose>Get total number of documents in database.</refpurpose> + </refnamediv> + + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>udm_get_doc_count</function></funcdef> + <paramdef>int <parameter>agent</parameter></paramdef> + </funcprototype> + </funcsynopsis> + + <para> + <function>udm_get_doc_count</function> returns number of documents in database. + </para> + + <para> + <parameter>agent</parameter> - link to agent identifier, received after + call to <function>udm_alloc_agent</function>. + </para> + + <note> + <simpara> + This function is supported only in mnoGoSearch 3.1.11 or later. + </simpara> + </note> + + </refsect1> + </refentry> + + <refentry id="function.udm-get-res-field"> + <refnamediv> + <refname>udm_get_res_field</refname> + <refpurpose>mnoGoSearch 結果フィールドを取得する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>udm_get_res_field</function></funcdef> + <paramdef>int <parameter>res</parameter></paramdef> + <paramdef>int <parameter>row</parameter></paramdef> + <paramdef>int <parameter>field</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_get_res_field</function> は、成功時に結果フィールド、 + エラー時に&false;を返します。 + </para> + <para> + <parameter>res</parameter> - <function>udm_find</function>から返 + された結果IDへのリンク。 + </para> + <para> + <parameter>row</parameter> - カレントページのリンク番号。0から + <parameter>UDM_PARAM_NUM_ROWS</parameter>までの番号。 + </para> + <para> + <parameter>field</parameter> - フィールドID。次の値のどれか。 + </para> + <itemizedlist> + <listitem> + <simpara> + UDM_FIELD_URL - ドキュメントURLフィールド + </simpara> + </listitem> + <listitem> + <simpara> + UDM_FIELD_CONTENT - ドキュメントContent-typeフィールド (例えば、 + text/html) + </simpara> + </listitem> + <listitem> + <simpara> + UDM_FIELD_TITLE - ドキュメントのtitleフィールド。 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_FIELD_KEYWORDS - ドキュメントkeywordsフィールド(META + KEYWORDSタグから) + </simpara> + </listitem> + <listitem> + <simpara> + UDM_FIELD_DESC - ドキュメントdescriptionフィールド (META + DESCRIPTIONタグから) + </simpara> + </listitem> + <listitem> + <simpara> + UDM_FIELD_TEXT - ドキュメント body テキスト (最初の数行でドキュ + メントの内容に関するアイデアを示す)。 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_FIELD_SIZE - ドキュメントのサイズ。 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_FIELD_URLID - リンクへのユニークなURL ID。 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_FIELD_RATING - (mnoGoSearchで計算された)ページのレーティン + グ。 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_FIELD_MODIFIED - unixtime形式のlast-modifiedフィールド。 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_FIELD_ORDER - 見つかったドキュメントの中のカレントのドキュ + メントの数 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_FIELD_CRC - ドキュメントCRC。 + </simpara> + </listitem> + </itemizedlist> + </refsect1> + </refentry> + + + <refentry id="function.udm-get-res-param"> <refnamediv> <refname>udm_get_res_param</refname> <refpurpose>mnoGoSearch 結果パラメータを取得する</refpurpose> @@ -513,272 +756,614 @@ </funcprototype> </funcsynopsis> <para> - <function>udm_get_res_param</function> は成功時に結果パラメータを - 返します。エラー時に&false;を返します。 - </para> - <para> - <parameter>res</parameter> - <function>udm_find</function>から返 - された結果IDへのリンク。 - </para> - <para> - <parameter>param</parameter> - パラメータIDであり、次の値のどれか - となります。 + <function>udm_get_res_param</function> は成功時に結果パラメータを + 返します。エラー時に&false;を返します。 + </para> + <para> + <parameter>res</parameter> - <function>udm_find</function>から返 + された結果IDへのリンク。 + </para> + <para> + <parameter>param</parameter> - パラメータIDであり、次の値のどれか + となります。 + </para> + <itemizedlist> + <listitem> + <simpara> + UDM_PARAM_NUM_ROWS - カレントのページで見付かったリンクの数。 + 全ての検索ページでの最後のページでのUDM_PARAM_PAGE_SIZE、残りの + リンクに等しい。 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_PARAM_FOUND - クエリにマッチする結果の合計の数 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_PARAM_WORDINFO - 見付かった単語に関する情報。例えば、"a + good book" に関するクエリは "a: stopword, good:5637, book: 120" + を返します。 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_PARAM_SEARCHTIME - 秒単位の検索時間。 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_PARAM_FIRST_DOC - カレントのページに表示される最初のドキュ + メントの数。 + </simpara> + </listitem> + <listitem> + <simpara> + UDM_PARAM_LAST_DOC - カレントのページに表示される最後のドキュメ + ントの数。 + </simpara> + </listitem> + </itemizedlist> + </refsect1> + </refentry> + + <refentry id="function.udm-load-ispell-data"> + <refnamediv> + <refname>udm_load_ispell_data</refname> + <refpurpose>ispellデータを読み込む</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>udm_load_ispell_data</function></funcdef> + <paramdef>int <parameter>agent</parameter></paramdef> + <paramdef>int <parameter>var</parameter></paramdef> + <paramdef>string <parameter>val1</parameter></paramdef> + <paramdef>string <parameter>val2</parameter></paramdef> + <paramdef>int <parameter>flag</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_load_ispell_data</function>は、ispellデータをロード + します。成功時に&true;、エラー時に&false;を返します。 + </para> + <para> + <parameter>agent</parameter> - agent link identifier, received after call + to <function>udm_alloc_agent</function>. + </para> + <para> + <parameter>var</parameter> - parameter, indicating the source for ispell + data. May have the following values: + </para> + <para> + After using this function to free memory allocated for ispell data, please + use <function>udm_free_ispell_data</function>, even if you use + UDM_ISPELL_TYPE_SERVER mode. + </para> + <para> + The fastest mode is UDM_ISPELL_TYPE_SERVER. UDM_ISPELL_TYPE_TEXT is slower + and UDM_ISPELL_TYPE_DB is the slowest. The above pattern is &true; for + mnoGoSearch 3.1.10 - 3.1.11. It is planned to speed up DB mode in future + versions and it is going to be faster than TEXT mode. + </para> + <itemizedlist> + <listitem> + <simpara> + UDM_ISPELL_TYPE_DB - indicates that ispell data should be loaded from SQL. + In this case, parameters <parameter>val1</parameter> and <parameter>val2</parameter> + are ignored and should be left blank. <parameter>flag</parameter> + should be equal to <literal>1</literal>. + </simpara> + <note> + <para> + <parameter>flag</parameter> indicates that after loading ispell data + from defined source it sould be sorted (it is necessary for correct + functioning of ispell). In case of loading ispell data from files + there may be several calls to <function>udm_load_ispell_data</function>, + and there is no sense to sort data after every call, but only after + the last one. Since in db mode all the data is loaded by one call, + this parameter should have the value <literal>1</literal>. In this mode + in case of error, e.g. if ispell tables are absent, the function will + return &false; and code and error message will be accessible through + <function>udm_error</function> and <function>udm_errno</function>. + </para> + </note> + + <simpara>Example:</simpara> + <informalexample> + <programlisting role="php"> +if (! udm_load_ispell_data($udm,UDM_ISPELL_TYPE_DB,'','',1)) { + printf("Error #%d: '%s'\n", udm_errno($udm), udm_error($udm)); + exit; +} + </programlisting> + </informalexample> + </listitem> + <listitem> + <para> + UDM_ISPELL_TYPE_AFFIX - indicates that ispell data should be loaded from + file and initiates loading affixes file. In this case <parameter>val1</parameter> + defines double letter language code for which affixes are loaded, + and <parameter>val2</parameter> - file path. Please note, that if + a relative path entered, the module looks for the file not in UDM_CONF_DIR, + but in relation to current path, i.e. to the path where the script is executed. + In case of error in this mode, e.g. if file is absent, the function will return + &false;, and an error message will be displayed. Error message text cannot be + accessed through <function>udm_error</function> and <function>udm_errno</function>, + since those functions can only return messages associated with SQL. Please, + see <parameter>flag</parameter> parameter description in UDM_ISPELL_TYPE_DB. + </para> + + <simpara>Example:</simpara> + <informalexample> + <programlisting role="php"> + if ((! udm_load_ispell_data($udm,UDM_ISPELL_TYPE_AFFIX,'en','/opt/ispell/en.aff',0)) || + (! udm_load_ispell_data($udm,UDM_ISPELL_TYPE_AFFIX,'ru','/opt/ispell/ru.aff',0)) || + (! udm_load_ispell_data($udm,UDM_ISPELL_TYPE_SPELL,'en','/opt/ispell/en.dict',0)) || + (! udm_load_ispell_data($udm,UDM_ISPELL_TYPE_SPELL,'ru','/opt/ispell/ru.dict',1))) { + exit; + } + </programlisting> + </informalexample> + <note> + <para> + <parameter>flag</parameter> is equal to <literal>1</literal> only in the last call. + </para> + </note> + </listitem> + <listitem> + <para> + UDM_ISPELL_TYPE_SPELL - indicates that ispell data should be loaded from + file and initiates loading of ispell dictionary file. In this case + <parameter>val1</parameter> defines double letter language code for which + affixes are loaded, + and <parameter>val2</parameter> - file path. Please note, that if a relative + path entered, the module looks for the file not in UDM_CONF_DIR, but in + relation to current path, i.e. to the path where the script is executed. + In case of error in this mode, e.g. if file is absent, the function will + return &false;, and an error message will be displayed. Error message text + cannot be accessed through <function>udm_error</function> and + <function>udm_errno</function>, since those functions can only return messages + associated with SQL. Please, see <parameter>flag</parameter> parameter + description in UDM_ISPELL_TYPE_DB. + </para> + <informalexample> + <programlisting role="php"> + if ((! udm_load_ispell_data($udm,UDM_ISPELL_TYPE_AFFIX,'en','/opt/ispell/en.aff',0)) || + (! udm_load_ispell_data($udm,UDM_ISPELL_TYPE_AFFIX,'ru','/opt/ispell/ru.aff',0)) || + (! udm_load_ispell_data($udm,UDM_ISPELL_TYPE_SPELL,'en','/opt/ispell/en.dict',0)) || + (! udm_load_ispell_data($udm,UDM_ISPELL_TYPE_SPELL,'ru','/opt/ispell/ru.dict',1))) { + exit; + } + </programlisting> + </informalexample> + + <note> + <para> + <parameter>flag</parameter> is equal to <literal>1</literal> only in the last call. + </para> + </note> + </listitem> + <listitem> + <para> + UDM_ISPELL_TYPE_SERVER - enables spell server support. + <parameter>val1</parameter> parameter indicates + address of the host running spell server. <parameter>val2</parameter> ` + is not used yet, but in future releases it is going to indicate number + of port used by spell server. <parameter>flag</parameter> parameter in + this case is not needed since ispell data is stored + on spellserver already sorted. + </para> + <para> + Spelld server reads spell-data from a separate configuration file + (/usr/local/mnogosearch/etc/spelld.conf by default), sorts it and stores in + memory. With clients server communicates in two ways: to indexer all the + data is transferred (so that indexer starts faster), from search.cgi server + receives word to normalize and then passes over to client (search.cgi) list + of normalized word forms. This allows fastest, compared to db and text modes + processing of search queries (by omitting loading and sorting all the spell data). + </para> + <para> + <function>udm_load_ispell_data</function> function in UDM_ISPELL_TYPE_SERVER + mode does not actually load ispell data, but only defines server address. + In fact, server is automatically used by <function>udm_find</function> + function when performing search. In case of errors, e.g. if spellserver + is not running or invalid host indicated, there are no messages returned + and ispell conversion does not work. + </para> + + <note> + <para> + この関数は、mnoGoSearch 3.1.12以降でのみ利用可能です。 + </para> + </note> + <simpara>例:</simpara> + <informalexample> + <programlisting role="php"> +<![CDATA[ +if (!udm_load_ispell_data($udm,UDM_ISPELL_TYPE_SERVER,'','',1)) { + printf("Error loading ispell data from server<br>\n"); + exit; +} +]]> + </programlisting> + </informalexample> + </listitem> + </itemizedlist> + </refsect1> + </refentry> + + <refentry id="function.udm-set-agent-param"> + <refnamediv> + <refname>udm_set_agent_param</refname> + <refpurpose> + mnoGoSearch エージェントのセッションパラメータを設定する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>udm_set_agent_param</function></funcdef> + <paramdef>int <parameter>agent</parameter></paramdef> + <paramdef>int <parameter>var</parameter></paramdef> + <paramdef>string <parameter>val</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + <function>udm_set_agent_param</function> は成功時に + &true;、エラー時に&false;を返し + ます。mnoGoSearch セッションパラメータを定義します。 </para> + <simpara> + 以下のパラメータおよびそれらの値が利用可能です。 + </simpara> <itemizedlist> <listitem> <simpara> - UDM_PARAM_NUM_ROWS - カレントのページで見付かったリンクの数。 - 全ての検索ページでの最後のページでのUDM_PARAM_PAGE_SIZE、残りの - リンクに等しい。 + UDM_PARAM_PAGE_NUM - はページ番号を検索結果とするために使用さ + れます。(結果は、ページ毎にUDM_PARAM_PAGE_SIZE個の結果を有する0 + から始まるページで返されます) </simpara> </listitem> <listitem> <simpara> - UDM_PARAM_FOUND - クエリにマッチする結果の合計の数 + UDM_PARAM_PAGE_SIZE - は一ページに表示される検索結果の数。 </simpara> - </listitem> + </listitem> <listitem> <simpara> - UDM_PARAM_WORDINFO - 見付かった単語に関する情報。例えば、"a - good book" に関するクエリは "a: stopword, good:5637, book: 120" - を返します。 + UDM_PARAM_SEARCH_MODE - 検索モード。次の値が利用可能です。: + UDM_MODE_ALL - 全ての単語を検索します。; + UDM_MODE_ANY - 全ての単語で検索する; + UDM_MODE_PHRASE - 熟語検索; + UDM_MODE_BOOL - 論理値検索。論理値検索に関する詳細については + <function>udm_find</function> を参照下さい。 </simpara> - </listitem> + </listitem> <listitem> <simpara> - UDM_PARAM_SEARCHTIME - 秒単位の検索時間。 + UDM_PARAM_CACHE_MODE - 検索結果のキャッシュモードをオンまたはオ + フにします。有効の場合、検索エンジンは検索結果をディスクに保存 + します。似たような検索が後で実行された場合、エンジンはより高速 + にキャッシュから結果を得ることが可能です。 + 利用可能な値: UDM_CACHE_ENABLED, UDM_CACHE_DISABLED. </simpara> - </listitem> + </listitem> <listitem> <simpara> - UDM_PARAM_FIRST_DOC - カレントのページに表示される最初のドキュ - メントの数。 + UDM_PARAM_TRACK_MODE - クエリ追跡モードをオンまたはオフにします。 + バージョン3.1.2以降、mnoGoSearch はクエリ追跡モードをサポートし + ています。追跡はSQLバージョンにのみ実装されており、組み込みデー + タベースでは利用できません。追跡を使用するには、テーブルを追跡 + サポート用に作成する必要があります。MySQLの場合、 + create/mysql/track.txtを使用して下さい。検索実行時に、フロント + エンドはクエリ単語、見つけたドキュメントの数、カレントの秒単位 + のUNIXタイムスタンプを保存するためにこれらのテーブルを使用しま + す。 + 利用可能な値: UDM_TRACK_ENABLED, UDM_TRACK_DISABLED. </simpara> </listitem> <listitem> <simpara> - UDM_PARAM_LAST_DOC - カレントのページに表示される最後のドキュメ - ントの数。 + UDM_PARAM_PHRASE_MODE - 熟語を用いたインデックスデータベースか + どうかを定義します。(indexer.confにおける"phrase" パラメータ) + 使用可能な値: UDM_PHRASE_ENABLED および UDM_PHRASE_DISABLED。 + 熟語検索が有効な場合(UDM_PHRASE_ENABLED)でも、全てのモード + (ANY、ALL、BOOL、PHRASE)で検索が可能であることに注意して下さい。 + mnoGoSearchのバージョン3.1.10で熟語検索がSQLと組み込みデータベー + スモードでのみサポートされました。一方、3.1.11で熟語がcachemode + でもサポートされ始めました。 </simpara> - </listitem> - </itemizedlist> - </refsect1> - </refentry> - - <refentry id="function.udm-get-res-field"> - <refnamediv> - <refname>udm_get_res_field</refname> - <refpurpose>mnoGoSearch 結果フィールドを取得する</refpurpose> - </refnamediv> - <refsect1> - <title>説明</title> - <funcsynopsis> - <funcprototype> - <funcdef>string <function>udm_get_res_field</function></funcdef> - <paramdef>int <parameter>res</parameter></paramdef> - <paramdef>int <parameter>row</parameter></paramdef> - <paramdef>int <parameter>field</parameter></paramdef> - </funcprototype> - </funcsynopsis> - <para> - <function>udm_get_res_field</function> は、成功時に結果フィールド、 - エラー時に&false;を返します。 - </para> - <para> - <parameter>res</parameter> - <function>udm_find</function>から返 - された結果IDへのリンク。 - </para> - <para> - <parameter>row</parameter> - カレントページのリンク番号。0から - <parameter>UDM_PARAM_NUM_ROWS</parameter>までの番号。 - </para> - <para> - <parameter>field</parameter> - フィールドID。次の値のどれか。 - </para> - <itemizedlist> + <simpara> + 熟語検索の例: + </simpara> + <simpara> + "Arizona desert" - このクエリは、"Arizona desert"を熟語として含 + む全てのドキュメントを返します。熟語の前後に二重引用符が必要で + あることに注意して下さい。 + </simpara> + </listitem> <listitem> <simpara> - UDM_FIELD_URL - ドキュメントURLフィールド + UDM_PARAM_CHARSET - ローカルなcharsetを定義します。利用可能な値: + mnoGoSearchによりサポートされるcharsetの組, + 例えば、koi8-r, cp1251, ... </simpara> </listitem> <listitem> <simpara> - UDM_FIELD_CONTENT - ドキュメントContent-typeフィールド (例えば、 - text/html) + UDM_PARAM_STOPFILE - stopfileの名前とパスを定義します。 + (mnoGoSearchと若干違いがあります。つまり、mnoGoSearchにおいては、 + 相対パスまたはパスが入力されなかった場合、UDM_CONF_DIRに関して + このファイルが探されます。モジュールは、このファイルをカレント + のパス(すなわち、PHPスクリプトが実行されるパス)で探します。 </simpara> </listitem> <listitem> - <simpara> - UDM_FIELD_TITLE - ドキュメントのtitleフィールド。 + <simpara> + UDM_PARAM_STOPTABLE - 指定したSQLテーブルから停止単語をロードし + ます。複数のStopwordTableコマンドを使用可能です。このコマンドは、 + SQLデータベースサポートを有効にせずにコンパイルした場合は使用で + きません。 </simpara> </listitem> <listitem> <simpara> - UDM_FIELD_KEYWORDS - ドキュメントkeywordsフィールド(META - KEYWORDSタグから) + UDM_PARAM_WEIGHT_FACTOR - 指定したドキュメント部分の重み係数を + 表します。現在、body, title, keywords, description, urlがサポー + トされています。この機能を有効にするには、indexer.confの*Weight + コマンドに2の累乗を指定して下さい。ここで次のような重みを指定し + た場合を考えてみましょう。 + </simpara> + <literallayout> + URLWeight 1 + BodyWeight 2 + TitleWeight 4 + KeywordWeight 8 + DescWeight 16 + </literallayout> + <simpara> + 同じドキュメントにいくつかの単語が複数回現れる場合、 + indexerが単語の重みにOR演算子を使用するので、異なったドキュメン + トの部分に単語が現れる回数を検出可能です。ボディーにのみ現れる + 単語は、(2進標記で)重み集合00000010を有します。全てのドキュメン + ト部分で使用される単語は、重み集合 00011111 を有します。 </simpara> - </listitem> - <listitem> <simpara> - UDM_FIELD_DESC - ドキュメントdescriptionフィールド (META - DESCRIPTIONタグから) + このパラメータの値は、16進数文字列 ABCDE です。各桁は、単語重み + の対応するビットの因子です。上で指定した重み設定は次のようにな + ります。 </simpara> - </listitem> - <listitem> + <literallayout> + E is a factor for weight 1 (URL Weight bit) + D is a factor for weight 2 (BodyWeight bit) + C is a factor for weight 4 (TitleWeight bit) + B is a factor for weight 8 (KeywordWeight bit) + A is a factor for weight 16 (DescWeight bit) + </literallayout> + <simpara> + 例: + </simpara> + <simpara> + UDM_PARAM_WEIGHT_FACTOR=00001 は、URLのみを検索します。 + </simpara> + <simpara> + UDM_PARAM_WEIGHT_FACTOR=00100 は、Titleのみを検索します。 + </simpara> <simpara> - UDM_FIELD_TEXT - ドキュメント body テキスト (最初の数行でドキュ - メントの内容に関するアイデアを示す)。 + UDM_PARAM_WEIGHT_FACTOR=11100 は、Title,Keywords,Desctriptionを + 検索しますが、URL と Bodyは検索しません。 + </simpara> + <simpara> + UDM_PARAM_WEIGHT_FACTOR=F9421 は、次の検索を行います。 + </simpara> + <literallayout> + Description with factor 15 (F hex) + Keywords with factor 9 + Title with factor 4 + Body with factor 2 + URL with factor 1 + </literallayout> + <simpara> + UDM_PARAM_WEIGHT_FACTOR 変数が省略された場合、元の重みの値はソー + ト結果から引き出されます。上記で指定した重み設定の場合、ドキュ + メントのDescriptionは、最大重み16を有するドキュメントの + descriptionを意味します。 </simpara> </listitem> <listitem> <simpara> - UDM_FIELD_SIZE - ドキュメントのサイズ。 + UDM_PARAM_WORD_MATCH - 単語にマッチ。このパラメータを単語検索型 + を選択する際に使用可能です。この機能は、"single"および"multi"モー + ドでSQLデータベースおよび組み込みのデータベースを使用する場合に + のみ動作します。この機能は、cachemodeおよび他のモードでは動作し + ません。これは、これらのモードが、単語CRCを使用しており、部分文 + 字列検索をサポートしていないからです。 + 利用可能な値は次のようになります。 </simpara> + <simpara>UDM_MATCH_BEGIN - 単語の始めにマッチ</simpara> + <simpara>UDM_MATCH_END - 単語の終りにマッチ</simpara> + <simpara>UDM_MATCH_WORD - 単語全体にマッチ</simpara> + <simpara>UDM_MATCH_SUBSTR - 単語の部分文字列にマッチ</simpara> </listitem> <listitem> <simpara> - UDM_FIELD_URLID - リンクへのユニークなURL ID。 + UDM_PARAM_MIN_WORD_LEN - 単語の最短長を定義します。 + この制限より短い単語は、stopwordとみなされます。このパラメータ + はその値自身も範囲に含むことに注意して下さい。つまり、 + UDM_PARAM_MIN_WORD_LEN=3 の場合、3文字の長さの単語はstopwordと + 見なされませんが、2文字の単語はstopwordとみなされます。デフォル + トは1です。 </simpara> - </listitem> + </listitem> <listitem> <simpara> - UDM_FIELD_RATING - (mnoGoSearchで計算された)ページのレーティン - グ。 + UDM_PARAM_ISPELL_PREFIXES - Possible values: UDM_PREFIXES_ENABLED and + UDM_PREFIXES_DISABLED, that respectively enable or disable using prefixes. + E.g. if a word "tested" is in search query, also words like "test", + "testing", etc. Only suffixes are supported by default. Prefixes usually + change word meanings, for example if somebody is searching for the word "tested" + one hardly wants "untested" to be found. Prefixes support may also be + found useful for site's spelling checking purposes. In order to enable + ispell, you have to load ispell data with + <function>udm_load_ispell_data</function>. </simpara> </listitem> <listitem> <simpara> - UDM_FIELD_MODIFIED - unixtime形式のlast-modifiedフィールド。 + UDM_PARAM_CROSS_WORDS - enables or disables crosswords support. + Possible values: UDM_CROSS_WORDS_ENABLED and UDM_CROSS_WORDS_DISABLED. + </simpara> + <simpara> + The corsswords feature allows to assign words between &lt;a + href="xxx"&gt; and &lt;/a&gt; also to a document this link + leads to. It works in SQL database mode and is not supported in + built-in database and Cachemode. </simpara> + <note> + <simpara> + Crosswords are supported only in mnoGoSearch 3.1.11 or later. + </simpara> + </note> </listitem> <listitem> <simpara> - UDM_FIELD_ORDER - 見つかったドキュメントの中のカレントのドキュ - メントの数 + UDM_PARAM_VARDIR - specifies a custom path to directory where indexer + stores data when using built-in database and in cache mode. + By default <literal>/var</literal> directory of + <application>mnoGoSearch</application> installation is used. Can have + only string values. The parameter is available in PHP 4.1.0 or later. </simpara> </listitem> <listitem> <simpara> - UDM_FIELD_CRC - ドキュメントCRC。 + UDM_PARAM_VARDIR - specifies a custom path to directory where indexer + stores data when using built-in database and in cache mode. + By default <literal>/var</literal> directory of + <application>mnoGoSearch</application> installation is used. Can have + only string values. The parameter is available in PHP 4.1.0 or later. </simpara> </listitem> </itemizedlist> - </refsect1> + </refsect1> </refentry> - - <refentry id="function.udm-free-res"> + + <refentry id='function.udm-check-charset'> <refnamediv> - <refname>udm_free_res</refname> - <refpurpose>mnoGoSearch 結果を開放する</refpurpose> + <refname>udm_check_charset</refname> + <refpurpose> + 指定したcharsetをmnogosearchで認識されるかどうか調べる + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>udm_free_res</function></funcdef> - <paramdef>int <parameter>res</parameter></paramdef> + <funcdef>int <function>udm_check_charset</function></funcdef> + <paramdef>int <parameter>agent</parameter></paramdef> + <paramdef>string <parameter>charset</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <function>udm_free_res</function> は成功時に - &true;、エラー時に&false;を返し - ます。 - </para> - <para> - <parameter>res</parameter> - <function>udm_find</function>から返 - された結果IDへのリンク。 + &warn.undocumented.func; </para> + </refsect1> + </refentry> + + <refentry id='function.udm-check-stored'> + <refnamediv> + <refname>udm_check_stored</refname> + <refpurpose> + 保存された接続を調べる + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>udm_check_stored</function></funcdef> + <paramdef>int <parameter>agent</parameter></paramdef> + <paramdef>int <parameter>link</parameter></paramdef> + <paramdef>string <parameter>doc_id</parameter></paramdef> + </funcprototype> + </funcsynopsis> <para> - 結果用に確保されたメモリを開放します。 + &warn.undocumented.func; </para> </refsect1> </refentry> - <refentry id="function.udm-free-agent"> + <refentry id='function.udm-close-stored'> <refnamediv> - <refname>udm_free_agent</refname> - <refpurpose>mnoGoSearch セッションを開放する</refpurpose> + <refname>udm_close_stored</refname> + <refpurpose> + 保存した接続を閉じる + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>udm_free_agent</function></funcdef> + <funcdef>int <function>udm_close_stored</function></funcdef> <paramdef>int <parameter>agent</parameter></paramdef> + <paramdef>int <parameter>link</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <function>udm_free_agent</function> は成功時に - &true;、エラー時に&false;を返し - ます。 - </para> - <para> - <parameter>agent</parameter> - - <function>udm_alloc_agent</function>から返されたエージェントIDへ - のリンク。 - </para> - <para> - エージェントセッション用に確保されたメモリを開放します。 + &warn.undocumented.func; </para> </refsect1> </refentry> - <refentry id="function.udm-errno"> + <refentry id='function.udm-crc32'> <refnamediv> - <refname>udm_errno</refname> - <refpurpose>mnoGoSearch エラー番号を取得する</refpurpose> + <refname>udm_crc32</refname> + <refpurpose> + 指定した文字列のCRC32チェックサムを計算する + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>udm_errno</function></funcdef> + <funcdef>int <function>udm_crc32</function></funcdef> <paramdef>int <parameter>agent</parameter></paramdef> + <paramdef>string <parameter>str</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <function>udm_errno</function> は、mnoGoSearch エラー番号を返しま - す。エラーがない場合にゼロを返します。 - </para> - <para> - <parameter>agent</parameter> - - <function>udm_alloc_agent</function>へのコールから返されるエージェ - ントIDへのリンク - </para> - <para> - 数字でエージェントエラーコードを返します。 + &warn.undocumented.func; </para> </refsect1> </refentry> - <refentry id="function.udm-error"> + <refentry id='function.udm-open-stored'> <refnamediv> - <refname>udm_error</refname> - <refpurpose>mnoGoSearch エラーメッセージを得る</refpurpose> + <refname>udm_open_stored</refname> + <refpurpose> + 保存した接続をオープンする + </refpurpose> </refnamediv> <refsect1> <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>string <function>udm_error</function></funcdef> + <funcdef>int <function>udm_open_stored</function></funcdef> <paramdef>int <parameter>agent</parameter></paramdef> + <paramdef>string <parameter>storedaddr</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - <function>udm_error</function> は、mnoGoSearch エラーメッセージを - 返します。エラーがない場合には、空の文字列を返します。 - </para> - <para> - <parameter>agent</parameter> は、エージェントIDへのリンクであり、 - <function>udm_alloc_agent</function>をコールした際に得られたもの - です。 - </para> - <para> - エージェントエラーメッセージを得ます。 + &warn.undocumented.func; </para> </refsect1> </refentry> + </reference> + <!-- Keep this comment at the end of the file Local variables: Index: phpdoc/ja/functions/msql.xml diff -u phpdoc/ja/functions/msql.xml:1.11 phpdoc/ja/functions/msql.xml:1.12 --- phpdoc/ja/functions/msql.xml:1.11 Wed Dec 12 15:53:22 2001 +++ phpdoc/ja/functions/msql.xml Sat Jan 26 03:55:51 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> - +<!-- $Revision: 1.12 $ --> <reference id="ref.msql"> <title>mSQL 関数</title> <titleabbrev>mSQL</titleabbrev> @@ -119,7 +119,18 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>msql_connect</function></funcdef> - <paramdef>string <parameter>host_name</parameter></paramdef> + <paramdef>string + <parameter><optional>hostname</optional></parameter> + </paramdef> + <paramdef>string + <parameter><optional>server</optional></parameter> + </paramdef> + <paramdef>string + <parameter><optional>username</optional></parameter> + </paramdef> + <paramdef>string + <parameter><optional>password</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -127,9 +138,10 @@ &false;を返します。 </para> <para> - <function>msql_connect</function>は mSQL サーバーへの接続を確立します。 - 引数host_name はオプションで、これが指定されない場合、 - localhostが指定されたと仮定します。 + <function>msql_connect</function>は mSQL サーバーへの接続を確立し + ます。パラメータ<parameter>server</parameter>には、 + &quot;hostname:port&quot;のようにポート番号を含めることも可能です。 + デフォルトは、'localhost'です。 </para> <para> 同じ引数で<function>msql_connect</function>が再度コールされた場合、 @@ -215,7 +227,7 @@ </funcprototype> </funcsynopsis> <para> - 成功の場合に&true;、失敗の場合に&false;を返します。 + &return.success; </para> <para> <function>msql_data_seek</function> は、指定したクエリーID @@ -240,7 +252,7 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>msql_dbname</function></funcdef> - <paramdef>string <parameter>query_identifier</parameter></paramdef> + <paramdef>int <parameter>query_identifier</parameter></paramdef> <paramdef>int <parameter>i</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -264,12 +276,12 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>msql_drop_db</function></funcdef> - <paramdef>string <parameter>データベース名</parameter></paramdef> + <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>int <parameter>link_identifier</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功時に&true;、失敗した場合に&false;を返します。 + &return.success; </para> <para> <function>msql_drop_db</function>は、指定したリンクIDが指す @@ -306,13 +318,17 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>msql_error</function></funcdef> - <paramdef> <parameter></parameter></paramdef> + <paramdef>int + <parameter> + <replaceable><optional>link_identifier</optional></replaceable> + </parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> - mSQL データベースのバックエンドからエラーが返されても、 - もはや警告を発しません。 - エラー文字列を取り出すためには、替わりにこれらの関数を使用してください。 + mSQL データベースのバックエンドから返されたエラーは、現在ではもは + や警告として出力されません。エラー文字列を取り出すためには、替わ + りにこれらの関数を使用してください。 </para> </refsect1> </refentry> @@ -395,26 +411,44 @@ <para> オブジェクトのプロパティは、次のようになります。 <itemizedlist> - <listitem><simpara>name - カラム名</simpara></listitem> - <listitem><simpara>table - カラムが属するテーブルの名前 - </simpara></listitem> - <listitem><simpara>not_null - そのカラムがヌルになることができない場合に - 1 とする。 - </simpara></listitem> - <listitem><simpara>primary_key - そのカラムがプライマリキー - である場合に 1 - </simpara></listitem> - <listitem><simpara>unique - そのカラムがユニークキーである - 場合に 1</simpara></listitem> - <listitem><simpara>type - カラムの型</simpara></listitem> - </itemizedlist></para> + <listitem> + <simpara> + name - カラム名 + </simpara> + </listitem> + <listitem> + <simpara> + table - カラムが属するテーブルの名前 + </simpara> + </listitem> + <listitem> + <simpara> + not_null - そのカラムがヌルになることができない場合に1とする。 + </simpara> + </listitem> + <listitem> + <simpara> + primary_key - そのカラムがプライマリキーである場合に1 + </simpara> + </listitem> + <listitem> + <simpara> + unique - そのカラムがユニークキーである場合に1 + </simpara> + </listitem> + <listitem> + <simpara> + type - カラムの型 + </simpara> + </listitem> + </itemizedlist> + </para> <para> <function>msql_field_seek</function> も参照下さい。 </para> </refsect1> </refentry> - <refentry id="function.msql-fetch-object"> <refnamediv> <refname>msql_fetch_object</refname> @@ -434,16 +468,15 @@ </funcprototype> </funcsynopsis> <para> - 得た行に対応するプロパティを有するオブジェクトを返します。 - もう行がない場合には、&false;を返します。 + 得た行に対応するプロパティを有するオブジェクトを返します。もう行 + がない場合には、&false;を返します。 </para> <para> - <function>msql_fetch_object</function> は、<function>msql_fetch_array - </function> - に似ていますが、配列の代わりにオブジェクトを返すところだけが - 異なっています。 - 間接的にというのは、オフセット値によってではなくフィールド名によってのみ - データをアクセスすることができることを意味しています。 + <function>msql_fetch_object</function> は、 + <function>msql_fetch_array</function>に似ていますが、配列の代わり + にオブジェクトを返すところだけが異なっています。間接的にというの + は、オフセット値によってではなくフィールド名によってのみデータを + アクセスすることができることを意味しています。 (数字は、プロパティ名として使用できません。) </para> <para> @@ -577,7 +610,7 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>msql_fieldtype</function></funcdef> - <paramdef>string <parameter>query_identifier</parameter></paramdef> + <paramdef>int <parameter>query_identifier</parameter></paramdef> <paramdef>int <parameter>i</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -600,7 +633,7 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>msql_fieldflags</function></funcdef> - <paramdef>string <parameter>query_identifier</parameter></paramdef> + <paramdef>int <parameter>query_identifier</parameter></paramdef> <paramdef>int <parameter>i</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -623,7 +656,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>msql_fieldlen</function></funcdef> - <paramdef>string <parameter>query_identifier</parameter></paramdef> + <paramdef>int <parameter>query_identifier</parameter></paramdef> <paramdef>int <parameter>i</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -681,8 +714,8 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>msql_list_fields</function></funcdef> - <paramdef>string <parameter>dデータベース</parameter></paramdef> - <paramdef>string <parameter>テーブル名</parameter></paramdef> + <paramdef>string <parameter>database</parameter></paramdef> + <paramdef>string <parameter>tablename</parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -832,7 +865,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>msql_num_rows</function></funcdef> - <paramdef>string <parameter>query_identifier</parameter></paramdef> + <paramdef>int <parameter>query_identifier</parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -865,7 +898,6 @@ </refsect1> </refentry> - <refentry id="function.msql-numrows"> <refnamediv> <refname>msql_numrows</refname> @@ -896,7 +928,15 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>msql_pconnect</function></funcdef> - <paramdef>string <parameter>ホスト名</parameter></paramdef> + <paramdef>string + <parameter><optional>server</optional></parameter> + </paramdef> + <paramdef>string + <parameter><optional>username</optional></parameter> + </paramdef> + <paramdef>string + <parameter><optional>password</optional></parameter> + </paramdef> </funcprototype> </funcsynopsis> <para> @@ -908,20 +948,20 @@ <function>msql_connect</function> と全く同様に動作します。 </para> <para> - 1番目の差異は、この関数は接続した際に同じホストにおいて - すでに確立された(持続的な)リンクを見つけようとすることです。 - そうしたリンクが見つかった場合、新たな接続を開く代わりに - そのリンクへのIDが返されます。 + 1番目の差異は、この関数は接続した際に同じホストにおいてすでに確立 + された(持続的な)リンクを見つけようとすることです。そうしたリンク + が見つかった場合、新たな接続を開く代わりにそのリンクへのIDが返さ + れます。 </para> <para> - 2 番目は、スクリプトの実行終了時に SQL サーバーへの接続が - 閉じられないということです。 - 代わりに、リンクは、次に使用するために開かれたままにされます。 - (<function>msql_close</function> は、<function>msql_pconnect</function> - により確立されたリンクを閉じません) + 2番目は、スクリプトの実行終了時にSQLサーバーへの接続が閉じられな + いということです。代わりに、リンクは、次に使用するために開かれた + ままにされます。(<function>msql_close</function> は、 + <function>msql_pconnect</function>により確立されたリンクを閉じま + せん) </para> <para> - このため、この型のリンクは、'持続的' であると呼ばれます。 + このため、この型のリンクは、'持続的' であると呼ばれます。 </para> </refsect1> </refentry> @@ -936,7 +976,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>msql_query</function></funcdef> - <paramdef>string <parameter>クエリー</parameter></paramdef> + <paramdef>string <parameter>query</parameter></paramdef> <paramdef>int <parameter>link_identifier</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -953,6 +993,28 @@ 成功した場合に正のmSQL クエリーIDを返します。エラーの場合に&false; を返します。 </para> + <example> + <title><function>msql_query</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$link = msql_connect("dbserver") + or die("unable to connect to msql server: ".msql_error()); +msql_select_db("db", $link) + or die("unable to select database 'db': ".msql_error()); + +$result = msql_query("SELECT * FROM table WHERE id=1", $link); +if (!$result) { + die("query failed: ".msql_error()); +} + +while ($row = msql_fetch_array($result)) { + echo $row["id"]; +} +?> +]]> + </programlisting> + </example> <para> <function>msql</function>、 <function>msql_select_db</function>、 @@ -961,12 +1023,12 @@ </refsect1> </refentry> - <refentry id="function.msql-regcase"> <refnamediv> <refname>msql_regcase</refname> - <refpurpose>大文字小文字を区別しないマッチング用に正規表現 - を作成します</refpurpose> + <refpurpose> + 大文字小文字を区別しないマッチング用に正規表現を作成します + </refpurpose> </refnamediv> <refsect1> <title>説明</title> @@ -1032,7 +1094,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>msql_select_db</function></funcdef> - <paramdef>string <parameter>データベース名</parameter></paramdef> + <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>int <parameter>link_identifier</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -1073,7 +1135,6 @@ </refsect1> </refentry> - <refentry id="function.msql-tablename"> <refnamediv> <refname>msql_tablename</refname> @@ -1085,7 +1146,7 @@ <funcprototype> <funcdef>string <function>msql_tablename</function></funcdef> <paramdef>int <parameter>query_identifier</parameter></paramdef> - <paramdef>int <parameter>フィールド</parameter></paramdef> + <paramdef>int <parameter>field</parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -1097,22 +1158,23 @@ <example> <title><function>msql_tablename</function>の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php msql_connect ("localhost"); -$result = msql_list_tables("wisconsin"); +$result = msql_list_tables ("wisconsin"); $i = 0; -while ($i &lt; msql_numrows($result)) { - $tb_names[$i] = msql_tablename($result, $i); - echo $tb_names[$i] . "&lt;BR>"; +while ($i < msql_numrows ($result)) { + $tb_names[$i] = msql_tablename ($result, $i); + echo $tb_names[$i] . "<BR>"; $i++; } ?> -</programlisting> +]]> + </programlisting> </example> </para> </refsect1> </refentry> - </reference> Index: phpdoc/ja/functions/mssql.xml diff -u phpdoc/ja/functions/mssql.xml:1.9 phpdoc/ja/functions/mssql.xml:1.10 --- phpdoc/ja/functions/mssql.xml:1.9 Wed Dec 12 15:53:23 2001 +++ phpdoc/ja/functions/mssql.xml Sat Jan 26 03:55:51 2002 @@ -1,7 +1,28 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.10 $ --> <reference id="ref.mssql"> <title>MS SQL サーバー関数</title> <titleabbrev>MS SQL サーバー</titleabbrev> + <partintro> + <simpara> + MSSQL拡張モジュールは、Win32システムでのみ利用可能です。他のプラッ + トフォームからMSSQLデータベースに接続するには、Sybase拡張モジュー + ルを使用することが可能です。 + </simpara> + <simpara> + これらの関数では、MS SQLサーバデータベースを使用可能です。この拡張 + モジュールは、PHPがインストールされているシステムにMS SQLクライア + ントツールのインストールを要します。クライアントツールは、 + MS SQL Server CDまたは\winnt\system32からntwdblib.dllをPHPシステム + の\winnt\system32にコピーすることによりインストール可能です。 + ntwdblib.dllのコピーではアクセスのみが可能です。クライアントの設定 + は、全てのツールのインストールが必要です。 + </simpara> + <simpara> + MSSQL拡張モジュールは、extension=php_mssql.dllをphp.iniに追加する + ことにより、利用可能となります。 + </simpara> + </partintro> <refentry id="function.mssql-close"> <refnamediv> @@ -30,9 +51,8 @@ 仮定します。 </para> <para> - - 持続的でないリンクはスクリプト実行終了時に自動的に閉じられるので - この関数は通常は必要ではありません。 + 持続的でないリンクはスクリプト実行終了時に自動的に閉じられるので + この関数は通常は必要ではありません。 </para> <para> <function>mssql_close</function>は<function>mssql_pconnect</function> @@ -151,8 +171,8 @@ 強調しておきます。 </para> <para> - 更に詳細な情報に関しては、 - <function>mssql_fetch_row</function> も参照下さい。 + 更に詳細な情報に関しては、<function>mssql_fetch_row</function> も + 参照下さい。 </para> </refsect1> </refentry> @@ -186,33 +206,31 @@ フィールドが取得されます。 </para> <para> - オブジェクトのプロパティは、次のようになります。 + オブジェクトのプロパティは、次のようになります。 </para> - - <itemizedlist> - <listitem> - <simpara> - name - カラム名。カラムが関数の結果である場合、このプロパティは - computed#N に設定されます。ただし、#N はシリアル番号です。 - </simpara> - </listitem> - <listitem> - <simpara> - column_source - そのカラムが取得されたテーブル - </simpara> - </listitem> - <listitem> - <simpara> - max_length - カラムの最大長 - </simpara> - </listitem> - <listitem> - <simpara> - numeric - そのカラムが数字である場合に 1 - </simpara> - </listitem> - </itemizedlist> - + <itemizedlist> + <listitem> + <simpara> + name - カラム名。カラムが関数の結果である場合、このプロパティは + computed#N に設定されます。ただし、#N はシリアル番号です。 + </simpara> + </listitem> + <listitem> + <simpara> + column_source - そのカラムが取得されたテーブル + </simpara> + </listitem> + <listitem> + <simpara> + max_length - カラムの最大長 + </simpara> + </listitem> + <listitem> + <simpara> + numeric - そのカラムが数字である場合に 1 + </simpara> + </listitem> + </itemizedlist> <para> <function>mssql_field_seek</function> も参照下さい。 </para> @@ -278,15 +296,15 @@ 配列オフセットに保存された各結果カラムは、オブセット 0 から始まります。 </para> <para> - <function>mssql_fetch_rows</function>を続けてコールした場合、 - 結果セットの次の行が返され、行がもうない場合は &false; が返されます。 + <function>mssql_fetch_rows</function>を続けてコールした場合、 + 結果セットの次の行が返され、行がもうない場合は &false; が返されます。 </para> <para> <function>mssql_fetch_array</function>, - <function>mssql_fetch_object</function>, - <function>mssql_data_seek</function>, - <function>mssql_fetch_lengths</function>, - <function>mssql_result</function> も参照下さい。 + <function>mssql_fetch_object</function>, + <function>mssql_data_seek</function>, + <function>mssql_fetch_lengths</function>, + <function>mssql_result</function> も参照下さい。 </para> </refsect1> </refentry> @@ -309,6 +327,9 @@ </paramdef> </funcprototype> </funcsynopsis> + <para> + &warn.undocumented.func; + </para> </refsect1> </refentry> @@ -417,7 +438,7 @@ <funcdef>string <function>mssql_get_last_message</function> </funcdef> - <paramdef>void <parameter></parameter></paramdef> + <void/> </funcprototype> </funcsynopsis> </refsect1> @@ -459,6 +480,52 @@ </refsect1> </refentry> + <refentry id="function.mssql-next-result"> + <refnamediv> + <refname>mssql_next_result</refname> + <refpurpose>次の結果に内部結果ポインタを移動する</refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>bool + <function>mssql_next_result</function> + </funcdef> + <paramdef>int <parameter>result_id</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + サーバへ複数のSQL命令を送信するか複数の結果を有するストアドプロシー + ジャを実行する場合、この関数はサーバが複数の結果集合を返すように + します。この関数は、サーバから追加の結果が存在するかどうかを調べ + ます。追加の結果集合が存在する場合、既存の結果集合を解放し、新し + い結果集合から行を取得するための準備を行います。この関数は、追加 + の結果集合が取得可能な場合に&true;、その他の場合に&false;を返しま + す。 + </para> + <example> + <title><function>mssql_next_result</function>の例</title> + <programlisting role="php"> +<![CDATA[ +<?php + $link = mssql_connect ("localhost", "userid", "secret"); + mssql_select_db("MyDB", $link); + $SQL = "Select * from table1 select * from table2"; + $rs = mssql_query($SQL, $link); + do { + while ($row = mssql_fetch_row($rs)) { + } + } while (mssql_next_result($rs)); + mssql_free_result($rs); + mssql_close ($link); +?> +]]> + </programlisting> + </example> + </refsect1> + </refentry> + <refentry id="function.mssql-num-fields"> <refnamediv> <refname>mssql_num_fields</refname> @@ -473,7 +540,7 @@ </funcprototype> </funcsynopsis> <para> - <function>mssql_num_fields</function>は結果のフィールド数を返します。 + <function>mssql_num_fields</function>は結果のフィールド数を返します。 </para> <para> <function>mssql_db_query</function>, @@ -624,13 +691,12 @@ が使用されます。 </para> <para> - 大量の結果を処理する場合、(以下に示す)行全体を取得する関数のどれかを - 使用することを考える必要があります。 - これらの関数は一回の関数コールで複数のセルの内容を返すので、 - <function>mssql_result</function>よりもかなり高速です。 - また、field 引数でオフセット番号を指定する方が、 - フィールド名またはテーブル名.フィールド名で引数で指定するよりも - かなり高速です。 + 大量の結果を処理する場合、(以下に示す)行全体を取得する関数のどれ + かを使用することを考える必要があります。これらの関数は一回の関数 + コールで複数のセルの内容を返すので、 + <function>mssql_result</function>よりもかなり高速です。また、 + field 引数でオフセット番号を指定する方が、フィールド名またはテー + ブル名.フィールド名で引数で指定するよりもかなり高速です。 </para> <para> 推奨される高性能な代替関数: @@ -678,6 +744,176 @@ <function>mssql_connect</function>, <function>mssql_pconnect</function>, <function>mssql_query</function> も参照下さい。 + </para> + </refsect1> + </refentry> + + <refentry id='function.mssql-bind'> + <refnamediv> + <refname>mssql_bind</refname> + <refpurpose> + ストアドプロシージャまたはリモートストアドプロシージャへパラメー + タを追加する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>mssql_bind</function></funcdef> + <paramdef>int <parameter>stmt</parameter></paramdef> + <paramdef>string <parameter>param_name</parameter></paramdef> + <paramdef>mixed <parameter>var</parameter></paramdef> + <paramdef>int <parameter>type</parameter></paramdef> + <paramdef>int + <parameter><optional>is_output</optional></parameter> + </paramdef> + <paramdef>int + <parameter><optional>is_null</optional></parameter> + </paramdef> + <paramdef>int + <parameter><optional>maxlen</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.mssql-execute'> + <refnamediv> + <refname>mssql_execute</refname> + <refpurpose> + MS SQLサーバデータベースでストアドプロシージャを実行する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>mssql_execute</function></funcdef> + <paramdef>int <parameter>stmt</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.mssql-fetch-assoc'> + <refnamediv> + <refname>mssql_fetch_assoc</refname> + <refpurpose> + result_idで指定した結果集合でカレントの行を連想配列として返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>array <function>mssql_fetch_assoc</function></funcdef> + <paramdef>int <parameter>result_id</parameter></paramdef> + <paramdef>int + <parameter><optional>result_type</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.mssql-fetch-batch'> + <refnamediv> + <refname>mssql_fetch_batch</refname> + <refpurpose> + レコードの次のバッチを返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>mssql_fetch_batch</function></funcdef> + <paramdef>string <parameter>result_index</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.mssql-guid-string'> + <refnamediv> + <refname>mssql_guid_string</refname> + <refpurpose> + 16バイトバイナリGUIDを文字列に変換する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>string <function>mssql_guid_string</function></funcdef> + <paramdef>string <parameter>binary</parameter></paramdef> + <paramdef>int + <parameter><optional>short_format</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.mssql-init'> + <refnamediv> + <refname>mssql_init</refname> + <refpurpose> + ストアドプロシージャまたはリモートのストアドプロシージャを初期化 + する + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>mssql_init</function></funcdef> + <paramdef>string <parameter>sp_name</parameter></paramdef> + <paramdef>int + <parameter><optional>conn_id</optional></parameter> + </paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; + </para> + </refsect1> + </refentry> + + <refentry id='function.mssql-rows-affected'> + <refnamediv> + <refname>mssql_rows_affected</refname> + <refpurpose> + クエリにより取得したレコード数を返す + </refpurpose> + </refnamediv> + <refsect1> + <title>説明</title> + <funcsynopsis> + <funcprototype> + <funcdef>int <function>mssql_rows_affected</function></funcdef> + <paramdef>int <parameter>conn_id</parameter></paramdef> + </funcprototype> + </funcsynopsis> + <para> + &warn.undocumented.func; </para> </refsect1> </refentry> Index: phpdoc/ja/functions/mysql.xml diff -u phpdoc/ja/functions/mysql.xml:1.22 phpdoc/ja/functions/mysql.xml:1.23 --- phpdoc/ja/functions/mysql.xml:1.22 Wed Dec 12 15:53:23 2001 +++ phpdoc/ja/functions/mysql.xml Sat Jan 26 03:55:51 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.23 $ --> <reference id="ref.mysql"> <title>MySQL関数</title> <titleabbrev>MySQL</titleabbrev> @@ -25,6 +26,99 @@ MySQL のドキュメントは、<ulink url="&url.mysql.docs;">&url.mysql.docs;</ulink>にあります。 </simpara> + <para> + MySQL関数の動作は、グローバルな<link linkend="configuration">設定 + </link>ファイルの設定の影響を受けます。 + <table> + <title><link linkend="ini.sect.mysql">MySQL設定</link>オプション</title> + <tgroup cols="3"> + <thead> + <row> + <entry>名前</entry> + <entry>デフォルト</entry> + <entry>変更の可否</entry> + </row> + </thead> + <tbody> + <row> + <entry>mysql.allow_persistent</entry> + <entry>"On"</entry> + <entry>PHP_INI_SYSTEM</entry> + </row> + <row> + <entry>mysql.max_persistent</entry> + <entry>"-1"</entry> + <entry>PHP_INI_SYSTEM</entry> + </row> + <row> + <entry>mysql.max_links</entry> + <entry>"-1"</entry> + <entry>PHP_INI_SYSTEM</entry> + </row> + <row> + <entry>mysql.default_port</entry> + <entry>NULL</entry> + <entry>PHP_INI_ALL</entry> + </row> + <row> + <entry>mysql.default_socket</entry> + <entry>NULL</entry> + <entry>PHP_INI_ALL</entry> + </row> + <row> + <entry>mysql.default_host</entry> + <entry>NULL</entry> + <entry>PHP_INI_ALL</entry> + </row> + <row> + <entry>mysql.default_user</entry> + <entry>NULL</entry> + <entry>PHP_INI_ALL</entry> + </row> + </tbody> + </tgroup> + </table> + PHP_INI_*定数に関する詳細と定義については、 + <function>ini_set</function>を参照下さい。 + </para> + <para> + 以下は、MySQLデータベースに接続し、クエリを実行し、結果レコードを + 出力、接続を断する例です。 + <example> + <title>MySQL拡張に関する概要の例</title> + <programlisting role="php"> +<![CDATA[ +<?php +// データベースに接続し、選択する +$link = mysql_connect("mysql_host", "mysql_login", "mysql_password") + or die("Could not connect"); +print "Connected successfully"; +mysql_select_db("my_database") + or die("Could not select database"); + +// SQLクエリを実行する +$query = "SELECT * FROM my_table"; +$result = mysql_query($query) + or die("Query failed"); + +// HTMLに結果を出力する +print "<table>\n"; +while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { + print "\t<tr>\n"; + foreach ($line as $col_value) { + print "\t\t<td>$col_value</td>\n"; + } + print "\t</tr>\n"; +} +print "</table>\n"; + +// 接続を閉じる +mysql_close($link); +?> +]]> + </programlisting> + </example> + </para> </partintro> <refentry id="function.mysql-affected-rows"> @@ -107,7 +201,7 @@ <replaceable><optional>database</optional></replaceable> </parameter> </paramdef> - <paramdef>int + <paramdef>resource <parameter> <replaceable><optional>link_identifier</optional></replaceable> </parameter> @@ -140,8 +234,8 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>mysql_close</function></funcdef> - <paramdef>int + <funcdef>bool <function>mysql_close</function></funcdef> + <paramdef>resource <parameter> <replaceable><optional>link_identifier</optional></replaceable> </parameter> @@ -149,17 +243,19 @@ </funcprototype> </funcsynopsis> <para> - 成功の場合に&true;、エラーの場合に&false;を返します。 + &return.success; </para> <para> <function>mysql_close</function>は、指定したlink_identifierが指す MySQLデータベースへのリンクを閉じます。 - link_identifierが指定されない場合、最後にオープンされたリンクが - 仮定されます。 + <parameter>link_identifier</parameter>が指定されない場合、最後に + オープンされたリンクが使用されます。 </para> <para> - 非持続的リンクはスクリプトの実行終了時に自動的に - 閉じられるので、この関数は通常の場合必要ありません。 + 持続的でないリンクはスクリプトの実行終了時に自動的に閉じられるの + で、この関数は通常の場合必要ありません。<link + linkend="language.types.resource.self-destruct">リソースの解放 + </link>を参照下さい。 </para> <para> <function>mysql_close</function>は、<function>mysql_pconnect</function> @@ -168,12 +264,14 @@ <example> <title>MySQL 接続をクローズする例</title> <programlisting role="php"> -&lt;?php - $link = mysql_connect ("kraemer", "marliesle", "secret") - or die ("接続できません"); - print ("接続に成功しました"); - mysql_close ($link); +<![CDATA[ +<?php + $link = mysql_connect("kraemer", "marliesle", "secret") + or exit("Could not connect"); + print ("Connected successfully"); + mysql_close($link); ?> +]]> </programlisting> </example> <para> @@ -193,24 +291,19 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>mysql_connect</function></funcdef> - <paramdef>string + <paramdef>string <parameter> - <replaceable> - <optional>hostname - <optional>:port</optional> - <optional>:/path/to/socket</optional> - </optional> - </replaceable> + <optional>server</optional> </parameter> </paramdef> - <paramdef>string + <paramdef>string <parameter> - <replaceable><optional>user_name</optional></replaceable> + <optional>username</optional> </parameter> </paramdef> - <paramdef>string + <paramdef>string <parameter> - <replaceable><optional>password</optional></replaceable> + <optional>password</optional> </parameter> </paramdef> </funcprototype> @@ -220,15 +313,18 @@ エラーメッセージを発生します。 </para> <para> - <function>mysql_connect</function>は、MySQL サーバーへの - 接続を確立します。引数は全てオプションで、指定されない場合、 - デフォルト値 ('localhost'、サーバープロセスの所有者のユーザー名、 - 空のパスワード)が適用されます。 + <function>mysql_connect</function>は、MySQL サーバーへの接続を確 + 立します。オプションのパラメータが指定されない場合、以下のデフォ + ルト値が使用されます。: + <parameter>server</parameter> = 'localhost:3306', + <parameter>username</parameter> = サーバプロセスの所有ユーザ名 + <parameter>password</parameter> = 空のパスワード </para> <para> - 文字列hostnameには、ポート番号も指定することが可能です。 - 例えば、&quot;hostname:port&quot;とします。localhostの場合には、 - ソケットへのパス &quot;:/path/to/socket&quot;とします。 + パラメータ<parameter>server</parameter>には、ポート番号も指定する + ことが可能です。例えば、&quot;hostname:port&quot;、または、 + localhostの場合には、ソケットへのパス + &quot;:/path/to/socket&quot;とします。 <note> <para> &quot;:port&quot;のサポートは3.0B4で追加されました。 @@ -254,14 +350,14 @@ <example> <title>MySQL に接続する例</title> <programlisting role="php"> -&lt;?php - - $link = mysql_connect ("localhost", "username", "secret") - or die ("接続できませんでした"); - print ("接続に成功しました"); - mysql_close ($link); - -?&gt; +<![CDATA[ +<?php + $link = mysql_connect("localhost", "username", "secret") + or die("Could not connect"); + print ("Connected successfully"); + mysql_close($link); +?> +]]> </programlisting> </example> <para> @@ -280,9 +376,9 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>mysql_create_db</function></funcdef> + <funcdef>bool <function>mysql_create_db</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> - <paramdef>int + <paramdef>resource <parameter> <replaceable><optional>link_identifier</optional></replaceable> </parameter> @@ -296,15 +392,17 @@ <example> <title>MySQLデータベースを作成する例</title> <programlisting role="php"> -&lt;?php - $link = mysql_pconnect ("kron", "jutta", "geheim") - or die ("Could not connect"); - if (mysql_create_db ("my_db")) { - print ("データベースの作成に成功しました\n"); +<![CDATA[ +<?php + $link = mysql_pconnect("kron", "jutta", "geheim") + or exit("Could not connect"); + if (mysql_create_db("my_db")) { + print ("Database created successfully\n"); } else { - printf ("データベース作成時に次のエラーが発生しました: %s\n", mysql_error ()); + printf ("Error creating database: %s\n", mysql_error ()); } ?> +]]> </programlisting> </example> <para> @@ -326,13 +424,13 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>mysql_data_seek</function></funcdef> - <paramdef>int <parameter>result_identifier</parameter></paramdef> + <funcdef>bool <function>mysql_data_seek</function></funcdef> + <paramdef>resource <parameter>result_identifier</parameter></paramdef> <paramdef>int <parameter>row_number</parameter></paramdef> </funcprototype> </funcsynopsis> <para> - 成功した場合に&true;、失敗した場合に&false;を返します。 + &return.success; </para> <para> <function>mysql_data_seek</function>は、指定した結果ID @@ -344,37 +442,38 @@ <para> <parameter>row_number</parameter> は、0から始まります。 </para> - <example> <title>MySQLデータをシークする例</title> <programlisting role="php"> -&lt;?php - $link = mysql_pconnect ("kron", "jutta", "geheim") - or die ("接続できません"); +<![CDATA[ +<?php + $link = mysql_pconnect("kron", "jutta", "geheim") + or die("Could not connect"); - mysql_select_db ("samp_db") - or die ("データベースを select できません"); + mysql_select_db("samp_db") + or exit("Could not select database"); $query = "SELECT last_name, first_name FROM friends"; - $result = mysql_query ($query) - or die ("クエリが失敗しました"); + $result = mysql_query($query) + or die("Query failed"); - # 行を逆順に取得する + // fetch rows in reverse order - for ($i = mysql_num_rows ($result) - 1; $i >=0; $i--) { - if (!mysql_data_seek ($result, $i)) { - printf ("行 %d に移動できません\n", $i); + for ($i = mysql_num_rows($result) - 1; $i >=0; $i--) { + if (!mysql_data_seek($result, $i)) { + echo "Cannot seek to row $i\n"; continue; } - if(!($row = mysql_fetch_object ($result))) + if(!($row = mysql_fetch_object($result))) continue; - printf ("%s %s&lt;BR>\n", $row->last_name, $row->first_name); + echo "$row->last_name $row->first_name<br />\n"; } - mysql_free_result ($result); + mysql_free_result($result); ?> +]]> </programlisting> </example> </refsect1> @@ -389,8 +488,8 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>mysql_db_name</function></funcdef> - <paramdef>int <parameter>result</parameter></paramdef> + <funcdef>string <function>mysql_db_name</function></funcdef> + <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter>row</parameter></paramdef> <paramdef>mixed <parameter> @@ -414,7 +513,8 @@ <example> <title><function>mysql_db_name</function> の例</title> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php error_reporting(E_ALL); mysql_connect('dbhost', 'username', 'password'); @@ -422,11 +522,12 @@ $i = 0; $cnt = mysql_num_rows($db_list); -while ($i &lt; $cnt) { +while ($i < $cnt) { echo mysql_db_name($db_list, $i) . "\n"; $i++; } ?> +]]> </programlisting> </example> <para> @@ -445,10 +546,10 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>mysql_db_query</function></funcdef> + <funcdef>resource <function>mysql_db_query</function></funcdef> <paramdef>string <parameter>database</parameter></paramdef> <paramdef>string <parameter>query</parameter></paramdef> - <paramdef>int + <paramdef>resource <parameter> <replaceable><optional>link_identifier</optional></replaceable> </parameter> @@ -469,10 +570,17 @@ 同様にリンクを作成しようとします。 </para> <para> - <function>mysql_connect</function>も参照下さい。 + <function>mysql_connect</function>と + <function>mysql_query</function>も参照下さい。 </para> - <para> - 下位互換性の維持のために<function>mysql</function>も使用可能です。 + <para> + <note> + <simpara> + この関数は、PHP 4.0.6以降古い関数となっています。この関数は使用 + しないで下さい。替わりに<function>mysql_select_db</function>お + よび<function>mysql_query</function>を使用して下さい。 + </simpara> + </note> </para> </refsect1> </refentry> @@ -486,17 +594,17 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef>int <function>mysql_drop_db</function></funcdef> + <funcdef>bool <function>mysql_drop_db</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> - <paramdef>int + <paramdef>resource <parameter> <replaceable><optional>link_identifier</optional></replaceable> </parameter> </paramdef> </funcprototype> </funcsynopsis> - <para> - 成功した場合に&true;、失敗した場合に&false;を返します。 + <para> + &return.success; </para> <para> <function>mysql_drop_db</function>は、指定したlink_identifierが指す @@ -507,6 +615,9 @@ 下位互換性の維持のため、<function>mysql_dropdb</function>を 使用することも可能です。 </para> + <para> + <function>mysql_create_db</function>も参照下さい。 + </para> </refsect1> </refentry> @@ -522,7 +633,7 @@ <funcsynopsis> <funcprototype> <funcdef>int <function>mysql_errno</function></funcdef> - <paramdef>int + <paramdef>resource <parameter> <replaceable><optional>link_identifier</optional></replaceable> </parameter> @@ -546,14 +657,16 @@ 他のMySQL関数をコールする前に値をチェックするようにして下さい。 <informalexample> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php mysql_connect("marliesle"); -echo mysql_errno().": ".mysql_error()."&lt;BR>"; +echo mysql_errno().": ".mysql_error()."<BR>"; mysql_select_db("nonexistentdb"); -echo mysql_errno().": ".mysql_error()."&lt;BR>"; +echo mysql_errno().": ".mysql_error()."<BR>"; $conn = mysql_query("SELECT * FROM nonexistenttable"); -echo mysql_errno().": ".mysql_error()."&lt;BR>"; +echo mysql_errno().": ".mysql_error()."<BR>"; ?> +]]> </programlisting> </informalexample> </para> @@ -575,7 +688,7 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>mysql_error</function></funcdef> - <paramdef>int + <paramdef>resource <parameter> <replaceable><optional>link_identifier</optional></replaceable> </parameter> @@ -596,14 +709,16 @@ 他のMySQL関数をコールする前にあ値をチェックするようにして下さい。 <informalexample> <programlisting role="php"> -&lt;?php +<![CDATA[ +<?php mysql_connect("marliesle"); -echo mysql_errno().": ".mysql_error()."&lt;BR>"; +echo mysql_errno().": ".mysql_error()."<BR>"; mysql_select_db("nonexistentdb"); -echo mysql_errno().": ".mysql_error()."&lt;BR>"; +echo mysql_errno().": ".mysql_error()."<BR>"; $conn = mysql_query("SELECT * FROM nonexistenttable"); -echo mysql_errno().": ".mysql_error()."&lt;BR>"; +echo mysql_errno().": ".mysql_error()."<BR>"; ?> +]]> </programlisting> </informalexample> </para> @@ -653,7 +768,7 @@ <funcsynopsis> <funcprototype> <funcdef>array <function>mysql_fetch_array</function></funcdef> - <paramdef>int <parameter>result</parameter></paramdef> + <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter> <replaceable><optional>result_type</optional></replaceable> @@ -677,8 +792,10 @@ 同名の他のカラムにアクセスするには、そのカラムの数値インデックス を使うかまたはカラムの別名を定義する必要があります。 <informalexample> - <programlisting> -select t1.f1 as foo t2.f1 as bar from t1, t2 + <programlisting role="sql"> +<![CDATA[ +select tone.field as foo ttwo.field as bar from tone, ttwo +]]> </programlisting> </informalexample> </para> @@ -692,7 +809,16 @@ <function>mysql_fetch_array</function>の オプションの2番目の引数<parameter>result_type</parameter>は定数であり、 次の値をとります。: MYSQL_ASSOC, MYSQL_NUM, MYSQL_BOTH - (この機能は PHP 3.0.7で追加された機能です) + この機能は PHP 3.0.7で追加された機能です。この引数のデフォルト値は、 + MYSQL_BOTHです。 + </para> + <para> + MYSQL_BOTHを使用すると、連想添字と数値添字を共に有する配列を取得 + します。MYSQL_ASSOCを使用すると、( + <function>mysql_fetch_assoc</function>の動作と同様に)連想添字のみ + が取得され、MYSQL_NUMを使用すると、 + (<function>mysql_fetch_row</function>の動作と同様に数値添字のみが + 取得されます。 </para> <para> より詳細な情報については、 @@ -700,19 +826,22 @@ <function>mysql_fetch_assoc</function>も参照下さい。 </para> <example> - <title><function>mysql_fetch_array</function></title> + <title><function>mysql_fetch_array</function>の例</title> <programlisting role="php"> -&lt;?php -mysql_connect ($host, $user, $password); -$result = mysql_db_query ("database","select user_id, fullname from table"); -while ($row = mysql_fetch_array ($result)) { - echo "user_id: ".$row["user_id"]."&lt;br>\n"; - echo "user_id: ".$row[0]."&lt;br>\n"; - echo "fullname: ".$row["fullname"]."&lt;br>\n"; - echo "fullname: ".$row[1]."&lt;br>\n"; +<![CDATA[ +<?php +mysql_connect($host, $user, $password); +mysql_select_db("database"); +$result = mysql_query("select user_id, fullname from table"); +while ($row = mysql_fetch_array($result)) { + echo "user_id: ".$row["user_id"]."<br>\n"; + echo "user_id: ".$row[0]."<br>\n"; + echo "fullname: ".$row["fullname"]."<br>\n"; + echo "fullname: ".$row[1]."<br>\n"; } -mysql_free_result ($result); +mysql_free_result($result); ?> +]]> </programlisting> </example> </refsect1> @@ -730,7 +859,7 @@ <funcsynopsis> <funcprototype> <funcdef>array <function>mysql_fetch_assoc</function></funcdef> - <paramdef>int <parameter>result</parameter></paramdef> + <paramdef>resource <parameter>result</parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -749,8 +878,9 @@ <para> 結果の複数のカラムが同じフィールド名を有している場合、最後のカラ ムが優先されます。同じ名前を有する他のカラムにアクセスするには、 - <function>mysql_fetch_array</function>を使用し、同時に数値添字も - 返す必要があります。 + <function>mysql_fetch_row</function>を使用して数値添字を返すか、 + エイリアス名を追加する必要があります。エイリアスの説明については、 + <function>mysql_fetch_array</function>の例を参照下さい。 </para> <para> <function>mysql_fetch_assoc</function>の使用に関して、著しい付加 @@ -764,15 +894,19 @@ <example> <title><function>mysql_fetch_assoc</function></title> <programlisting role="php"> -&lt;?php -mysql_connect ($host, $user, $password); -$result = mysql_db_query ("database","select * from table"); -while ($row = mysql_fetch_assoc ($result)) { +<![CDATA[ +<?php +mysql_connect($host, $user, $password); +mysql_select_db($database); +$query = "select * from table"; +$result = mysql_query($query); +while ($row = mysql_fetch_assoc($result)) { echo $row["user_id"]; echo $row["fullname"]; } -mysql_free_result ($result); +mysql_free_result($result); ?> +]]> </programlisting> </example> </refsect1> @@ -790,7 +924,7 @@ <funcsynopsis> <funcprototype> <funcdef>object <function>mysql_fetch_field</function></funcdef> - <paramdef>int <parameter>result</parameter></paramdef> + <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter> <replaceable><optional>field_offset</optional></replaceable> @@ -876,20 +1010,22 @@ <example> <title><function>mysql_fetch_field</function></title> <programlisting role="php"> -&lt;?php -mysql_connect ($host, $user, $password) - or die ("接続できません"); -$result = mysql_db_query ("database", "select * from table") - or die ("クエリが失敗しました"); +<![CDATA[ +<?php +mysql_connect('localhost:3306', $user, $password) + or die ("Could not connect"); +mysql_select_db("database"); +$result = mysql_query("select * from table") + or die("Query failed"); # get column metadata $i = 0; -while ($i &lt; mysql_num_fields ($result)) { - echo "カラム $i の情報 &lt;BR>\n"; - $meta = mysql_fetch_field ($result); +while ($i < mysql_num_fields($result)) { + echo "Information for column $i:<BR>\n"; + $meta = mysql_fetch_field($result); if (!$meta) { - echo "情報を入手できません &lt;BR>\n"; + echo "No information available<BR>\n"; } - echo "&lt;PRE> + echo "<PRE> blob: $meta->blob max_length: $meta->max_length multiple_key: $meta->multiple_key @@ -902,11 +1038,12 @@ unique_key: $meta->unique_key unsigned: $meta->unsigned zerofill: $meta->zerofill -&lt;/PRE>"; +</PRE>"; $i++; } -mysql_free_result ($result); +mysql_free_result($result); ?> +]]> </programlisting> </example> <para> @@ -926,8 +1063,8 @@ <title>説明</title> <funcsynopsis> <funcprototype> - <funcdef> <function>mysql_fetch_lengths</function></funcdef> - <paramdef>int <parameter>result</parameter></paramdef> + <funcdef>array <function>mysql_fetch_lengths</function></funcdef> + <paramdef>resource <parameter>result</parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -959,7 +1096,7 @@ <funcsynopsis> <funcprototype> <funcdef>object <function>mysql_fetch_object</function></funcdef> - <paramdef>int <parameter>result</parameter></paramdef> + <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter> <replaceable><optional>result_typ</optional></replaceable> @@ -987,17 +1124,20 @@ 速度面では、この関数は<function>mysql_fetch_array</function>と同等で、 <function>mysql_fetch_row</function>とほぼ同等です。(違いはわずかです) <example> - <title>MySQLオブジェクトの取得</title> + <title><function>mysql_fetch_object</function>の例</title> <programlisting role="php"> -&lt;?php -mysql_connect ($host, $user, $password); -$result = mysql_db_query ("database", "select * from table"); -while($row = mysql_fetch_object ($result)) { +<![CDATA[ +<?php +mysql_connect("hostname", "user", "password"); +mysql_select_db($db); +$result = mysql_query("select * from table"); +while ($row = mysql_fetch_object($result)) { echo $row->user_id; echo $row->fullname; } -mysql_free_result ($result); +mysql_free_result($result); ?> +]]> </programlisting> </example> </para> @@ -1018,7 +1158,7 @@ <funcsynopsis> <funcprototype> <funcdef>array <function>mysql_fetch_row</function></funcdef> - <paramdef>int <parameter>result</parameter></paramdef> + <paramdef>resource <parameter>result</parameter></paramdef> </funcprototype> </funcsynopsis> <para> @@ -1057,7 +1197,7 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>mysql_field_flags</function></funcdef> - <paramdef>string <parameter>result</parameter></paramdef> + <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter>field_offset</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -1091,18 +1231,53 @@ <funcsynopsis> <funcprototype> <funcdef>string <function>mysql_field_name</function></funcdef> - <paramdef>int <parameter>result</parameter></paramdef> + <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter>field_index</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>mysql_field_name</function>は、指定したフィールドの - 名前を返します。関数の引数は、結果IDとフィールドインデックスです。 - すなわち、<literal>mysql_field_name($result,2);</literal> + 名前を返します。<parameter>result</parameter>は有効な結果ID、 + <parameter>field_index</parameter>はフィールドのオフセット数とす + る必要があります。 </para> + <note> + <para> + <parameter>field_index</parameter>は0から始まります。 + </para> + <para> + 例えば、3番目のフィールドの添字は2、4番目のフィールドの添字は3と + いったようになります。 + </para> + </note> <para> - <function>mysql_field_name</function>は、結果IDが指す結果において - 2番目のフィールドの名前を返します。 + <example> + <title><function>mysql_field_name</function>の例</title> + <programlisting role="php"> +<![CDATA[ +// The users table consists of three fields: +// user_id +// username +// password. +$link = mysql_connect('localhost', $user, "secret"); +mysql_select_db($dbname, $link) + or die("Could not set $dbname"); +$res = mysql_query("select * from users", $link); + +echo mysql_field_name($res, 0) . "\n"; +echo mysql_field_name($res, 2); +]]> + </programlisting> + <para> + 上の例は出力のようになります。 + <screen> +<![CDATA[ +user_id +password +]]> + </screen> + </para> + </example> </para> <para> 下位互換性を維持するため、<function>mysql_fieldname</function> Index: phpdoc/ja/functions/network.xml diff -u phpdoc/ja/functions/network.xml:1.22 phpdoc/ja/functions/network.xml:1.23 --- phpdoc/ja/functions/network.xml:1.22 Wed Dec 12 15:53:25 2001 +++ phpdoc/ja/functions/network.xml Sat Jan 26 03:55:51 2002 @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.23 $ --> <reference id="ref.network"> <title>ネットワーク関数</title> <titleabbrev>ネットワーク</titleabbrev>
« previous php.doc (#969341628) next »