aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mock/sql_insert_buffer.php
diff options
context:
space:
mode:
authorVjacheslav Trushkin <cyberalien@gmail.com>2013-09-26 12:02:17 +0300
committerVjacheslav Trushkin <cyberalien@gmail.com>2013-09-26 12:02:17 +0300
commit0e6ac7511eeb795ea3236b304d697660ed9f7e43 (patch)
treef5ca1e193726d33389e4540ff60a3b4ffa925ffb /tests/mock/sql_insert_buffer.php
parent779688b56b4fc22f975cb1b2a39b55d4b9afc231 (diff)
downloadforums-0e6ac7511eeb795ea3236b304d697660ed9f7e43.tar
forums-0e6ac7511eeb795ea3236b304d697660ed9f7e43.tar.gz
forums-0e6ac7511eeb795ea3236b304d697660ed9f7e43.tar.bz2
forums-0e6ac7511eeb795ea3236b304d697660ed9f7e43.tar.xz
forums-0e6ac7511eeb795ea3236b304d697660ed9f7e43.zip
[ticket/11868] Replace phpbb_request_interface references
PHPBB3-11868
Diffstat (limited to 'tests/mock/sql_insert_buffer.php')
0 files changed, 0 insertions, 0 deletions
n101'>101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
# -*-Shell-script-*-
#
# This file is not a stand-alone shell script; it provides functions 
# to network scripts that source it.

need_config()
{
    [ -f "${CONFIG}" ] || \
       CONFIG=../networking/default/${1}
    [ -f "${CONFIG}" ] || \
       CONFIG=../networking/default/ifcfg-${1}
    [ -f "${CONFIG}" ] || \
       CONFIG="ifcfg-${1}"
}

source_config ()
{
    DEVNAME=`basename $CONFIG | sed 's/^ifcfg-//g'`

    if basename $CONFIG | grep '[^g]-' >/dev/null 2>&1 ; then
	PARENTCONFIG=`echo $CONFIG | sed 's/-[^-]*$//g'`
	PARENTDEVNAME=`basename $PARENTCONFIG | sed 's/^ifcfg-//g'`
	[ -f $PARENTCONFIG ] || {
	    echo $"Missing config file $PARENTCONFIG." >&2
	    exit 1
	}
	. $PARENTCONFIG
    fi
    . $CONFIG
}

expand_config ()
{
    if [ -z "${NETMASK}" ]; then
	eval `/bin/ipcalc --netmask ${IPADDR}`
    fi

    if [ -z "${PREFIX}" ]; then
	eval `/bin/ipcalc --prefix ${IPADDR} ${NETMASK}`
    fi

    if [ -z "${BROADCAST}" ]; then
	eval `/bin/ipcalc --broadcast ${IPADDR} ${NETMASK}`
    fi

    if [ -z "${NETWORK}" ]; then
	eval `/bin/ipcalc --network ${IPADDR} ${NETMASK}`
    fi
}

toggle_value()
{
	if [ -z "$2" ]
	then
		echo ''
	elif [ "$2" = "yes"  -o "$2" = "YES" ] ; then
		echo "$1 on"
	elif [ "$2" = "no"  -o "$2" = "NO" ] ; then
		echo "$1 off"
	else
		echo ''
	fi
}
 
do_netreport ()
{
  # Notify programs that have requested notification
  ( cd /var/run/netreport || exit
    for i in * ; do
      if [ -f $i ]; then
        OWNER=`ls -l $i | awk '{ print $3 }'`
	
        if [ "`id -u`" = "0" ]; then
	  su $OWNER -c "kill -SIGIO $i >/dev/null 2>&1 || rm -f $i >/dev/null 2>&1" > /dev/null 2>&1
	else
	  kill -SIGIO $i >/dev/null 2>&1 || rm -f $i >/dev/null 2>&1
	fi
      fi
    done
  )
}

is_available ()
{
 LC_ALL= LANG= ip -o link | grep -q $1
 if [ "$?" = "1" ]; then
    alias=`modprobe -c | awk "/^alias $1 / { print \\$3 }"`
    if [ -z "$alias" -o "$alias" = "off" ]; then
        return 2
    fi
    modprobe $alias >/dev/null 2>&1|| {
      return 1
    }
 else
        return 0
 fi
}

need_hostname()
{
    if [ "`hostname`" = "(none)" -o "`hostname`" = "localhost" -o \
	 "`hostname`" = "localhost.localdomain" ]; then
	NEEDHOSTNAME=yes
    else
	unset NEEDHOSTNAME
    fi
}

set_hostname()
{
    hostname $1
    if ! grep search /etc/resolv.conf >/dev/null 2>&1; then
	domain=`echo $1 | sed 's/^[^\.]*\.//'`
	echo "search $domain" >> /etc/resolv.conf
    fi
}

check_device_down ()
{
    if echo $1 | grep -q ':' ; then
     if LC_ALL=C ifconfig -a 2>/dev/null | grep -q $1 ; then
	  retcode=1
     else
	  retcode=0
     fi
    else 
     if LC_ALL=C ip -o link ls dev $1 2>/dev/null | grep ",UP" >/dev/null 2>&1 ; then
	retcode=1
     else
	retcode=0
     fi
    fi
    return $retcode
}

check_link_down ()
{
    if [ -x /sbin/mii-tool ]; then
        LC_ALL=C ip link show $1 2>/dev/null| grep -q UP || ip link set $1 up >/dev/null 2>&1
	sleep 2
	/sbin/mii-tool >/dev/null 2>&1 || return 1
	output=`LC_ALL=C /sbin/mii-tool $1 2>&1`
	if echo $output | grep -q "Operation not supported"; then
	    return 1
	elif echo $output | grep -q "Invalid argument"; then
	    return 1
	elif echo $output | grep -q "link ok"; then
	    return 1
	elif echo $output | grep -q "No MII transceiver present"; then
	    return 1
	else
	    return 0
        fi
    fi
    return 0
}

check_default_route ()
{
   LC_ALL=C ip route | grep -q default
}

find_gateway_dev ()
{
    . /etc/sysconfig/network
    if [ "${GATEWAY}" != "" -a "${GATEWAY}" != "none" ] ; then
        export GATEWAY
        networks=`LC_ALL=C /sbin/route -n|awk '{print $1, ENVIRON["GATEWAY"],$3,$8}'|awk '{system("ipcalc --silent --network "$2" "$3" 2>/dev/null")}'|sed s^NETWORK=^^g`
        for net in $networks; do
            dev=`LC_ALL=C /sbin/route -n|grep ^$net|awk '{print $NF}'`
            if [ "$dev" != "" ] ; then
                GATEWAYDEV=$dev
            fi
        done
    fi
}

add_default_route ()
{
    . /etc/sysconfig/network
    find_gateway_dev
    if [ "${GATEWAY}" != "" -a "${GATEWAY}" != "none" -a "${GATEWAYDEV}" != "" ] ; then
        if ! check_device_down $1; then
            if [ "$GATEWAY" = "0.0.0.0" ]; then
                /sbin/ip route add default ${GATEWAYDEV}
            else
                /sbin/ip route add default via ${GATEWAY}
            fi
        fi
    else
    	if [ -f /etc/default-route ]; then
		/sbin/ip route add default via `cat /etc/default-route`
		rm -f /etc/default-route
	fi
    fi
}

is_wireless_device ()
{
  if [ -x /sbin/iwconfig ]; then
    LC_ALL=C iwconfig $1 2>&1 | grep -q "no wireless extensions" || return 0
  fi
  return 1
}