MiscLib Generic functions
static MiscLib::baseURL |
( |
|
$check_file = "css/pos.css" ) | |
|
|
static |
Path detection. Find the relative URL for POS root.
- Parameters
-
$check_file | file to search for |
- Returns
- A relative URL with trailing slash
static MiscLib::errorBeep |
( |
) | |
|
|
static |
Send error beep message to the scale
static MiscLib::getAllIPs |
( |
) | |
|
|
static |
Use ipconfig.exe or ifconfig, depending on OS, to determine all available IP addresses
- Returns
- [array] of [string] IP addresses
First: use OS utilities to check IP(s) This should be most complete but also may be blocked by permission settings
PHP 5.3 adds gethostname() function Try getting host name and resolving to an IP
$_SERVER may simply contain an IP address
$_SERVER may contain a host name that can be resolved to an IP address
static MiscLib::goodBeep |
( |
) | |
|
|
static |
Send good beep message to the scale
static MiscLib::nullwrap |
( |
|
$num, |
|
|
|
$char = false |
|
) |
| |
|
static |
Sanitizes values
- Parameters
-
$num | a value |
$char | [optional] boolean is character |
- Returns
- a sanitized value
Probably an artifact of ASP implementation. In practice any argument that evaluates to False get translated to integer zero.
static MiscLib::pingport |
( |
|
$host, |
|
|
|
$dbms |
|
) |
| |
|
static |
Connect to a host briefly
- Parameters
-
$host | name or IP |
$dbms | database type (supported: mysql, mssql) |
- Returns
- 1 on success
- 0 on failure
This still works if the environment doesn't have ping or ping has odd output. It also verifies the database is running as well as the host is up.
static MiscLib::rePoll |
( |
) | |
|
|
static |
Send re-poll message to the scale
static MiscLib::scaleObject |
( |
) | |
|
|
static |
Get the scale wrapper object
- Returns
- An ScaleDriverWrapper object
The driver is chosen via "scaleDriver" in session. If the object cannot be found this returns zero
static MiscLib::sigTermObject |
( |
) | |
|
|
static |
Get the signature capture wrapper object
- Returns
- An ScaleDriverWrapper object
The driver is chosen via "termDriver" in session. If the object cannot be found this returns zero.
Signature capture support is very alpha.
static MiscLib::truncate2 |
( |
|
$num) | |
|
|
static |
Convert number to string with two decimal digits
- Parameters
-
- Returns
- formatted string
static MiscLib::twoPairs |
( |
) | |
|
|
static |
Send two pairs beep message to the scale
static MiscLib::win32 |
( |
) | |
|
|
static |
Guess whether PHP is running on windows
- Returns
- 1 - windows 0 - not windows
The documentation for this class was generated from the following file:
- pos/is4c-nf/lib/MiscLib.php