CORE POS - IS4C
The CORE POS front end
Static Public Member Functions | List of all members
MiscLib Class Reference
Inheritance diagram for MiscLib:
LibraryClass

Static Public Member Functions

static baseURL ($check_file="css/pos.css")
 
static base_url ($check_file="css/pos.css")
 
static nullwrap ($num, $char=false)
 
static truncate2 ($num)
 
static pingport ($host, $dbms)
 
static win32 ()
 
static scaleObject ()
 
static sigTermObject ()
 
static goodBeep ()
 
static rePoll ()
 
static errorBeep ()
 
static twoPairs ()
 
static getAllIPs ()
 
static getNumbers ($string)
 

Detailed Description

MiscLib Generic functions

Member Function Documentation

static MiscLib::baseURL (   $check_file = "css/pos.css")
static

Path detection. Find the relative URL for POS root.

Parameters
$check_filefile 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
$numa 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
$hostname or IP
$dbmsdatabase 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
$numa number
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: