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


PHP isfile函数代码示例

本文整理汇总了PHP中isfile函数的典型用法代码示例。如果您正苦于以下问题:PHP isfile函数的具体用法?PHP isfile怎么用?PHP isfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了isfile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load_slp

function load_slp($lcode)
{
    $slp = "/etc/sealpac/" . $lcode . ".slp";
    if (isfile($slp) != "1") {
        return 0;
    }
    sealpac($slp);
    return 1;
}
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:9,代码来源:langpack.php

示例2: main_entry

function main_entry($uid)
{
    if ($uid == "") {
        return "No Child UID !!";
    }
    /* Check parent is up or not*/
    if (isfile("/var/run/CHILD." . $uid . ".UP") == 1) {
        cmd("service INET." . $uid . " stop");
    } else {
        msg("Child interface already stopped. Do nothing.");
    }
}
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:12,代码来源:stopchild.php

示例3: load_existed_slp

function load_existed_slp()
{
    $slp = "/var/sealpac/sealpac.slp";
    $slp2 = "/etc/sealpac/en.slp";
    if (isfile($slp) != "1") {
        if (isfile($slp2) != "1") {
            /*unload language pack*/
            sealpac("");
        } else {
            sealpac($slp2);
        }
    } else {
        //+++ Jerry Kao, modified to sync, the language pack info between
        //               /var/sealpac/sealpac.slp and /runtime/device/langcode
        $langcode = sealpac($slp);
        SLP_setlangcode($langcode);
    }
    return 1;
}
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:19,代码来源:lang.php

示例4: JSTemplate

 public function JSTemplate($name, $replacements = FALSE, $head = FALSE)
 {
     $fn = SITE_ROOT . '/ui/' . $name;
     if (isfile($fn)) {
         $result = file_get_contents($fn);
         if (is_array($replacements)) {
             foreach ($replacements as $k => $v) {
                 $value = str_replace("#@", '' . $this->local_unique, $this->UID() . '_' . $v);
                 $result = str_replace($k, $value, $result);
             }
         }
         if ($head !== FALSE) {
             $this->head_js .= $result;
         } else {
             $this->inline_js .= $result;
         }
         return $result;
     } else {
         plog('ui->JSTemplate(' . $name . ')', 'file not found');
         return "";
     }
 }
开发者ID:h3rb,项目名称:page,代码行数:22,代码来源:ui.php

示例5: IPT_build_time_command

                $timecmd = "";
            } else {
                $timecmd = IPT_build_time_command($sch);
            }
            if ($poli == "ACCEPT") {
                /*add  drop rule*/
                fwrite("a", $START, "iptables -A " . $CHAIN . " " . $timecmd . " -m mac --mac-source " . $mac . " -j LOG --log-level notice --log-prefix 'DRP:004:' \n");
                fwrite("a", $START, "iptables -A " . $CHAIN . " " . $timecmd . " -m mac --mac-source " . $mac . " -j " . $policy . " \n");
            } else {
                if ($poli == "DROP") {
                    /*add  accept rule*/
                    fwrite("a", $START, "iptables -A " . $CHAIN . " " . $timecmd . " -m mac --mac-source " . $mac . " -j RETURN \n");
                }
            }
            XNODE_set_var($CHAIN . ".USED", "1");
        }
    }
    // Modified by sanding chen.  adjust  the  position of the drop rule.
    // when poli is DROP,  there should be one DROP rule within a chain,  and it  must be posited at the tail of the chain.
    if ($poli == "DROP") {
        fwrite("a", $START, "iptables -A " . $CHAIN . " -j LOG --log-level notice --log-prefix 'DRP:004:' \n");
        fwrite("a", $START, "iptables -A " . $CHAIN . " -j " . $poli . " \n");
    }
    $j++;
}
/* if switch level macfilter exist, do it */
if (isfile("/usr/sbin/macfilter") == 1) {
    include "/etc/services/SWITCHMACFILTER.php";
}
fwrite("a", $START, "exit 0\n");
fwrite("a", $STOP, "exit 0\n");
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:31,代码来源:IPTMACCTRL.php

示例6: phyinf_setup

