diff --git a/appendices/migration71/windows-support.xml b/appendices/migration71/windows-support.xml index d5843bdeeb2..3bb58daf3d8 100644 --- a/appendices/migration71/windows-support.xml +++ b/appendices/migration71/windows-support.xml @@ -1,6 +1,6 @@ - + Windows のサポート @@ -109,7 +109,7 @@ ストリームで UTF-8 がサポートされたことによって、 PHP スクリプトは ASCII や ANSI のファイル名にもはや縛られなくなりました。 - これは CLI の枠を越えたサポートです。他の SAPI については、 + CLI では、追加の設定なしでそのまま利用できます。他の SAPI については、 対応するサーバーのドキュメントを見ると有益でしょう。 @@ -117,15 +117,15 @@ 260バイトより長いパス名には、 自動的に \\?\ という prefix が付きます。 パス名の最大の長さは、2048バイトに制限されています。 - パスセグメントの長さの制限 (basepath の長さ) はまだ続いていることも知っておいてください。 + パスセグメントの長さの制限 (basename の長さ) はまだ続いていることも知っておいてください。 - + 移植性を最大にするために、ファイル名や I/O 、 そして他の関連するトピックを UTF-8 で扱うことを強くお勧めします。 それに加えて、コンソールアプリケーションについては、 TrueType フォントを使うことが好ましいです。 また、コードページの変更に ini_set() を使うことは推奨されません。 - + diff --git a/chapters/intro.xml b/chapters/intro.xml index f25f5f650cf..f3f153090c3 100644 --- a/chapters/intro.xml +++ b/chapters/intro.xml @@ -1,6 +1,6 @@ - + @@ -127,33 +127,33 @@ さらには手続き型プログラミングかオブジェクト指向プログラミングか、 もしくはそれらを混在させるかといった選択を行うこともできます。 - + PHP は HTML を出力するだけではありません。PHP はリッチなファイルタイプ、 たとえば 画像やPDFファイルを出力する機能を備えていますし、 データを暗号化したり、メールを送信することもできます。 また、JSON や XML のような任意のテキストも簡単に出力できます。 これらのファイルを自動生成したり、 - 印刷する代わりにファイルシステムに保存したり、 + 出力する代わりにファイルシステムに保存したり、 動的なコンテンツのためにサーバー側でキャッシュすることも出来ます。 - - + + PHP の機能の中で最も強力で優れているのは、 広範なデータベースをサポートしている ことでしょう。データベース機能を用いたWebページの作成は非常に簡単です。 - データベースごとに用意された拡張モジュール (e.g., for mysql) + データベースごとに用意された拡張モジュール (e.g., for MySQL) を使うこともできれば PDO のような抽象化レイヤーを使うこともでき、 ODBC に対応しているデータベースなら ODBC 拡張モジュールを使って接続することもできます。その他には、 cURL あるいは ソケット を使う CouchDB のような例もあります。 - + PHP は、LDAP、IMAP、SNMP、NNTP、POP3、HTTP、COM (Windowsのみ) やその他 数え切れない程多くのプロトコルを用いて他のサービスと通信を行う 機能もサポートしています。低レベルのネットワークソケットをオープンし、 他のプロトコルを用いて通信を行うことも可能です。 - + PHP には便利な テキスト処理 機能が用意されています。 Perl 互換の正規表現 (PCRE) や、 XML 文書のパースや XML 文書へのアクセス @@ -162,7 +162,7 @@ SimpleXML や XMLReader、そして XMLWriter がサポートされています。 - + 他にも興味深い拡張モジュールがあり、 アルファベット順 および カテゴリ別 diff --git a/chapters/tutorial.xml b/chapters/tutorial.xml index f5f471d2307..f65fc411f09 100644 --- a/chapters/tutorial.xml +++ b/chapters/tutorial.xml @@ -1,6 +1,6 @@ - + 簡易チュートリアル @@ -110,7 +110,7 @@ php -S localhost:8000 通常の HTML ファイルと考えることができます。 - + この例の目的は、特殊な PHP タグ形式を示すことです。 この例では、<?php が PHP タグの開始を示しています。この後、PHP 命令を置き、終了タグ ?> @@ -118,25 +118,25 @@ php -S localhost:8000 このように任意の場所で PHP モードを抜けて HTML ファイルに移ることができます。詳細は、 基本的な構文のセクションを参照ください。 - + 改行に関する注意 - + HTML においては改行にはほとんど意味がありません。ただ、 HTML の見栄えをよくするためにも適宜改行を入れておくとよいでしょう。 ?> の直後の改行は、PHP によって取り除かれます。 複数の PHP ブロックを使用している場合や、 - 何かを出力するのかどうかがわからないファイルを include する際などに、 + 何も出力しないはずの PHP のファイルを include する際などに、 この挙動は非常に便利です。と同時に少々混乱するかもしれません。 - 強制的に改行させるには、?> の後に空白を置くか、 + 空白と改行を強制的に出力させるには、?> の後に空白を置くか、 あるいは PHP ブロック内の最後の echo/print で明示的に改行を出力します。 - + テキストエディタに関する注意 - + PHP ファイルを作成、編集、管理する際に使用できる、 多くのテキストエディタや統合開発環境 (IDE) があります。 これらのツールのリストの一部は、 + ワードプロセッサに関する注意 - - StarOffice Writer, Microsoft Word および Abiword + + StarOffice Writer, Microsoft Word および AbiWord のようなワードプロセッサは、PHP ファイルの編集には向いていません。 これらのワープロ上でテストスクリプトを編集する場合は、 ファイルをプレーンテキストとして保存していることを確認してください。 さもないと、PHP はスクリプトを読み込んで実行できません。 - + - + さて、動作する簡単な PHP スクリプトを作成することができましたので、 最も有名な PHP スクリプトを作成してみましょう! phpinfo 関数をコールすることにより、 @@ -166,7 +166,7 @@ php -S localhost:8000 ロードされている PHP モジュール、設定 等のシステムに関する多くの有用な情報を得ることができます。 この重要な情報を見てみてください。 - + @@ -230,12 +230,12 @@ Mozilla/5.0 (Linux) Firefox/112.0 - + PHP で利用可能な変数の型 には多くの種類があります。上の例では、 配列 の要素を出力しています。配列は、非常に有用です。 - + $_SERVER は、PHP で自動的に利用可能な変数のひとつに過ぎません。マニュアルの @@ -285,7 +285,7 @@ if (str_contains($_SERVER['HTTP_USER_AGENT'], 'Firefox')) { PHP の入門書を手にとって最初の数章を読むか、このマニュアルの 言語リファレンスの部分を読むべきです。 - + 二番目の新しい概念は、str_contains 関数のコールです。 str_contains は PHP に組み込まれた関数で、 指定された文字列が、別の文字列に含まれているかを判定します。この場合、 @@ -308,7 +308,7 @@ if (str_contains($_SERVER['HTTP_USER_AGENT'], 'Firefox')) { 関数定義の読み方および PHP関数のセクションの両方を 読んでみると良いでしょう。 - + この例を少し発展させて、PHP ブロックの中からでも PHP モードから出たり入ったりすることができることを以下に示します。 @@ -344,7 +344,7 @@ if (str_contains($_SERVER['HTTP_USER_AGENT'], 'Firefox')) { - + 何かを出力する際に PHP の echo 文を使用する代わりに、PHP モードを抜けて通常の HTML を送信しています。ここで注意すべき重要で強力な点は、 スクリプトの論理フローが損なわれないということです。 @@ -352,19 +352,19 @@ if (str_contains($_SERVER['HTTP_USER_AGENT'], 'Firefox')) { のどちらを返すか、言い換えるとFirefox が見つかったかどうかに基づき、HTML ブロックだけが見る側に送信されることになります。 - + フォームの処理 - + PHP の最も強力な機能の一つは、HTML フォームを処理する手段です。 理解するべき重要な基本概念は、あるフォームの中の全てのフォーム要素が、 自動的に PHP スクリプトで利用可能になるということです。 詳細は、マニュアルのセクション 外部から来る変数 および PHP でフォームを使用する例を参照ください。以下に HTML フォームの例を示します。 - + 簡単な HTML フォーム @@ -409,10 +409,10 @@ if (str_contains($_SERVER['HTTP_USER_AGENT'], 'Firefox')) { - + htmlspecialchars および (int) の部分以外は、何を行っているかは明らかでしょう。 - htmlspecialchars は、html での特殊な文字を適切にエンコードし、 + htmlspecialchars は、HTML での特殊な文字を適切にエンコードし、 HTML タグや JavaScript をページ内に仕込めないようにします。 また、age フィールドには数値が入ることがわかっているので、これを int 型に 変換 @@ -430,9 +430,9 @@ if (str_contains($_SERVER['HTTP_USER_AGENT'], 'Firefox')) { に代入されます。リクエストデータの発信源に留意しない場合には、 スーパーグローバル変数 $_REQUEST - を使用することもできます。この変数は、GET, POST, COOKIE, FILE + を使用することもできます。この変数は、GET, POST, COOKIE データの混ざったものが含まれます。 - + diff --git a/chmonly/aboutchm.xml b/chmonly/aboutchm.xml index 7c1be484f08..bcb70851c45 100644 --- a/chmonly/aboutchm.xml +++ b/chmonly/aboutchm.xml @@ -1,14 +1,14 @@ - + このヘルプについて - - PHPマニュアル の Windowsヘルプ版 は、このマニュアルをいつも手元に置いておきたかったり、Webページをダウンロードするのを待つことなくマニュアルページやユーザーが書き込んだ Note を読みたい開発者を対象にしています。Windowsヘルプ版 は、PHPマニュアルの全ての内容と、ユーザーが書き込んだ Note が全て含まれていますし、このフォーマットを生成するスクリプトや他のコントリビューターがスキンの形で提供したビューアアプリケーションの素晴らしい機能がいくつか付いてきます。 - + + PHPマニュアル の Windowsヘルプ版 は、このマニュアルをいつも手元に置いておきたかったり、Webページをダウンロードするのを待つことなくマニュアルページやユーザーが書き込んだ Note を読みたい開発者を対象にしています。Windowsヘルプ版 は、PHPマニュアルの全ての内容と、ユーザーが書き込んだ Note が全て含まれています。また、ビューアアプリケーション、このフォーマットの生成に使っているスクリプト、そして他のコントリビューターによるスキンが、素晴らしい機能をいくつか提供しています。 + - + PHPマニュアル の配布物に多くのファイルが含まれており、それらはメインマニュアルファイルである php_manual_ja.chm に入っています。(既にお察しの通り) あなたは PHPマニュアル をこのファイルをダブルクリックすることで見ることが出来ます。 同じフォルダで php_manual_ja.chw というファイルを見ることがあるかもしれません。これは「キーワード」タブをはじめて使うときに生成され、マニュアルページのインデックスが含まれています。 - + Microsoft HTMLヘルプ の技術的な詳細に興味がある方向けの素晴らしいリソースに、&url.chm.helpware; があります。Microsoft ヘルプフォーマットやサービスの歴史における Windows HTMLヘルプの位置付けや、さらに詳しい情報は WinWriters の記事 を参照ください。 diff --git a/chmonly/integration.xml b/chmonly/integration.xml deleted file mode 100644 index 3fa21aa40e3..00000000000 --- a/chmonly/integration.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - Integrating the PHP Manual - - - - - The information provided here is mainly aimed at IDE authors, or - advanced users who would like to integrate this CHM file to their - favorite IDEs or other production environment components. - - - - - There are several editors out there with support for CHM integration, - but you may need to know a few things about what the CHM contains - to successfully integrate the manual into your environment. - - - The CHM is built using XSL style sheets from XML sources. This is - unique currently in the PHP Manual family, as all other versions are - generated using DSSSL style sheets. This also means, that - non-intentional rendering differences may come up. A special - conversion script is run on the XSLT output, adding several cute - features, and packing up the manual with the preferences files - and skin examples. - - - If you never worked with CHMs, you can think of them as compressed - files with OS supported access for files inside and some added search - and index support. However CHMs can only be viewed using the HTML Help - Viewer, you can directly access files inside them using a special URL - prefix, the CHM file name and the file you request from inside. As all - the help content is stored in HTML files, you can show pages of the CHM - in Internet Explorer. - - - Assume that you placed your php_manual_en.chm to - c:\phpmanual the index file in the manual (which - you see the first time) can be accessed with the following URL: - mk:@MSITStore:C:\phpmanual\php_manual_en.chm::/_index.html. - Here mk:@MSITStore: is the special "protocol", - C:\phpmanual\php_manual_en.chm is the CHM with its - full path. The /_index.html part is the path to the - index file inside the CHM and :: is just what you need - to put between the CHM path and this file path. - - - - - All files are in the root directory of the CHM, unlike the previous - CHM versions which included a language directory. Images, style sheets - and other supplemental files have names starting with an underscore - (like the main index shown above), to avoid name collisions. - - - - - The names of generated files follow the same rules as the online - manual, except that the extension is .html and - not .php. The most important is that function - documentation files are named function.FUNCNAME.html - where FUNCNAME is the function name, with all - underscores converted to hyphens. Some examples are - function.echo.html, - function.mysql-close.html, - function.imagecopy.html. - - - Using all this information, you can show a manual page for a function - requested by a user. A simple example is included in the distribution, - named php_quickref.hta. This is a - HTML Application to demonstrate the - simple process of showing a manual page for a function. The - quickRef() function defined therein does the job. - - - If you would like to integrate the manual into an IDE without direct - support for the PHP manual (actually the underscore to hyphen conversion), - you can use the included _function.html file to access - a function page. This file is simply a redirector, and can be parameterized via - the URL, as _function.html#mysql_close. This page - will redirect you to the mysql_close function page - (function.mysql-close.html) automatically. You can - provide the full path of this file if your IDE supports context sensitive - help, and provide the IDE specified string as the parameter. An example - for this is the UltraEdit 9 integration (see the edition's website). - - - The index of the manual (accessible via the index tab on the navigation - pane) can also be used for integrational purposes. All the HTML pages - are included in the index with their titles as index terms (including - function description pages). - - - If you are a desktop application developer and would like to tightly - integrate the CHM into your program (such as displaying the TOC tree - in your IDE's help box), you can find more information at - &url.chm.helpware;, as well as - links to other useful resources. The official site for HTML Help is - at &url.chm;. - - - - diff --git a/chmonly/search.xml b/chmonly/search.xml deleted file mode 100644 index 28e463dff37..00000000000 --- a/chmonly/search.xml +++ /dev/null @@ -1,315 +0,0 @@ - - - - - 全文検索 - - - This edition of the PHP Manual includes an advanced full text - search possibility provided by the viewer application. This enables - users to search through every word in the help file to find a - match. For example, if a user does a full-text search on the word - "Apache", every topic that contains the word "Apache" will be listed. - Advanced full-text search allows a user to search using boolean, - wildcard, and nested expressions. A user can also limit the search - to previous results, match similar words, or search topic titles only. - - - - The usage of the search feature is fairly straightforward. Click on - the search tab, type in the desired words and press ENTER (or click - on "List Topics"). Then you'll receive a list of matches from the - PHP Manual (and the notes). You can use the button with a right - arrow on it to add boolean operators to your search (or you can type - them in). As you see the results, you can use the column headings - (Title, Location and Rank) to sort the topic list. The default order - is by Rank. You can also adjust some parameters at the bottom of this - tab. - - - - The words found are highlighted on the current page in the Topic pane - by default. You can turn off this feature by choosing the "Search - Highlight Off" menu item in the Options menu. To can get this feature - back similarly. If you are viewing a long topic, only the first 500 - instances of a search word or phrase will be highlighted, due to a - limitation of the viewer. - - - - 一般的な検索のルール - - A basic search consists of the word or phrase you want to find. You - can use wildcard expressions, nested expressions, boolean operators, - similar word matches, a previous results list, or topic titles to further - define your search. - - - The basic rules for formulating queries are as follows: - - - Searches are not case-sensitive, so you can type your search in uppercase or lowercase characters. - - - - You may search for any combination of letters (a-z) and numbers (0-9). - You cannot search for single letters (a, b, c, etc.) and common - words, like: an, and, as, at, be, but, by, do, for, from, have, he, - in, it, not, of, on, or, she, that, the, there, they, this, to, we, - which, with, you. - - - - - Punctuation marks such as the period (.), colon (:), semicolon (;), comma (,), - and hyphen (-) are ignored during a search. - - - - Group the elements of your search using double quotes or parentheses to set apart each element. You cannot search for quotation marks. - - - - - - - If you are searching for a file name with an extension, you should group - the entire string in double quotes, ("filename.ext"). Otherwise, the period - will break the file name into two separate terms. The default operation - between terms is AND, so you will create the logical equivalent to - "filename AND ext." - - - - - - - 単語またはフレーズを検索する - - You can search for words or phrases and use wildcard expressions. - Wildcard expressions allow you to search for one or more characters - using a question mark or asterisk. The table below describes the - results of these different kinds of searches. - - Word and phrase searches - - - - Search for - Example - Results - - - - - A single word - select - Topics that contain the word "select". (You will also find its grammatical variations, such as "selector" and "selection".) - - - A phrase - "new operator" or new operator - - - Topics that contain the literal phrase "new operator" and all its grammatical variations. - - - Without the quotation marks, the query is equivalent to specifying "new AND operator," which - will find topics containing both of the individual words, instead of the phrase. - - - - - Wildcard expressions - esc* or HT?? - - - Results for the first example include topics that contain the terms "ESC", - "escape", "escalation", and so on. The asterisk cannot be the only - character in the term. - - - Results for the second example include topics that contain the terms "HTTP", - "HTML" and so on. The question mark cannot be the only character in the - term. - - - - - -
-
- - - - Select the Match similar words check box to include minor grammatical variations - for the phrase you search. This feature only locates variations of the word with - common suffixes. For example, a search on the word "add" will find "added," but - it will not find "additive". This option is independent of other options or syntax. - If you do a titles-only search, variations in titles will be matched. If you use - quotes (or any other query operator) any variation of the word can appear; for - example, "stemmed search" will also match "stemming search". - - - -
- - - 検索後を定義する - - The AND, OR, NOT, and NEAR operators enable you to precisely define your - search by creating a relationship between search terms. The following table - shows how you can use each of these operators. If no operator is specified, - AND is used. For example, the query "server cgi security" is equivalent - to "server AND cgi AND security". - - Search operators - - - - Search for - Example - Results - - - - - Both terms in the same topic - http AND apache - Topics containing both the words "http" and "apache". - - - Either term in a topic - ming OR swflib - Topics containing either the word "ming" or the word "swflib" or both. - - - The first term without the second term - xml NOT expat - Topics containing the word "xml" but not the word "expat". - - - Both terms in the same topic, close together - database NEAR security - Topics containing the word "database" within eight words of the word "security". - - - -
-
- - - - The |, &, and ! characters can also be used in place of OR AND and - NOT respectively. This may not work if you use a very old version of the - viewer. - - - -
- - - 入れ子の検索条件を使う - - Nested expressions allow you to create complex searches for information. - For example, "html AND ((smtp OR pop3) NEAR mail)" finds topics - containing the word "html" along with the words "smtp" and "mail" - close together, or containing "html" along with the words "pop3" and - "mail" close together. - - - The basic rules for searching help topics using nested expressions are - as follows: - - - - You can use parentheses to nest expressions within a query. The - expressions in parentheses are evaluated before the rest of the query. - - - - - If a query does not contain a nested expression, it is evaluated from left to right. - For example: "mail NOT pop3 OR smtp" finds topics containing the word "mail" without - the word "pop3" or topics containing the word "smtp". On the other hand, "mail NOT - (pop3 OR smtp)" finds topics containing the word "mail" without either of the words - "pop3" or "smtp". - - - - You cannot nest expressions more than five levels deep. - - - - - - -
- - diff --git a/chmonly/usingchm.xml b/chmonly/usingchm.xml index 98f49742eef..bf36719af07 100644 --- a/chmonly/usingchm.xml +++ b/chmonly/usingchm.xml @@ -1,16 +1,16 @@ - + CHM版 の PHPマニュアル を使う - + CHMファイル をダブルクリックすると、HTMLヘルプビューア のウィンドウが起動します。これは3つのペインに分かれています。ウィンドウの左側はナビゲーションペインで、4つのタブがあります。目次、キーワード、検索、そしてお気に入りです。ウィンドウの右側はトピックペインで、選択したヘルプトピックを表示させたり、起動時のデフォルトのヘルプトピックが表示されたりします。ヘルプページは全て別々のHTMLファイルで、Internet Explorer がページをトピックペインに表示します。3つめのペインはツールバーです。これはウィンドウのタイトルバーの下にあります。ナビゲーションペインとトピックペインの境目は、縦方向のバーをドラッグすることでレイアウトを調整できます。 - + - + CHMファイルをはじめて開くとき、ウィンドウの位置とサイズがおかしな状態かもしれません。2回目以降は、Windows が位置とサイズ、そして最後に開いたタブを記憶しています。これら全ての情報とお気に入りに入れた情報は hh.dat に保存されます。このファイルを別の場所に移動すると、これらの情報が(お気に入りの情報も含めて!)失われてしまいます。CHMファイルを新しいものに置き換えるのは、同じファイル名であれば問題ありません。ファイル名とパス名は hh.dat に保存されています。 - + HTMLヘルプのツールバー diff --git a/faq/build.xml b/faq/build.xml index 7e8a32b5947..c3d8d0da094 100644 --- a/faq/build.xml +++ b/faq/build.xml @@ -1,14 +1,14 @@ - + 構築時の問題 構築時の問題 - + 本節は、構築時に発生する多くの一般的なエラーを集めたものです。 - + @@ -93,12 +93,12 @@
- + ApacheのcoreプログラムがsharedなDSOライブラリとして コンパイルされている場合にこのエラーが出ます。 最低でも以下のフラグを使用してApacheを再configureして ください: - + --enable-shared=max --enable-rule=SHARED_CORE @@ -230,7 +230,7 @@ また、このAddTypeの行が、 - <Virtualhost> または <Directory> ブロックの中に隠 + <VirtualHost> または <Directory> ブロックの中に隠 されて、テスト用のスクリプトの場所に適用できていないようなこ とがないことを確認してください。 @@ -252,18 +252,18 @@ - + --activate-module=src/modules/php4/libphp4.a と書いてありますが、ファイルがありません。このため、 --activate-module=src/modules/php4/libmodphp4.aに 変更しましたが、やはりだめです。何が起きているのでしょう? - + - + libphp4.aファイルはこの時点では存在しない、ということに気をつけてください。 このファイルは、Apacheの構築時に自動的に作成されます。 - + @@ -451,19 +451,19 @@ $ gcc -E test.c >/dev/null - + リンクしたGDライブラリとPHPが同じライブラリ(例えばlibpng)に依存しているか どうかを確認してください。 - + - + PHP をコンパイルする際に、よくわからないエラーが発生してハングアップ します。Solaris を使用している場合に起こるようです。 - + diff --git a/faq/com.xml b/faq/com.xml index 3631c837c81..17ebd210902 100644 --- a/faq/com.xml +++ b/faq/com.xml @@ -1,6 +1,6 @@ - + PHP と COM @@ -35,30 +35,30 @@ - + 多くの VARIANT タイプとその組み合わせがあり、そのほとんどは サポートされていますが、残りのいくつかは未だ実装されていません。 また配列も完全にサポートされているわけではなく、PHP と COM の間で 受け渡しが可能なのは 1 次元の添字付配列のみです。もしこの他に サポートされていないタイプを見つけた場合は(既知でなければ)、 できる限りの情報を添えてバグとして報告してください。 - + - PHP でビジュアルオブジェクトを操作できますか? + PHP でビジュアルオブジェクトを操作できますか? - + 基本的には可能です。しかし PHP はほとんどの場合ウェブスクリプティングの 言語として使用されウェブサーバー上で実行されるため、ビジュアルオブジェクトが サーバーのデスクトップに現れることはありません。もし PHP を アプリケーション作成に使用する、すなわち PHP-GTK と合わせて 使用する場合にはアクセスに制限はありません。COM を通じて ビジュアルオブジェクトを操作することができます。 - + @@ -134,16 +134,16 @@ - + COM オブジェクトをリモートサーバーから実行するにはどうすればよいですか? - + - + ローカルオブジェクトを実行するのと全く同様です。ただ、COM コンストラクタの 2 番目のパラメータにリモートマシンの IP アドレスを 渡すだけです。 - + &php.ini; に com.allow_dcom=&true; @@ -176,12 +176,12 @@ - + これは PHP とは関係ありません。ActiveX オブジェクトは、HTML ドキュメントから要求があった場合にクライアント側でロードされます。 PHP スクリプトとは関係が無く、従ってサーバー側と直接やりとりすることも できません。 - + @@ -213,9 +213,9 @@ $word = new COM("C:\docs\word.doc"); - + COM オブジェクトから送られてくるイベントを扱う方法はありますか? - + @@ -235,10 +235,10 @@ $word = new COM("C:\docs\word.doc"); - + この問題に対する答えは、簡単ですが残念なものです。正確には わかりませんが、おそらく打つ手はありません。 - + @@ -261,10 +261,10 @@ $word = new COM("C:\docs\word.doc"); - + PHP が COM オブジェクトを操作することができるということは、MTS を 使ってコンポーネントリソースを扱えると考えてもよいということですか? - + diff --git a/faq/databases.xml b/faq/databases.xml index d97f1a97b1b..b8be87786eb 100644 --- a/faq/databases.xml +++ b/faq/databases.xml @@ -1,16 +1,16 @@ - + データベースに関する問題 データベースに関する問題 - + このセクションでは PHP とデータベースとの関係に関する一般的な質問を 扱います。なんと! PHP は事実上あらゆるデータベースにアクセスすることが できます。 - + @@ -47,7 +47,7 @@ ODBC ドライバを提供しています。 - 他には、Microsoft SQL Server に ODBC ドライバを使用してデータを + 他には、Windows 用の ODBC ドライバがある SQL サーバーにデータを 保存するという手段もあります。これによって、Microsoft Access (ODBC を使用します) と PHP (組み込まれているドライバを使用します) でデータに アクセスすることができます。また、Microsoft Access と PHP 両者共に @@ -66,11 +66,11 @@ - + うまくいくことが分かってるもう一つの方法は、MySQL と Windows 用の MyODBC ドライバを利用してデータベースを同期する方法です。Steve Lawrence が言うには、 - + diff --git a/faq/general.xml b/faq/general.xml index bcd708a7081..82fd03fc7c1 100644 --- a/faq/general.xml +++ b/faq/general.xml @@ -1,6 +1,6 @@ - + 一般的な情報 @@ -35,14 +35,14 @@ PHP とは何の略ですか? - + PHP は PHP: Hypertext Preprocessor の略です。 最初の文字が「頭字語の頭字語」になっているため多くの人は混乱します。 この種の頭字語は「再帰的頭字語」と呼ばれます。さらに詳細な情報に興味がある方は、Free On-Line Dictionary of Computing + xlink:href="&url.foldoc;">Free On-line Dictionary of Computing あるいは Wikipedia のエントリ で再帰的頭字語についてもっと詳しく知ることが出来ます。 - + @@ -51,18 +51,18 @@ 各バージョン間の関係は? - + PHP/FI 2.0 は PHP の初期の、 そしてもうすでにサポートされていないバージョンです。 PHP 3 は PHP/FI 2.0 の後継バージョンで、 PHP/FI 2.0 に比べて大きく進歩しています。 PHP 8 が PHP の最新バージョンです。これは Zend Engine 4 を使用しており、 - さまざまな OOP 機能を提供します。 - + さまざまな OOP 機能を提供します。 + - + 異なるバージョンの PHP を同時に実行することができますか? diff --git a/faq/html.xml b/faq/html.xml index 3c20bbd74b5..e8ee7136564 100644 --- a/faq/html.xml +++ b/faq/html.xml @@ -1,6 +1,6 @@ - + PHP と HTML @@ -133,11 +133,11 @@ - + <input type="image"> タグを使おうとしているのですが、変数 $foo.x と $foo.y が使えません。 $_GET['foo.x'] も存在していません。どうすればよいのですか? - + @@ -170,7 +170,7 @@ - HTML フォームで配列を使用するにはどうすればよいですか? + HTML フォームで配列を使用するにはどうすればよいですか? @@ -242,7 +242,7 @@ 同じ名前で渡されることです。つまり、 + ]]> こうすれば PHP に $var を配列として扱うように diff --git a/faq/installation.xml b/faq/installation.xml index f2eeba0c50d..55df885485d 100644 --- a/faq/installation.xml +++ b/faq/installation.xml @@ -1,6 +1,6 @@ - + インストール @@ -69,13 +69,13 @@ --with-config-file-scan-dir=PATH - + Windows の場合、&php.ini; のデフォルトパスは Windows ディレクトリになります。 Apache ウェブサーバーを使っている場合はまず Apache がインストールされているディレクトリ - (例えば c:\program files\apache group\apache にある + (例えば c:\program files\apache group\apache) にある &php.ini; を探そうとします。このため、異なる &php.ini; ファイルを異なるバージョンの Apache ごとに置いておくことができます。 - + 設定ファイルの章も参照ください。 @@ -161,10 +161,10 @@ - + Unix: RPM を使って PHP をインストールしたのですが、Apache が PHP のページを 処理してくれません。何が起こっているのですか? - + @@ -204,13 +204,13 @@ AddType application/x-httpd-php .php - + いいえ。PHP は FrontPage 拡張モジュールと問題なく共存できます。 問題は FrontPage 拡張モジュールのパッチが PHP が依存している Apache の 構造の一部を変更してしまうことにあります。パッチを当てた後で PHP を再コンパイル('make clean; make' としてください)すれば問題は 解決されます。 - + @@ -234,10 +234,10 @@ AddType application/x-httpd-php .php - + Unix/Windows: PHP をインストールしたのですがブラウザから PHP スクリプトにアクセスすると Internal Server Error 500 となってしまいます。 - + @@ -360,11 +360,11 @@ cgi error: - + IIS, PWS, OmniHTTPD, Xitami上でCGIとしてPHPを実行するとき、 次のようなエラーが出る:Security Alert! PHP CGI cannot be accessed directly. - + @@ -531,9 +531,9 @@ AddType text/html php - + PHP が処理できるリクエストメソッドは GET および POST だけなのですか? - + diff --git a/faq/mailinglist.xml b/faq/mailinglist.xml index b2b4e14b20b..f665fc6f82a 100644 --- a/faq/mailinglist.xml +++ b/faq/mailinglist.xml @@ -1,6 +1,6 @@ - + メーリングリスト @@ -71,7 +71,7 @@ - + メーリングリストからの脱退がうまくいかない原因でもっとも多いのは、 メールの転送処理にからむものです。たとえば、あなたのメールアドレスが elephpant@example.com であったとしましょう。 @@ -82,7 +82,7 @@ このアドレスはメーリングリストに登録されていないからです。 この場合は、メールが実際に送信されているアドレス、つまり php-lists@example.com で脱退処理をしなければなりません。 - + @@ -121,7 +121,7 @@ なので、参加者全員の利益のために、メーリングリストは 他のどこを当たっても駄目だった場合の最後の手段にしてください。 - + メーリングリストに投稿する前に、 この FAQ とマニュアルを見て手がかりを探してください。 もし駄目なら次にメーリングリストのアーカイブをチェックしてください @@ -131,7 +131,7 @@ README ファイルに目を通してください。 それでも問題が解決できない場合に、 適切なメーリングリストを使用することは大歓迎です。 - + 適切な回答を得るため (そして他の開発者たちをいらつかせないため) にも、 質問は適切なメーリングリストに行うようにしましょう。 @@ -174,12 +174,12 @@ あなたが十分だと思うだけの情報を記述するようにしましょう。 そして、より詳しい情報を求められたときのために準備をしておきます。 - + もう一つ重要な点があります。 それは Subject であなたの問題を端的に表すことです。 「助けてーー!」とか「何かおかしいのでしょうか?」といった Subject - のついたメールはほとんど人に無視されてしまいます。 - + のついたメールはほとんどの人に無視されてしまいます。 + そして最後に、 How To Ask Questions The diff --git a/faq/misc.xml b/faq/misc.xml index f988b34bc8d..694878208c0 100644 --- a/faq/misc.xml +++ b/faq/misc.xml @@ -1,6 +1,6 @@ - + その他の質問 @@ -13,9 +13,9 @@ - - bz2 で圧縮された Windows マニュアルはどのように扱えばいいのですか? - + + Windows で、bz2 で圧縮されたマニュアルはどのように扱えばいいのですか? + @@ -24,7 +24,7 @@ ダウンロードしてください (詳細は下記の情報を参照)。 - + コマンドラインツールを使いたくない場合は、Stuffit Expander、 UltimateZip、 @@ -37,18 +37,18 @@ Total Commander(以前は Windows Commander)を使用している場合は、 bz2 用のプラグインを Total Commander のサイトから無料で手に入れることが出来ます。 - + Redhat から入手可能な bzip2 コマンドラインツール: - + Windows 2000 SP2 のユーザーは バージョン 1.0.2 を、他の全ての Windows ユーザーはバージョン 1.00 を使用してください。 ダウンロードしたら実行ファイルの名前を bzip2.exe へ変更してください。 そしてそれをパスの通ったディレクトリ、例えば C:\Windows(ドライブ名は貴方のシステムにあわせて適宜変更してください) へコピーしてください。 - + 注意: lang は使用する言語を意味し、 pdf のように x は指定した形式を表します。 @@ -71,14 +71,14 @@ - + 分割 HTML 版アーカイブ(php_manual_lang.tar.bz2) をダウンロードした場合でも手順は同じです。 唯一の違いは、bzip2 コマンドの実行後に php_manual_lang.tar が生成されることです。 tar 形式のファイルは WinZip といったアーカイバで扱うことができます。 - + diff --git a/faq/obtaining.xml b/faq/obtaining.xml index 2f82c003ff7..2b2aa204c00 100644 --- a/faq/obtaining.xml +++ b/faq/obtaining.xml @@ -1,6 +1,6 @@ - + PHP を手に入れるには @@ -33,7 +33,7 @@ コンパイル済みのバージョンはありますか? - + 私たちはWindows版のみコンパイル済みのバイナリを配布しています。というの もPHPをすべてのLinux/Unixのプラットホーム用にすべての拡張モジュールの組 み合わせでコンパイルするのは不可能だからです。ただ、最近の多くのLinuxディ @@ -41,7 +41,7 @@ ナリはダウンロードページ からダウンロードすることができます。Linux用のバイナリについてはあなたが 使用しているディストリビューションのウェブサイトを訪れてください。 - + @@ -87,7 +87,7 @@ - SNMP* (Unix): . + SNMP* (Unix). @@ -118,12 +118,12 @@ - FreeType (libttf):. + FreeType (libttf). - ZLib (Unix/Win32). + zlib (Unix/Win32). @@ -188,10 +188,10 @@ - + Gitリポジトリから最新のPHPソースコードを手に入れました。Windows上でコン パイルするにはどうしたらよいですか? - + @@ -217,12 +217,12 @@ PHP をダウンロードするときの「スレッドセーフ」の意味は? - + スレッドセーフである、というのは、Windows 上の Apache 2 のような マルチスレッドのウェブサーバーでも動作するバイナリだという意味です。 スレッドごとにローカルストレージのコピーを作成し、 別のスレッドとデータの衝突を起こさないようにしています。 - + それで、結局どっちを選べばいいのかですって? もし PHP を CGI として動かすつもりなら、スレッドセーフでなくてもかまいません。 diff --git a/faq/passwords.xml b/faq/passwords.xml index 8d54f6493e6..39afd1d8edf 100644 --- a/faq/passwords.xml +++ b/faq/passwords.xml @@ -1,6 +1,6 @@ - + 安全に、かつセキュアにパスワードをハッシュする @@ -116,7 +116,7 @@ - + ソルトはどのように保存すればいいのですか? diff --git a/faq/using.xml b/faq/using.xml index 8b14b7d6d65..51ad09a4029 100644 --- a/faq/using.xml +++ b/faq/using.xml @@ -1,6 +1,6 @@ - + @@ -95,7 +95,7 @@ if (empty($empty)) { - + もしデータベースに格納するためにそんなことをしようとしているのなら、 データベース自身が持つエスケープの仕組みを使うようにしましょう。 MySQL なら mysql_real_escape_string、 @@ -103,7 +103,7 @@ if (empty($empty)) { 汎用的な関数 addslashes や stripslashes もありますが、 これはさらに古い時代の PHP コードで使われていたものです。 - + 手動で値をエスケープする方法はエラーが発生しやすく、コンテキストに依存します。 エスケープした文字列を連結してクエリを組み立てるのではなく、 @@ -175,20 +175,19 @@ echo "myfunc($variable) = " . myfunc($variable); 'Warning: Cannot send session cookie - headers already sent...'や - 'Cannot add header information - headers already set...'といった + 'Cannot add header information - headers already sent...'といった メッセージが出力されるのですが。 - sent...'. - + header, set_cookieや セッション関数は出力ストリームに ヘッダを付加する関数で、ヘッダを送信できるのは本文の出力を 開始する前のみです。headers_sentを使って 既にヘッダが送信済みでないかチェックすることができます。 出力制御関数もご覧ください。 - + @@ -251,19 +250,19 @@ foreach ($headers as $name => $content) { - - Go to Internet Information - Services を変更する必要があります。PHP ファイルを選択して - プロパティを開き、セキュリティ タブに移動し、 - Edit -< Anonymous access and authentication control 。 - - + + Internet Information + Services を開く必要があります。PHP ファイルを選択して + プロパティを開き、File Security タブに移動し、 + Edit -> Anonymous access and authentication control に進みます。 + + この問題を解決するには Anonymous - Access のチェックをはずして Integrated Window - Authentication をチェックしたままにしておきか、 + Access のチェックをはずして Integrated Windows + Authentication をチェックしたままにしておくか、 あるいは Anonymous - Access をチェックしてアクセスできないユーザーを別途指定します。 - + Access をチェックして、匿名アクセスに使うユーザーを編集します(このユーザーにはアクセス権がないことがあるためです)。 + @@ -290,13 +289,12 @@ foreach ($headers as $name => $content) { - - あらかじめ設定されている変数を全て網羅したリストはどこにあるので - すか?なぜPHPのドキュメントにはその一覧がないのですか? - + + PHP で利用できる変数を全て網羅したリストはどこにあるのですか? + - + マニュアルの 定義済みの変数 のページを読んでください。スクリプト上で有効な定義済み変数のリストの @@ -306,7 +304,7 @@ foreach ($headers as $name => $content) { PHPの外部から来る変数 のセクションも読んでください。HTMLフォームやCookie、URL等から 来る外部変数に関するシナリオが説明されています。 - + @@ -336,7 +334,7 @@ foreach ($headers as $name => $content) { - + 有効なオプションは K(キロバイト)、M(メガバイト)および G(ギガバイト) です。これらはすべて、大文字小文字を区別しません。 これ以外の文字はバイト値と判断されます。 @@ -348,7 +346,7 @@ foreach ($headers as $name => $content) { 型にキャストされることに注意して下さい。 たとえば、0.5M は 0 と解釈されます。 - + キロバイト? キビバイト? diff --git a/features/commandline.xml b/features/commandline.xml index bcd6e680c88..a8c629c47f3 100644 --- a/features/commandline.xml +++ b/features/commandline.xml @@ -1,6 +1,6 @@ - + PHP をコマンドラインから使用する @@ -310,11 +310,11 @@ $ php -f another_directory/test.php - + CGI SAPI は、この &cli.sapi; の動作をコマンドライン実行時のスイッチ -C によりサポートしています。 - + @@ -535,8 +535,8 @@ string(15) "doesntmakesense" -h and -? --help and --usage - このオプションを使用すると、実際の一連のコマンドラインオプションと - 各1行の説明が情報を取得できます。 + コマンドラインオプションの一覧を、それぞれの機能を説明する + 1 行とともに出力します。 @@ -594,7 +594,7 @@ string(15) "doesntmakesense" --modules - PHP に組み込まれた (そしてロードされた) Zend モジュールの表示 + 組み込みの (およびロードされた) PHP モジュールと Zend モジュールの表示 - + 上記の方法は共に( スイッチの使用の如何に関らず) 指定したファイル my_script.php を実行します。 実行ファイルとしてあらゆるファイルを指定することができ、 PHP スクリプトは拡張子 .php で終わる必要がなく、任意の名前や拡張子を 使用することができます。 - + diff --git a/features/connection-handling.xml b/features/connection-handling.xml index 95c80342cba..8ba4603431d 100644 --- a/features/connection-handling.xml +++ b/features/connection-handling.xml @@ -1,6 +1,6 @@ - + 接続処理 diff --git a/features/cookies.xml b/features/cookies.xml index 82273441683..8c0b53b2729 100644 --- a/features/cookies.xml +++ b/features/cookies.xml @@ -1,6 +1,6 @@ - + @@ -21,20 +21,20 @@ スクリプトからの出力を遅らせることが出来ます。 - + もし variables_order が "C" を含んでいる場合、クライアントからサーバーへ送られた全てのクッキーは 自動的に $_COOKIE という(常にグローバルな)配列に格納されます。 多数の値を一つのクッキーに割り付けたい場合は、[] をクッキー名に加えてください。 - + - + ちょっとした注意やブラウザのバグといった詳細に関しては、 setcookie と setrawcookie を参照ください。 - + diff --git a/features/dtrace.xml b/features/dtrace.xml index e3d704aa336..0642b0aa1cc 100644 --- a/features/dtrace.xml +++ b/features/dtrace.xml @@ -1,6 +1,6 @@ - + DTrace 動的トレーシング @@ -100,16 +100,16 @@ それら自身のプローブを提供するどの PHP 拡張モジュールも、 共用拡張モジュールとして別々にビルドするべきです。 - + 静的プローブを有効にするには、環境変数を対象となるPHPプロセスにセットします。 - + コア PHP の DTrace 静的プローブ PHP では、以下の静的プローブが使用できます - + プローブ名 diff --git a/features/file-upload.xml b/features/file-upload.xml index 91132c50828..d705443b5d8 100644 --- a/features/file-upload.xml +++ b/features/file-upload.xml @@ -1,6 +1,6 @@ - + ファイルアップロードの処理 @@ -103,12 +103,12 @@ $_FILES['userfile']['type'] - + ファイルの MIME 型。ただし、ブラウザがこの情報を提供する場合。 例えば、"image/gif" のようになります。 この MIME 型は PHP 側ではチェックされません。そのため、 この値は信用できません。 - + @@ -245,7 +245,7 @@ foreach ($_FILES["pictures"]["error"] as $key => $error) { if ($error == UPLOAD_ERR_OK) { $tmp_name = $_FILES["pictures"]["tmp_name"][$key]; // basename() で、ひとまずファイルシステムトラバーサル攻撃は防げるでしょう。 - // ファイル名についてのその他のバリデーションも、適切に行いましょう。 + // ファイル名についてのその他のバリデーションやサニタイズも、適切に行いましょう。 $name = basename($_FILES["pictures"]["name"][$key]); move_uploaded_file($tmp_name, "data/$name"); } diff --git a/features/gc.xml b/features/gc.xml index 8d0583fcbf7..b76b015c931 100644 --- a/features/gc.xml +++ b/features/gc.xml @@ -1,6 +1,6 @@ - + ガベージコレクション @@ -352,13 +352,13 @@ a: (refcount=2, is_ref=1)=array ( 循環の収集 - + 伝統的に、PHP で以前使われていたようなリファレンスカウント記憶機構では、 循環参照メモリ・リークに対処できません。 - しかしながら、5.3.0 現在、PHP ではその問題に焦点を当てた + しかしながら、PHP 5.3.0 以降ではその問題に焦点を当てた Concurrent Cycle Collection in Reference Counted Systems レポートに由来する同期アルゴリズムを実装しています。 - + アルゴリズムの動作方法の詳しい説明についてはこのセクションで扱う範囲を超えるので、 ここではその基本を説明します。 diff --git a/features/http-auth.xml b/features/http-auth.xml index 86f5bf3ed55..2506b86a1f6 100644 --- a/features/http-auth.xml +++ b/features/http-auth.xml @@ -1,6 +1,6 @@ - + PHP による HTTP 認証 diff --git a/install/ini.xml b/install/ini.xml index 0669ddeab26..b57dd4cb524 100644 --- a/install/ini.xml +++ b/install/ini.xml @@ -1,6 +1,6 @@ - + @@ -37,9 +37,9 @@ インストールされたOS や PHP が 32bit や 64bit どちらのビルドかによって変わります。 32bit OS 上の 32bit ビルドの PHP、 もしくは 64bit OS 上の 64bit ビルドの PHP は - [(HKEY_LOCAL_MACHINE\SOFTWARE\PHP] を使いますが、 + [HKEY_LOCAL_MACHINE\SOFTWARE\PHP] を使いますが、 64bit OS 上での 32bit ビルドのPHPは、 - [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PHP]] を代わりに使います。 + [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PHP] を代わりに使います。 ビルドのbit数がOSと同じPHPのインストールの場合、 以下のレジストリキーを順に調べて使用します。 [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z]、 diff --git a/install/intro.xml b/install/intro.xml index 0890085b15c..6b96f59ad76 100644 --- a/install/intro.xml +++ b/install/intro.xml @@ -1,6 +1,6 @@ - + インストールにあたっての一般的な注意事項 diff --git a/install/pecl.xml b/install/pecl.xml index 5a5c0eab7c4..c3dac9c3a33 100644 --- a/install/pecl.xml +++ b/install/pecl.xml @@ -1,6 +1,6 @@ - + diff --git a/install/pie.xml b/install/pie.xml index 2d7ea46e1e1..ac7d424876b 100644 --- a/install/pie.xml +++ b/install/pie.xml @@ -1,6 +1,6 @@ - + PIE と サードパーティ拡張モジュールのインストール @@ -20,7 +20,7 @@ そのビルドの仕方やインストール方法も PIE は把握しています。 - PIE とその動作に必要なものをインストール した後は、 + PIE とその動作に必要なものをインストール した後は、 コマンドラインから以下を実行することで、 MongoDB 拡張モジュール をインストールできます。 diff --git a/install/problems.xml b/install/problems.xml index 13ca230a9db..4fba5f24497 100644 --- a/install/problems.xml +++ b/install/problems.xml @@ -1,6 +1,6 @@ - + @@ -46,6 +46,7 @@ バグの報告は、&url.php.bugs; にあるバグ追跡システムを使用して行います。 バグレポートをメーリングリストや個人宛てのメールで送らないでください。 + バグ追跡システムは、機能の要望を投稿する場合にも使えます。 バグ報告の仕方 を読み、 diff --git a/install/unix/commandline.xml b/install/unix/commandline.xml index 29cc0bd9568..fac77401cbd 100644 --- a/install/unix/commandline.xml +++ b/install/unix/commandline.xml @@ -1,6 +1,6 @@ - + CGI およびコマンドライン diff --git a/install/unix/dnf.xml b/install/unix/dnf.xml index 001fb57b980..0de453449f6 100644 --- a/install/unix/dnf.xml +++ b/install/unix/dnf.xml @@ -1,6 +1,6 @@ - + DNF を使用する GNU/Linux ディストリビューションでのパッケージからのインストール diff --git a/install/unix/litespeed.xml b/install/unix/litespeed.xml index 6ea79f6c9bc..9021572c2b1 100644 --- a/install/unix/litespeed.xml +++ b/install/unix/litespeed.xml @@ -1,6 +1,6 @@ - + LiteSpeed/OpenLiteSpeed Webサーバー(Unixシステム用) diff --git a/install/unix/nginx.xml b/install/unix/nginx.xml index 19529c924b7..391a7087058 100644 --- a/install/unix/nginx.xml +++ b/install/unix/nginx.xml @@ -1,6 +1,6 @@ - + Nginx 1.4.x (Unix システム用) @@ -50,7 +50,7 @@ diff --git a/reference/classobj/functions/is-a.xml b/reference/classobj/functions/is-a.xml index f35e8cde172..34c9a793ff3 100644 --- a/reference/classobj/functions/is-a.xml +++ b/reference/classobj/functions/is-a.xml @@ -1,6 +1,6 @@ - + @@ -45,11 +45,11 @@ allow_string - + このパラメータを &false; にすると、 クラス名を表す文字列を object_or_class に指定できなくなります。 そして、クラスが存在しない場合のオートローダーの呼び出しもしなくなります。 - + diff --git a/reference/classobj/functions/is-subclass-of.xml b/reference/classobj/functions/is-subclass-of.xml index f1baadd0947..a17148a8a86 100644 --- a/reference/classobj/functions/is-subclass-of.xml +++ b/reference/classobj/functions/is-subclass-of.xml @@ -1,6 +1,6 @@ - + @@ -44,11 +44,11 @@ allow_string - + このパラメータを false にすると、 クラス名を表す文字列を object_or_class に指定できなくなります。 そして、クラスが存在しない場合のオートローダーの呼び出しもしなくなります。 - + diff --git a/reference/com/com/construct.xml b/reference/com/com/construct.xml index f4c0b10922a..6a86b3e3dc8 100644 --- a/reference/com/com/construct.xml +++ b/reference/com/com/construct.xml @@ -1,6 +1,6 @@ - + @@ -33,7 +33,7 @@ ProgID は通常、アプリケーションまたは DLL の名前で、その後にピリオドが続き、 - オブジェクト名が続きます。e.g: Word.Application + オブジェクト名が続きます。e.g. Word.Application ClassID は、与えられたクラスを一意に識別するUUIDです。 diff --git a/reference/curl/examples.xml b/reference/curl/examples.xml index b7323b1c05f..8a5ce3884e9 100644 --- a/reference/curl/examples.xml +++ b/reference/curl/examples.xml @@ -1,6 +1,6 @@ - + @@ -37,7 +37,7 @@ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); $response = curl_exec($ch); if(curl_error($ch)) { - // エラーを処理するか、単に例外をスローします + // エラーを処理します throw new RuntimeException(curl_error($ch)); } ]]> diff --git a/reference/curl/functions/curl-getinfo.xml b/reference/curl/functions/curl-getinfo.xml index 3640f85bc3c..2f8734cb442 100644 --- a/reference/curl/functions/curl-getinfo.xml +++ b/reference/curl/functions/curl-getinfo.xml @@ -1,6 +1,6 @@ - + curl_getinfo diff --git a/reference/image/functions/imagegd.xml b/reference/image/functions/imagegd.xml index 4f24ee29391..0716cee0325 100644 --- a/reference/image/functions/imagegd.xml +++ b/reference/image/functions/imagegd.xml @@ -1,6 +1,6 @@ - + @@ -106,7 +106,7 @@ $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); // GD 画像を保存します -// GD 画像のファイル形式は .gd です。 http://www.libgd.org/GdFileFormats を参照ください +// GD 画像のファイル形式は .gd です。 https://libgd.github.io/manuals/2.3.3/files/gd_gd-c.html を参照ください imagegd($im, 'simple.gd'); ?> ]]> diff --git a/reference/image/functions/imagegd2.xml b/reference/image/functions/imagegd2.xml index 61be81e0421..0349330eb4b 100644 --- a/reference/image/functions/imagegd2.xml +++ b/reference/image/functions/imagegd2.xml @@ -1,6 +1,6 @@ - + @@ -116,7 +116,7 @@ $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, "A Simple Text String", $text_color); // GD2 画像を保存します -// GD2 画像のファイル形式は .gd2 です。 http://www.libgd.org/GdFileFormats を参照ください +// GD2 画像のファイル形式は .gd2 です。 https://libgd.github.io/manuals/2.3.3/files/gd_gd-c.html を参照ください imagegd2($im, 'simple.gd2'); ?> ]]> diff --git a/reference/image/functions/imagegrabwindow.xml b/reference/image/functions/imagegrabwindow.xml index a31c9b7e351..79f9500c1b5 100644 --- a/reference/image/functions/imagegrabwindow.xml +++ b/reference/image/functions/imagegrabwindow.xml @@ -1,6 +1,6 @@ - + @@ -128,7 +128,7 @@ imagepng($im, "iesnap.png"); $browser = new COM("InternetExplorer.Application"); $handle = $browser->HWND; $browser->Visible = true; -$browser->Navigate("http://www.libgd.org"); +$browser->Navigate("https://libgd.github.io"); /* まだ動作するか? */ while ($browser->Busy) { diff --git a/reference/sqlite3/sqlite3/prepare.xml b/reference/sqlite3/sqlite3/prepare.xml index 9b05c69a773..e98ee16a725 100644 --- a/reference/sqlite3/sqlite3/prepare.xml +++ b/reference/sqlite3/sqlite3/prepare.xml @@ -1,6 +1,6 @@ - + @@ -51,7 +51,6 @@ exec('CREATE TABLE foo (id INTEGER, bar STRING)'); diff --git a/security/apache.xml b/security/apache.xml index 0932edbd6b3..5d2fd7116fa 100644 --- a/security/apache.xml +++ b/security/apache.xml @@ -1,6 +1,6 @@ - + @@ -20,11 +20,11 @@ リプトの一部としてそのコードを読み込むことも可能です。 - しばしば、PHPユーザー(この場合はApacheユーザー)が非常に小さなリスクを - 有する場所に一度セキュリティが確立されると、PHPはユーザーディレクト - リにウイルスファイルを書き込んだりすることができなくなります。もし - くは、データベースにアクセスしたり変更したりといったことが出来なく - なります。この場合、良いファイルおよび悪いファイルの書き込み、また + PHPユーザー(この場合はApacheユーザー)のリスクがほとんどなくなるところまでセキュリティを高めてみると、 + PHPがユーザーディレクトリにファイルを一切書き込めなくなっていた、 + ということがよくあります。 + もしくは、データベースにアクセスしたり変更したりといったことが出来なく + なっていることもあります。この場合、良いファイルおよび悪いファイルの書き込み、また は、良いデータベーストランザクションと悪いデータベーストランザクシ ョンに関して等しく安全性が確保されていると言えます。 diff --git a/security/cgi-bin.xml b/security/cgi-bin.xml index f720194dbec..aa60524c35f 100644 --- a/security/cgi-bin.xml +++ b/security/cgi-bin.xml @@ -1,6 +1,6 @@ - + CGI バイナリとしてインストール @@ -177,7 +177,7 @@ AddHandler php-script .php のみです。 http://my.host/~user/doc.php のような URL は、ユーザーホームディレクトリ以下のファイルを開かず、 - user_dir 以下の ~user/doc.php + doc_root 以下の ~user/doc.php というファイルを開くことになります。 (ディレクトリ名がチルダ [~] で始まっている ということになります) diff --git a/security/current.xml b/security/current.xml index 0ad3606bbf7..92b1c678733 100644 --- a/security/current.xml +++ b/security/current.xml @@ -1,6 +1,6 @@ - + 最新版を維持する diff --git a/security/database.xml b/security/database.xml index ba5b13e1c97..9f490f8a8bd 100644 --- a/security/database.xml +++ b/security/database.xml @@ -1,6 +1,6 @@ - + @@ -46,9 +46,9 @@ 貴方が作成するアプリケーションがデータベースに対して行う操作の各方面ごとに、 操作対象となるオブジェクトに対して、出来る限り少ない権限を持った複数の ユーザーを作成した方が良いでしょう。ユーザーに対しては、最低限必要な権限のみを - 与え、関係の無いデータへのアクセスを許可しないようにします。これは、 - 万が一侵入者がそのユーザーの権限を以ってデータベースにアクセスした際に、 - アプリケーションと関係の無いデータにまでアクセスされることを防ぐためです。 + 与え、同じユーザーが異なる用途でデータベースを操作することのないようにします。 + こうしておけば、万が一侵入者がアプリケーションの認証情報を使ってデータベースに + アクセスしても、加えられる変更はアプリケーションにできる範囲に限られます。 @@ -244,7 +244,7 @@ $query = "UPDATE usertable SET pwd='$pwd' WHERE uid='$uid';"; $uid に代入するか、または、より多くの権限を得 るために、単純に$pwd に hehehe', trusted=100, admin='yesと設定すると、 - このクエリは以下のように改謬されてしまいます。 + このクエリは以下のように改ざんされてしまいます。 - + @@ -69,21 +69,20 @@ いと思った場合、システムがPHPによって構築されていることを知り得る 可能性があります。 - - 関数エラーは、システムが特定のデータベースエンジンが実行しているこ - と、または、Webページのプログラム内容や設計に関する鍵を示すことが - あります。これにより、データベースポートをオープンしたり、Webペー - ジに固有のバグや弱点を調べるといったより詳細な調査を行うことが可能 - となります。例えば、異なった不正なデータを送信することにより、攻撃 - 者は、(エラー行番号から)そのスクリプトの異なる場所を調べることと同 - 時にそのスクリプトの認証の順番を定義することが可能です。 - - + + 関数エラーは、システムで特定のデータベースエンジンが動作しているかどうかや、 + Webページがどのようにプログラム・設計されているかを示すことがあります。 + これにより、開いているデータベースポートや、Webページに固有のバグや弱点を + 調べるといった、より詳細な調査が可能となります。例えば、異なった不正なデータを + 送信することにより、攻撃者は(エラー行番号から)スクリプト内の認証の順番を + 突き止めたり、スクリプトのさまざまな場所に存在しうる脆弱性を探ったりできます。 + + ファイルシステムまたは一般的なPHPエラーは、Webサーバーが有する許可属 性やWebサーバーのファイル構造を示すことがあります。エラーコードを書 く開発者は、元は秘密の情報を容易に公開することにより、この問題を悪 化させる可能性があります。 - + この問題に対しては3種類の対策があります。最初の対策は、全ての関数 をよく調べ、大部分のエラーの修正を試みることです。2番目は、実行す diff --git a/security/filesystem.xml b/security/filesystem.xml index bb949a86cea..e9fadc36bdf 100644 --- a/security/filesystem.xml +++ b/security/filesystem.xml @@ -1,16 +1,16 @@ - + ファイルシステムのセキュリティ - PHP は、ファイルおよびディレクトリ毎に権限を設定する多くのサーバーシ - ステム上に組み込まれたセキュリティを提供します。これにより、ファイ + PHP には、多くのサーバーシステムに組み込まれている、 + ファイル単位・ディレクトリ単位の権限によるセキュリティが適用されます。これにより、ファイ ルシステム内のファイルを読み込み可能に制御することが可能になります。 - 全てのファイルは世界中から読み込み可能であり、このファイルシステム - にアクセスした全てのユーザーから読み込まれても安全であることを確認す - る必要があります。 + 誰でも読み込めるファイルについては、 + そのファイルシステムにアクセスできる全てのユーザーが読み込んでも安全であるよう、 + 注意する必要があります。 PHPは、ファイルシステムにユーザーレベルのアクセスを許可するように設 @@ -45,9 +45,9 @@ echo "ファイルは削除されました!"; ]]> - username および filename はユーザーフォームから投稿可能であるため、別の - username および filename を投稿して - 削除すべきではない削除することが可能となります。この場合、 + username および filename はユーザーフォームから投稿可能であるため、他人の + username および filename を投稿して、 + 本来は削除できないはずのファイルを削除できてしまいます。この場合、 他の何らかの形式の認証を使用するべきです。投稿された変数が、 "../etc/" と "passwd" であった場合について考えてみましょう。簡単 なコードを以下に示します。 @@ -104,7 +104,7 @@ if (file_exists($filepath) && unlink($filepath)) { } else { $logstring = "$filepath の削除に失敗しました\n"; } -j + $fp = fopen("/home/logging/filedelete.log", "a"); fwrite($fp, $logstring); fclose($fp); @@ -143,12 +143,12 @@ if (!ctype_alnum($username) || !preg_match('/^(?:[a-z0-9_-]|\.(?!\.))+$/iD', $us - + オペレーティングシステムによって、注意するべきファイルは大きく変化し - ます。これらには、デバイスエントリ(/dev/ または /dev/)、設定ファイル(/etc/ ファイルおよび .ini ファイル)、よく知られたファイル保存領 + ます。これらには、デバイスエントリ(/dev/ または COM1)、設定ファイル(/etc/ ファイルおよび .ini ファイル)、よく知られたファイル保存領 域 (/home/、My Documents)等が含まれます。このため、明示的に許可す るもの以外の全てを禁止する方針とする方が通常はより簡単です。 - + Null バイト関連の問題 @@ -189,7 +189,7 @@ if (file_exists('/home/wwwrun/' . $file . '.php')) { - + 一般的な考慮事項 diff --git a/security/hiding.xml b/security/hiding.xml index 290b30e7037..be86b3978fa 100644 --- a/security/hiding.xml +++ b/security/hiding.xml @@ -1,6 +1,6 @@ - + PHPの隠蔽 @@ -8,12 +8,12 @@ 一般に隠蔽という手段はセキュリティとしては弱いものだと言われています。 しかしこうした手法が望ましい場合もあります。 - + PHP を隠すための簡単な技法がいくつかあり、 システムの弱点を見つけようとする攻撃を遅延させることができる可能性があります。 &php.ini; ファイルで expose_php を off と設定すれば、 攻撃者が利用可能な情報を減らすことができます。 - + 他の手段は、ApacheのようなWebサーバーで PHPに異なるファイル形式をパースさせるように設定することです。 diff --git a/security/intro.xml b/security/intro.xml index 96a188b5cfb..92dee8b8448 100644 --- a/security/intro.xml +++ b/security/intro.xml @@ -1,6 +1,6 @@ - + はじめに @@ -31,10 +31,9 @@ きく依存しています。 - 本章は、安全に使用可能な異なった設定と条件の組み合わせについての説 - 明から始めます。続いて、複数のセキュリティレベルのコーディングにお - ける複数の考慮事項について説明し、最後にいくつかの一般的なセキュリ - ティ上のアドバイスを行います。 + 本章では、まずセキュリティに関する一般的なアドバイスを述べます。 + 続いて、設定オプションのさまざまな組み合わせと、それらを安全に使える状況について説明し、 + 最後に、セキュリティのレベルに応じたコーディング上の考慮事項について説明します。 diff --git a/security/variables.xml b/security/variables.xml index 4878e8b6f2a..065548a87ff 100644 --- a/security/variables.xml +++ b/security/variables.xml @@ -1,6 +1,6 @@ - + ユーザーが投稿したデータ @@ -60,13 +60,13 @@ exec ($evil_var); - + スクリプトを書いた後ではなく、書いている時にこれらの質問を適宜行う ことにより、セキュリティ改善のために不幸にして書き直しが必要になる ということを避けることができます。こうした考慮をまず行うことにより、 システムのセキュリティを保証できるわけではありませんが、改善の一助 にはなりえます。 - + 入力データの出所や有効性、完全性を曖昧にする便利な設定を無効にし、 セキュリティを強化してください。暗黙的な変数の生成や未検証の入力は、 @@ -80,14 +80,14 @@ exec ($evil_var); PHP ではそうしたリスクはなくなったものの、 入力処理の管理を誤れば、同様のリスクは依然として存在します。 - + error_reporting(E_ALL) を有効にし、未初期化の変数を検知し、入力を検証してください。 型安全を強制し、意図しない型変換を防止し、セキュリティ全体を改善するために、 strict モード (PHP 7 で導入された declare(strict_types=1)) を利用してください。 - +