MiscLib Generic functions
static COREPOS\pos\lib\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 COREPOS\pos\lib\MiscLib::errorBeep |
( |
| ) |
|
|
static |
Send error beep message to the scale
static COREPOS\pos\lib\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
static COREPOS\pos\lib\MiscLib::goodBeep |
( |
| ) |
|
|
static |
Send good beep message to the scale
static COREPOS\pos\lib\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 COREPOS\pos\lib\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 COREPOS\pos\lib\MiscLib::rePoll |
( |
| ) |
|
|
static |
Send re-poll message to the scale
static COREPOS\pos\lib\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 COREPOS\pos\lib\MiscLib::truncate2 |
( |
|
$num | ) |
|
|
static |
Convert number to string with two decimal digits
- Parameters
-
- Returns
- formatted string
static COREPOS\pos\lib\MiscLib::twoPairs |
( |
| ) |
|
|
static |
Send two pairs beep message to the scale
static COREPOS\pos\lib\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