function phyinf_setup($ifname)
{
    $phyinf = XNODE_getpathbytarget("", "phyinf", "uid", $ifname, 0);
    if ($phyinf == "") {
        error("9");
        return;
    }
    if (query($phyinf . "/active") != "1") {
        error("8");
        return;
    }
    /* Set media */
    $media = query($phyinf . "/media/linktype");
    if ($media == "") {
        $media = "AUTO";
    }
    phyinf_setmedia($mode, $ifname, $media);
    startcmd("# PHYINF." . $ifname . ": media=" . $media . ", VID=" . $vid);
    /* Set IPv6 */
    if (isfile("/proc/net/if_inet6") == 1) {
        /* IPv6 is disabled by default (we modified the kernel code).
         * Enable IPv6 here. */
        $dev = PHYINF_getifname($ifname);
        if ($dev != "") {
            startcmd("echo 0 > /proc/sys/net/ipv6/conf/" . $dev . "/disable_ipv6");
            stopcmd("echo 1 > /proc/sys/net/ipv6/conf/" . $dev . "/disable_ipv6");
        }
    }
    /* Set the MAC address */
    $stsp = XNODE_getpathbytarget("/runtime", "phyinf", "uid", $ifname, 0);
    if ($stsp == "") {
        /* The LAYOUT service should be start before PHYINF.XXX.
         * We should never reach here !! */
        fwrite("w", "/dev/console", "PHYINF: The LAYOUT service should be start before PHYINF !!!\n");
    } else {
        $mac = query($phyinf . "/macaddr");
        if ($mac == "") {
            $mac = XNODE_get_var("MACADDR_" . $ifname);
        }
        $mac = tolower($mac);
        $curr = tolower(query($stsp . "/macaddr"));
        startcmd("# MAC: currrent " . $curr . ", target " . $mac);
        if ($mac != $curr) {
            SHELL_info($_GLOBALS["START"], "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" . "!!! Bad MAC address. Device may work abnormally. !!!\n" . "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
        }
    }
}
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:47,代码来源:phyinf.php

示例7: session_start

<?php

session_start();
require 'config/config.php';
require 'model/functions.fn.php';
if (isset($_FILES['music']) && !empty($_FILES['music']) && isset($_POST['title']) && !empty($_POST['title'])) {
    $file = $_FILES['music'];
    // Si le "fichier" reçu est bien un fichier
    if (isfile($file)) {
        $ext = strtolower(substr(strrchr($file['name'], '.'), 1));
        // Vérification des extentions
        if (preg_match('/\\.(mp3|ogg)$/i', $file['name'])) {
            $filename = md5(uniqid(rand(), true));
            $destination = "musics/{$filename}.{$_SESSION['id']}.{$ext}";
            move_uploaded_file($filename, $destination);
            add_music();
            header('Location: dashboard.php');
        } else {
            $error = 'Erreur, le fichier n\'a pas une extension autorisée !';
        }
    }
}
include 'view/_header.php';
include 'view/add_music.php';
include 'view/_footer.php';
开发者ID:GorillazHD,项目名称:cours-git-a2-exercice,代码行数:25,代码来源:add_music.php

示例8: i18n

</span>
        <span class="delimiter">:</span>
        <span class="value" id="st_aftrserver"></span>
    </div>
    <div class="textinput" >
        <span class="name"><?php 
echo i18n("DS-Lite DHCPv6 option");
?>
</span>
        <span class="delimiter">:</span>
        <span class="value" id="st_dslite_dhcp6opt"></span>
    </div>    
    <div class="gap"></div>
</div>
<?php 
if (isfile("/htdocs/webinc/body/st_device_3G.php") == 1) {
    dophp("load", "/htdocs/webinc/body/st_device_3G.php");
}
?>
<div class="blackbox" id="lan_ethernet_block" style="display:none">
	<h2><?php 
echo i18n("LAN");
?>
</h2>
	<div class="textinput">
		<span class="name"><?php 
echo i18n("MAC Address");
?>
</span>
		<span class="delimiter">:</span>
		<span class="value"><?php 
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:31,代码来源:st_device.php

示例9: TRACE_debug

<?php 
echo "<?";
?>
xml version="1.0" encoding="utf-8"<?php 
echo "?>";
?>

<?php 
include "/htdocs/phplib/trace.php";
echo "<" . $SIGNATURE . ">\n<runtime>\n<session>\n<" . $SESSION . ">\n";
TRACE_debug("GETCFG: serivce = " . $GETCFG_SVC);
if ($GETCFG_SVC != "") {
    $file = "/htdocs/webinc/getcfg/" . $GETCFG_SVC . ".xml.php";
    /* GETCFG_SVC will be passed to the child process. */
    if (isfile($file) == "1") {
        dophp("load", $file);
    }
}
echo "</" . $SESSION . ">\n</session>\n</runtime>\n</" . $SIGNATURE . ">\n";
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:19,代码来源:getcfg.php

示例10: query

 if ($base == "") {
     $cnt = query($diskp . "/entry#") + 1;
     $base = $diskp . "/entry:" . $cnt;
 } else {
     if ($fs != "UNKNOWN") {
         $cnt = query($diskp . "/entry#");
     } else {
         return;
     }
 }
 set($diskp . "/count", $cnt);
 set($base . "/uid", $UID);
 set($base . "/prefix", $prefix);
 set($base . "/pid", $pid);
 set($base . "/fs", $fs);
 if (isfile("/sbin/sfdisk") == "1" && $pid != "0") {
     setattr($base . "/id", "get", "sh /etc/scripts/usbmount_fsid.sh " . $prefix . $pid);
 } else {
     set($base . "/id", "");
 }
 set($base . "/mntp", $mntp);
 if ($fs == "UNKNOWN") {
     set($base . "/state", "NOT MOUNTED");
     set($base . "/space/size", "");
     set($base . "/space/used", "");
     set($base . "/space/available", "");
 } else {
     set($base . "/state", "MOUNTED");
     set($base . "/space/size", "CALCULATING");
     set($base . "/space/used", "CALCULATING");
     set($base . "/space/available", "CALCULATING");
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:31,代码来源:usbmount_helper.php

示例11: phyinf_setup

function phyinf_setup($ifname)
{
    $phyinf = XNODE_getpathbytarget("", "phyinf", "uid", $ifname, 0);
    if ($phyinf == "") {
        pifsetup_error("9");
        return;
    }
    if (query($phyinf . "/active") != "1") {
        pifsetup_error("8");
        return;
    }
    /* Get layout mode */
    $layout = query("/runtime/device/layout");
    if ($layout == "bridge") {
        $mode = "1BRIDGE";
    } else {
        if ($layout == "router") {
            $mode = query("/runtime/device/router/mode");
        } else {
            pifsetup_error("9");
            return;
        }
    }
    if ($mode == "") {
        $mode = "1W2L";
    }
    /* Set media */
    $media = query($phyinf . "/media/linktype");
    phyinf_setmedia($mode, $ifname, $media);
    /* Set IPv6 */
    if (isfile("/proc/net/if_inet6") == 1) {
        /**********************************************************************************
         * only enable ipv6 function at br0(LAN) and eth2.2(WAN), other disable by default
         *********************************************************************************/
        phyinf_setipv6($mode, $ifname);
    }
    /* Set the MAC address */
    $stsp = XNODE_getpathbytarget("/runtime", "phyinf", "uid", $ifname, 0);
    if ($stsp == "") {
        /* The LAYOUT service should be start before PHYINF.XXX.
         * We should never reach here !! */
        fwrite("w", "/dev/console", "PHYINF: The LAYOUT service should be start before PHYINF !!!\n");
    } else {
        if (query($stsp . "/bridge/port#") > 0) {
            /* DO NOT allow to change the bridge device's MAC address. */
            startcmd("# " . $ifname . " is a bridge device, skip MAC address setting.");
        } else {
            $mac = PHYINF_gettargetmacaddr($mode, $ifname);
            $curr = tolower(query($stsp . "/macaddr"));
            if ($mac != $curr) {
                fwrite("w", "/dev/console", "PHYINF." . $ifname . ": cfg[" . $mac . "] curr[" . $curr . "], restart the device !!!\n");
                //startcmd('xmldbc -t "restart:3:/etc/init0.d/rcS"');
                $if_name = query($stsp . "/name");
                startcmd('ifconfig ' . $if_name . ' down');
                startcmd('ifconfig ' . $if_name . ' hw ether ' . $mac);
                startcmd('ifconfig ' . $if_name . ' up');
            }
        }
    }
}
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:60,代码来源:phyinf.php

示例12: array_shift

array_shift($files);
array_shift($files);
//skip . and ..
$parent = $currentfolder;
function isfile($f)
{
    $r = preg_match('/.jpg/', $f);
    //match the jpeg files
    if ($r > 0) {
        return $f;
    } else {
        return;
    }
}
echo "<p>Current Upload Image Folder:<span id=\"foldername\">{$parent}</span></p>";
echo '<ul>';
//the line below is pure chance !
echo "<li><a href=\"javascript:listimagefolder('{$folder}/')\" />Back</a></li>";
foreach ($files as $folder) {
    echo "<li><a href=\"javascript:listimagefolder('{$parent}{$folder}/')\" />{$folder}</a></li>";
}
echo '</ul>';
foreach ($files as $handle) {
    //process only files not directory
    if (isfile($handle)) {
        $image = $myMan->thumbize($handle);
        echo "<div class=\"grab\" ><a href=\"{$img}{$image['4']}\">Grab url({$image['0']}x{$image['1']})</a></div><img src=\"{$tld}{$imgdir}{$image['4']}\" width=\"{$image['5']}\" height=\"{$image['6']}\"  onclick=\"alert('Image name ={$image['4']}');\" />";
        echo "<br style='clear:both' />";
    } else {
    }
}
开发者ID:refschool,项目名称:mucms,代码行数:31,代码来源:imagefolderresponse.php

示例13: fread

Content-Type: text/xml; charset=utf-8

<?php 
echo "\\<\\?xml version='1.0' encoding='utf-8'\\?\\>";
include "/htdocs/phplib/xnode.php";
include "/htdocs/webinc/config.php";
include "/htdocs/phplib/trace.php";
$result = "OK";
$buildver = fread("s", "/etc/config/buildver");
$CurrentMajor = cut($buildver, 0, ".");
$CurrentMinor = substr(cut($buildver, 1, "."), 0, 2);
$CurrentFWVersion = $CurrentMajor . "." . $CurrentMinor;
$path_run_inf_lan1 = XNODE_getpathbytarget("/runtime", "inf", "uid", $LAN1, 0);
$FWUploadUrl = get("", $path_run_inf_lan1 . "/inet/ipv4/ipaddr") . "/fwupload.cgi";
//we run checkfw.sh in hnap.cgi, so we can get fw info. now
if (isfile("/tmp/fwinfo.xml") == 1) {
    TRACE_debug("checkfw.sh success!");
    $LatesMajor = substr(get("", "/runtime/firmware/fwversion/Major"), 1, 2);
    $LatesMinor = get("", "/runtime/firmware/fwversion/Minor");
    $LatestFWVersion = $LatesMajor . "." . $LatesMinor;
    $FWDownloadUrl = get("", "/runtime/firmware/FWDownloadUrl");
} else {
    TRACE_debug("checkfw.sh fail!");
    $result = "ERROR";
    $LatestFWVersion = "null";
    $FWDownloadUrl = "null";
}
?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
	<GetFirmwareStatusResponse xmlns="http://purenetworks.com/HNAP1/">
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:31,代码来源:GetFirmwareStatus.php

示例14: srviptsetupall

function srviptsetupall($prefix)
{
    $i = 1;
    while ($i > 0) {
        $ifname = $prefix . "-" . $i;
        $ifpath = XNODE_getpathbytarget("", "inf", "uid", $ifname, 0);
        if ($ifpath == "") {
            $i = 0;
            break;
        }
        fwrite("a", $_GLOBALS["START"], "service IPT." . $ifname . " start\n");
        fwrite("a", $_GLOBALS["STOP"], "service IPT." . $ifname . " stop\n");
        if (isfile("/proc/net/if_inet6") == 1) {
            fwrite("a", $_GLOBALS["START"], "service IP6T." . $ifname . " start\n");
            fwrite("a", $_GLOBALS["STOP"], "service IP6T." . $ifname . " stop\n");
        }
        $i++;
    }
}
开发者ID:jhbsz,项目名称:DIR-850L_A1,代码行数:19,代码来源:interface.php

示例15: HTML

 public function HTML($html, $replacements = FALSE, $body = TRUE)
 {
     if (isfile($html, 'html/', FALSE)) {
         $html = file_get_contents('html/' . $html);
     }
     $out = '';
     if (false_or_null($replacements) === TRUE) {
         if (is_array($html)) {
             foreach ($html as $h) {
                 $out .= $h;
             }
         } else {
             $out = $html;
         }
     } else {
         if (is_array($replacements)) {
             if (is_array($html)) {
                 foreach ($html as $h) {
                     if (isfile($h, 'html/', FALSE)) {
                         $replaced = file_get_contents('html/' . $h);
                     } else {
                         $replaced = $h;
                     }
                     foreach ($replacements as $string => $replace) {
                         $replaced = str_replace($string, $replace, $replaced);
                     }
                     $out .= $replaced;
                 }
             } else {
                 if (isfile($html, 'html/', FALSE)) {
                     $replaced = file_get_contents($html);
                 } else {
                     $replaced = $html;
                 }
                 foreach ($replacements as $string => $replace) {
                     $replaced = str_replace($string, $replace, $replaced);
                 }
                 $out = $replaced;
             }
         } else {
             error('Page:HTML(`' . $html . '`,`' . $replacements . '`', 'replacements provided was not array');
         }
     }
     if ($body === TRUE) {
         $this->body[] = $out;
     } else {
         $this->head[] = $out;
     }
     return $out;
 }
开发者ID:h3rb,项目名称:page,代码行数:50,代码来源:Page.php


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