本文整理汇总了PHP中MiscLib::getAllIPs方法的典型用法代码示例。如果您正苦于以下问题:PHP MiscLib::getAllIPs方法的具体用法?PHP MiscLib::getAllIPs怎么用?PHP MiscLib::getAllIPs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MiscLib
的用法示例。
在下文中一共展示了MiscLib::getAllIPs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
PHP is running as: <?php
echo InstallUtilities::whoami();
?>
<br />
<?php
if (!function_exists("socket_create")) {
echo '<b>Warning</b>: PHP socket extension is not enabled. NewMagellan will not work quite right';
}
?>
<br />
<table id="install" border=0 cellspacing=0 cellpadding=4>
<?php
$register_id_is_mapped = false;
$store_id_is_mapped = false;
if (is_array(CoreLocal::get('LaneMap'))) {
$my_ips = MiscLib::getAllIPs();
$map = CoreLocal::get('LaneMap');
foreach ($my_ips as $ip) {
if (!isset($map[$ip])) {
continue;
}
if (!is_array($map[$ip])) {
echo '<tr><td colspan="3">Error: invalid entry for ' . $ip . '</td></tr>';
} elseif (!isset($map[$ip]['register_id'])) {
echo '<tr><td colspan="3">Error: missing register_id for ' . $ip . '</td></tr>';
} elseif (!isset($map[$ip]['store_id'])) {
echo '<tr><td colspan="3">Error: missing store_id for ' . $ip . '</td></tr>';
} else {
if (CoreLocal::get('store_id') === '') {
// no store_id set. assign based on IP
CoreLocal::set('store_id', $map[$ip]['store_id']);
示例2: systemInit
/**
Initialize system default values in
session. Variables defined here
should always exist but won't be reset
to these values on a regular basis.
*/
public static function systemInit()
{
/**
@var standalone
indicates whether the server
database is available.
- 0 => server is available
- 1 => server is not available
*/
CoreLocal::set("standalone", 0);
/**
@var currentid
localtemptrans.trans_id for current
cursor position
*/
CoreLocal::set("currentid", 1);
/**
@var currenttopid
localtemptrans.trans_id for the first
item currently shown on screen
*/
CoreLocal::set("currenttopid", 1);
/**
@var training
Lane is in training mode
- 0 => not in training mode
- 1 => in training mode
*/
CoreLocal::set("training", 0);
/**
@var SNR
Scale Not Ready. Set a non-zero value
(normally a UPC) to be entered when
the scale settles on a weight
*/
CoreLocal::set("SNR", 0);
/**
@var weight
Currently scale weight (as float)
*/
CoreLocal::set("weight", 0);
/**
@var scale
Scale has a valid weight
- 0 => scale error or settling
- 1 => scale settled on weight
*/
CoreLocal::set("scale", 1);
/**
@var plainmsg
Lines of text to display on
main POS screen (pos2.php) that
are not part of a transaction. Used
for things like messages after signing
on or finishing/canceling/suspending a
transaction
*/
CoreLocal::set("plainmsg", "");
/**
Load lane and store numbers from LaneMap array
if present
*/
if (is_array(CoreLocal::get('LaneMap'))) {
$my_ips = MiscLib::getAllIPs();
foreach ($my_ips as $ip) {
if (!isset($map[$ip])) {
continue;
}
if (isset($map[$ip]['register_id']) && isset($map[$ip]['store_id'])) {
CoreLocal::set('laneno', $map[$ip]['register_id']);
CoreLocal::set('store_id', $map[$ip]['store_id']);
}
// use first matching IP
break;
}
}
}