| | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
PHP_CompatInfo::parseDirPHP_CompatInfo::parseDir() – ディレクトリをパースする
Synopsis
require_once 'PHP/CompatInfo.php';
Descriptionディレクトリを再帰的にパースして互換性情報を取得します。 Parameter
Throws例外はスローされません。 SeePHP_CompatInfo::parseFolder() 、 PHP_CompatInfo::parseData() も参照ください。 Sinceバージョン 0.8.0 (2004-04-22) 以降 NoteThis function can not be called statically. Return valuearray - 以下のキーを含むハッシュを返します。 ignored_functions, ignored_extensions, ignored_constants, max_version, version, extensions, constants, tokens, cond_code Exampleこれらのディレクトリ/ファイルをパースするものとします。 PHP_CompatInfo/tests/parseDir/ PHP5/tokens.php5 PHP5/upload_error.php extensions.php phpinfo.php このスクリプトの中身については配布パッケージを参照ください。
<?php
結果はこのようになります。
array (
'ignored_files' =>
array (
),
'ignored_functions' =>
array (
),
'ignored_extensions' =>
array (
),
'ignored_constants' =>
array (
),
'max_version' => '',
'version' => '5.2.0',
'extensions' =>
array (
0 => 'xdebug',
1 => 'gd',
2 => 'sapi_apache',
3 => 'sapi_cgi',
4 => 'sqlite',
),
'constants' =>
array (
0 => 'UPLOAD_ERR_INI_SIZE',
1 => 'UPLOAD_ERR_FORM_SIZE',
2 => 'UPLOAD_ERR_PARTIAL',
3 => 'UPLOAD_ERR_NO_FILE',
4 => 'UPLOAD_ERR_NO_TMP_DIR',
5 => 'UPLOAD_ERR_CANT_WRITE',
6 => 'UPLOAD_ERR_EXTENSION',
7 => 'UPLOAD_ERR_OK',
),
'tokens' =>
array (
0 => 'abstract',
1 => 'protected',
2 => 'interface',
3 => 'public',
4 => 'implements',
5 => 'private',
6 => 'clone',
7 => 'instanceof',
8 => 'try',
9 => 'throw',
10 => 'catch',
11 => 'final',
),
'cond_code' =>
array (
0 => 2,
1 =>
array (
0 =>
array (
),
1 =>
array (
),
2 =>
array (
),
),
),
'PHP_CompatInfo/tests/parseDir/extensions.php' =>
array (
'ignored_functions' =>
array (
),
'ignored_extensions' =>
array (
),
'ignored_constants' =>
array (
),
'max_version' => '',
'version' => '4.3.2',
'extensions' =>
array (
0 => 'xdebug',
1 => 'gd',
2 => 'sapi_apache',
3 => 'sapi_cgi',
4 => 'sqlite',
),
'constants' =>
array (
),
'tokens' =>
array (
),
'cond_code' =>
array (
0 => 2,
1 =>
array (
0 =>
array (
),
1 =>
array (
),
2 =>
array (
),
),
),
),
'PHP_CompatInfo/tests/parseDir/phpinfo.php' =>
array (
'ignored_functions' =>
array (
),
'ignored_extensions' =>
array (
),
'ignored_constants' =>
array (
),
'max_version' => '',
'version' => '4.0.0',
'extensions' =>
array (
),
'constants' =>
array (
),
'tokens' =>
array (
),
'cond_code' =>
array (
0 => 0,
1 =>
array (
0 =>
array (
),
1 =>
array (
),
2 =>
array (
),
),
),
),
'PHP_CompatInfo/tests/parseDir/PHP5/tokens.php5' =>
array (
'ignored_functions' =>
array (
),
'ignored_extensions' =>
array (
),
'ignored_constants' =>
array (
),
'max_version' => '',
'version' => '5.0.0',
'extensions' =>
array (
),
'constants' =>
array (
),
'tokens' =>
array (
0 => 'abstract',
1 => 'protected',
2 => 'interface',
3 => 'public',
4 => 'implements',
5 => 'private',
6 => 'clone',
7 => 'instanceof',
8 => 'try',
9 => 'throw',
10 => 'catch',
11 => 'final',
),
'cond_code' =>
array (
0 => 0,
1 =>
array (
0 =>
array (
),
1 =>
array (
),
2 =>
array (
),
),
),
),
'PHP_CompatInfo/tests/parseDir/PHP5/upload_error.php' =>
array (
'ignored_functions' =>
array (
),
'ignored_extensions' =>
array (
),
'ignored_constants' =>
array (
),
'max_version' => '',
'version' => '5.2.0',
'extensions' =>
array (
),
'constants' =>
array (
0 => 'UPLOAD_ERR_INI_SIZE',
1 => 'UPLOAD_ERR_FORM_SIZE',
2 => 'UPLOAD_ERR_PARTIAL',
3 => 'UPLOAD_ERR_NO_FILE',
4 => 'UPLOAD_ERR_NO_TMP_DIR',
5 => 'UPLOAD_ERR_CANT_WRITE',
6 => 'UPLOAD_ERR_EXTENSION',
7 => 'UPLOAD_ERR_OK',
),
'tokens' =>
array (
0 => 'throw',
),
'cond_code' =>
array (
0 => 0,
1 =>
array (
0 =>
array (
),
1 =>
array (
),
2 =>
array (
),
),
),
),
)
まず全体的な結果を出力し、 続けてサブディレクトリ内の各ファイルの情報を出力します。 |
|
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「PHP_CompatInfo::parseDir」をGoogle検索
|