当前位置: 首页>>代码示例>>PHP>>正文


PHP MiscLib::getAllIPs方法代码示例

本文整理汇总了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']);
开发者ID:phpsmith,项目名称:IS4C,代码行数:31,代码来源:index.php

示例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;
         }
     }
 }
开发者ID:phpsmith,项目名称:IS4C,代码行数:83,代码来源:CoreState.php


注:本文中的MiscLib::getAllIPs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。