array readPHPArgv (
)
種々のPHP 設定を考慮して、$argv 配列を読みます。 ini ディレクティブ中の register_globals と register_argc_argv を考慮します。
array
-
オプションとパラメータを含む配列、もしくは PEAR_Error です。
エラーコード | エラーメッセージ | 理由 | 対処法 |
---|---|---|---|
NULL | "Console_Getopt: Could not read cmd args (register_argc_argv=Off?)" | PHP は、コマンドライン引数を当スクリプトに与えません。 | php.ini の "register_argc_argv" をチェックしてください。 |
This function can not be called statically.
readPHPArgv() の使用
<?php
$con = new Console_Getopt;
$args = $con->readPHPArgv();
array_shift($args);
$options = $con->getopt2($args, $shortopt);
?>