Properties
Properties existing in the Solar_Getopt class.
Public
$options
(array) The array of acceptable options.
The $options array contains all options accepted by the
application, including their types, default values, descriptions,
requirements, and validation callbacks.
In general, you should not try to set $options yourself; instead, use Solar_Getopt::setOption() and/or Solar_Getopt::setOptions().
Protected
$_Solar_Getopt
(array) Default configuration values.
$_argv
(array) The arguments passed in from the command line.
$_config
(array) Collection point for configuration values.
Inherited from Solar_Base.
Note that you do not define config defaults in $_config directly.
<?php
// DO NOT DO THIS
protected $_config = array(
'foo' => 'bar',
'baz' => 'dib',
);
Instead, define config defaults in a protected property named for the class, withan underscore prefix.
For exmple, a "Vendor_Class_Name" class would define the default config array in "$_Vendor_Class_Name". This convention lets child classes inherit parent config keys and values.
<?php
// DO THIS INSTEAD
protected $_Vendor_Class_Name = array(
'foo' => 'bar',
'baz' => 'dib',
);
$_default
(array) Default option settings.
-
long -
(string) The long-form of the option name (e.g., "--foo-bar" would be "foo-bar").
-
short -
(string) The short-form of the option, if any (e.g., "-f" would be "f").
-
descr -
(string) A description of the option (used in "help" output).
-
param -
(string) When the option is present, does it take a parameter? If so, the param can be "r[eq[uired]]" every time, or be "[o[pt[ional]]". If empty, no parameter for the option will be recognized (the option's value will be boolean true when the option is present). Default is null; recognizes
o',opt,optional,r,req, andrequired. -
value -
(mixed) The default value for the option parameter, if any. This way, options not specified in the arguments can have a default value.
-
require -
(bool) At validation time, the option must have a non-blank value of some sort.
-
filters -
(array) An array of filters to apply to the parameter value. This can be a single filter (
array('validateInt')), or a series of filters (array('validateInt', array('validateRange', -10, +10)).
$_invalid
(array) List of names for invalid option values, and error messages.
$_values
(array) Option values parsed from the arguments, as well as remaining (numeric) arguments.
Private
None.